diff --git a/src/alfasim_score/converter/alfacase/_tests/test_convert_materials/test_convert_materials.yml b/src/alfasim_score/converter/alfacase/_tests/test_convert_materials/test_convert_materials.yml index 046389e..02b8489 100644 --- a/src/alfasim_score/converter/alfacase/_tests/test_convert_materials/test_convert_materials.yml +++ b/src/alfasim_score/converter/alfacase/_tests/test_convert_materials/test_convert_materials.yml @@ -34,102 +34,6 @@ thermal_conductivity: 45.345257 thermal_expansion: 1.2e-05 type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid -- density: 65.5035 - heat_capacity: 460.9 - name: SDSS/125KSI - thermal_conductivity: 45.345257 - thermal_expansion: 1.2e-05 - type: solid - density: 1.0 heat_capacity: 5.0 name: Folhelho diff --git a/src/alfasim_score/converter/alfacase/convert_alfacase.py b/src/alfasim_score/converter/alfacase/convert_alfacase.py index 09b1869..03ba140 100644 --- a/src/alfasim_score/converter/alfacase/convert_alfacase.py +++ b/src/alfasim_score/converter/alfacase/convert_alfacase.py @@ -29,9 +29,8 @@ def filter_duplicated_materials( material_list: List[MaterialDescription], ) -> List[MaterialDescription]: """Remove the duplicated materials parsed by the reader""" - # TODO: implement it to filter the duplicated materials - # TODO: remember to get all cements (???) - return material_list + filtered = {material.name: material for material in material_list} + return list(filtered.values()) class ScoreAlfacaseConverter: @@ -69,7 +68,7 @@ def convert_materials(self) -> List[MaterialDescription]: expansion=data["thermal_expansion"], ) ) - return material_descriptions + return filter_duplicated_materials(material_descriptions) # TODO PWPA-1937: implement this method def _convert_annulus(self) -> AnnulusDescription: