Skip to content
Snippets Groups Projects
Commit 231a266d authored by Rahil Doshi's avatar Rahil Doshi
Browse files

Merge branch 'development' into release/v0.1.0

parents 80a8ba47 bdb75b2b
No related branches found
No related tags found
No related merge requests found
Pipeline #76419 passed
...@@ -115,6 +115,12 @@ class Alloy: ...@@ -115,6 +115,12 @@ class Alloy:
- If solidus temperature is greater than liquidus temperature. - If solidus temperature is greater than liquidus temperature.
- If temperatures are outside the general range for alloys (450 K to 2000 K). - If temperatures are outside the general range for alloys (450 K to 2000 K).
""" """
if not isinstance(self.temperature_solidus, float):
raise AlloyTemperatureError(f"Solidus temperature must be a float, "
f"got {type(self.temperature_solidus).__name__}.")
if not isinstance(self.temperature_liquidus, float):
raise AlloyTemperatureError(f"Liquidus temperature must be a float, "
f"got {type(self.temperature_liquidus).__name__}.")
if self.temperature_solidus > self.temperature_liquidus: if self.temperature_solidus > self.temperature_liquidus:
raise AlloyTemperatureError("The solidus temperature must be less than or equal to the liquidus temperature.") raise AlloyTemperatureError("The solidus temperature must be less than or equal to the liquidus temperature.")
if not (450 <= self.temperature_solidus <= 1900): if not (450 <= self.temperature_solidus <= 1900):
......
...@@ -239,7 +239,7 @@ def read_data_from_file(file_config: Union[str, Dict], header: bool = True) -> T ...@@ -239,7 +239,7 @@ def read_data_from_file(file_config: Union[str, Dict], header: bool = True) -> T
temp = df[temp_col].to_numpy(dtype=np.float64) temp = df[temp_col].to_numpy(dtype=np.float64)
else: else:
raise ValueError(f"Temperature column '{temp_col}' not found in file. " raise ValueError(f"Temperature column '{temp_col}' not found in file. "
f"Available columns: {', '.join(df.columns)}") f"\n -> Available columns: {', '.join(df.columns)}")
else: else:
if temp_col >= len(df.columns): if temp_col >= len(df.columns):
raise ValueError(f"Temperature column index {temp_col} out of bounds (file has {len(df.columns)} columns)") raise ValueError(f"Temperature column index {temp_col} out of bounds (file has {len(df.columns)} columns)")
...@@ -250,7 +250,7 @@ def read_data_from_file(file_config: Union[str, Dict], header: bool = True) -> T ...@@ -250,7 +250,7 @@ def read_data_from_file(file_config: Union[str, Dict], header: bool = True) -> T
prop = df[prop_col].to_numpy(dtype=np.float64) prop = df[prop_col].to_numpy(dtype=np.float64)
else: else:
raise ValueError(f"Property column '{prop_col}' not found in file. " raise ValueError(f"Property column '{prop_col}' not found in file. "
f"Available columns: {', '.join(df.columns)}") f"\n -> Available columns: {', '.join(df.columns)}")
else: else:
if prop_col >= len(df.columns): if prop_col >= len(df.columns):
raise ValueError(f"Property column index {prop_col} out of bounds (file has {len(df.columns)} columns)") raise ValueError(f"Property column index {prop_col} out of bounds (file has {len(df.columns)} columns)")
......
This diff is collapsed.
...@@ -125,8 +125,8 @@ composition: ...@@ -125,8 +125,8 @@ composition:
Ni: 0.0806 Ni: 0.0806
Fe: 0.70695 Fe: 0.70695
solidus_temperature: 1605 solidus_temperature: 1605.
liquidus_temperature: 1735 liquidus_temperature: 1735.
properties: properties:
......
...@@ -7,12 +7,12 @@ composition: ...@@ -7,12 +7,12 @@ composition:
Mo: 0.025 Mo: 0.025
Mn: 0.010 Mn: 0.010
solidus_temperature: 1605 solidus_temperature: 1605.
liquidus_temperature: 1735 liquidus_temperature: 1735.
properties: properties:
# 1. Constant float property # 1. Constant float property
density: 7950. # kg/m³ density: compute # kg/m³
# 2.1 File-based property (simple format) # 2.1 File-based property (simple format)
heat_conductivity: ./heat_conductivity_temperature.txt heat_conductivity: ./heat_conductivity_temperature.txt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment