Skip to content

Commit

Permalink
fix issue with file path?
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-a-a committed Oct 25, 2024
1 parent 4895335 commit 67e5b54
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions watertap/unit_models/tests/test_surrogate_crystallizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,15 @@ def add_crystallizer_rbf_model(
"Glauberite_g",
"Halite_g",
]
surrogate_directory = os.path.dirname(os.path.abspath(__file__))
surrogate_directory = os.path.join(surrogate_directory,'surrogate_crystallizer_defaults')

for sm in range(0, len(filename)):
block_name = "crystallizer_surrogate" + "_" + filename[sm]
blk.add_component(block_name, SurrogateBlock(concrete=True))
surrogate_directory = os.path.dirname(os.path.abspath(__file__))

current_surrogate_filename = (
f"{surrogate_directory}\\surrogate_crystallizer_defaults\\"
+ filename[sm]
+ r".json"
)
surrogate_name = f"{filename[sm]}.json"
current_surrogate_filename = os.path.join(surrogate_directory, surrogate_name)
current_surrogate = PysmoSurrogate.load_from_file(
os.path.normpath(current_surrogate_filename)
)
Expand Down Expand Up @@ -144,11 +143,6 @@ def test_rbf_surrogate():
solids_ions_dict=solids_list,
)

print(
"Degrees of freedom of crystallizer model with undefined feed",
degrees_of_freedom(m),
)

# Feed composition
feed = {
"ion_composition_g_kg": {
Expand Down Expand Up @@ -176,10 +170,7 @@ def test_rbf_surrogate():

m.fs.cryst.inlet.temperature.fix(298.15)
m.fs.cryst.inlet.pressure.fix(101325)
print(
"Degrees of freedom of crystallizer model with defined feed",
degrees_of_freedom(m),
)

assert_units_consistent(m)

# Create dummy variables for inputs and outputs
Expand Down

0 comments on commit 67e5b54

Please sign in to comment.