Skip to content

Commit

Permalink
[137_choose_modules], issue - #137, Transformed the list of modules t…
Browse files Browse the repository at this point in the history
…o load into a dictionary
  • Loading branch information
lelaus committed Mar 4, 2024
1 parent c494589 commit 99b6b06
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
4 changes: 2 additions & 2 deletions lbh15/_lbh15.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LiquidMetalInterface(ABC):
_correlations_to_use: Dict[str, str] = {}
_roots_to_use: Dict[str, int] = {}
_default_corr_to_use: Dict[str, str] = {}
_properties_modules_list: List[str] = []
_properties_modules_dict: Dict[str, str] = {}
_custom_properties_path: Dict[str, List[str]] = {}
_available_properties_dict: Dict[str, PropertyInterface] = {}
_available_correlations_dict: Dict[str, List[str]] = {}
Expand Down Expand Up @@ -656,7 +656,7 @@ def __load_properties(cls,
"""
# Consider default modules if none is provided
if modules is None:
modules = cls._properties_modules_list
modules = list(cls._properties_modules_dict.values())

def is_valid(obj):
'''
Expand Down
10 changes: 5 additions & 5 deletions lbh15/bismuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ class Bismuth(LiquidMetalInterface):
_custom_properties_path: Dict[str, List[str]] = {}
_available_properties_dict: Dict[str, PropertyInterface] = {}
_available_correlations_dict: Dict[str, List[str]] = {}
_properties_modules_list: List[str] = \
['lbh15.properties.bismuth_thermochemical_properties\
_properties_modules_dict: Dict[str, str] = \
{'solubility': 'lbh15.properties.bismuth_thermochemical_properties\
.solubility_in_bismuth',
'lbh15.properties.bismuth_thermochemical_properties\
'diffusivity': 'lbh15.properties.bismuth_thermochemical_properties\
.diffusivity_in_bismuth',
'lbh15.properties.bismuth_thermochemical_properties\
'thermochem': 'lbh15.properties.bismuth_thermochemical_properties\
.bismuth_thermochemical',
'lbh15.properties.bismuth_properties']
'thermophys': 'lbh15.properties.bismuth_properties'}

def __init__(self, p: float = atm, **kwargs):
self._guess = BISMUTH_BOILING_TEMPERATURE / 2.0
Expand Down
16 changes: 10 additions & 6 deletions lbh15/lbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@ class LBE(LiquidMetalInterface):
_custom_properties_path: Dict[str, List[str]] = {}
_available_properties_dict: Dict[str, PropertyInterface] = {}
_available_correlations_dict: Dict[str, List[str]] = {}
_properties_modules_list: List[str] = \
['lbh15.properties.lbe_thermochemical_properties.solubility_in_lbe',
'lbh15.properties.lbe_thermochemical_properties.diffusivity_in_lbe',
'lbh15.properties.lbe_thermochemical_properties.lbe_thermochemical',
'lbh15.properties.lbe_thermochemical_properties.lbe_oxygen_limits',
'lbh15.properties.lbe_properties']
_properties_modules_dict: Dict[str, str] = \
{'solubility': 'lbh15.properties.lbe_thermochemical_properties\
.solubility_in_lbe',
'diffusivity': 'lbh15.properties.lbe_thermochemical_properties\
.diffusivity_in_lbe',
'thermochem': 'lbh15.properties.lbe_thermochemical_properties\
.lbe_thermochemical',
'oxygenlims': 'lbh15.properties.lbe_thermochemical_properties\
.lbe_oxygen_limits',
'thermophys': 'lbh15.properties.lbe_properties'}

def __init__(self, p: float = atm, **kwargs):
self._guess = LBE_BOILING_TEMPERATURE / 2.0
Expand Down
16 changes: 10 additions & 6 deletions lbh15/lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ class Lead(LiquidMetalInterface):
_custom_properties_path: Dict[str, List[str]] = {}
_available_properties_dict: Dict[str, PropertyInterface] = {}
_available_correlations_dict: Dict[str, List[str]] = {}
_properties_modules_list: List[str] = \
['lbh15.properties.lead_thermochemical_properties.solubility_in_lead',
'lbh15.properties.lead_thermochemical_properties.diffusivity_in_lead',
'lbh15.properties.lead_thermochemical_properties.lead_thermochemical',
'lbh15.properties.lead_thermochemical_properties.lead_oxygen_limits',
'lbh15.properties.lead_properties']
_properties_modules_dict: Dict[str, str] = \
{'solubility': 'lbh15.properties.lead_thermochemical_properties\
.solubility_in_lead',
'diffusivity': 'lbh15.properties.lead_thermochemical_properties\
.diffusivity_in_lead',
'thermochem': 'lbh15.properties.lead_thermochemical_properties\
.lead_thermochemical',
'oxygenlims': 'lbh15.properties.lead_thermochemical_properties\
.lead_oxygen_limits',
'thermophys': 'lbh15.properties.lead_properties'}

def __init__(self, p: float = atm, **kwargs):
self._guess = LEAD_BOILING_TEMPERATURE / 2.0
Expand Down

0 comments on commit 99b6b06

Please sign in to comment.