Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion idaes/core/base/control_volume0d.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _add_material_balance_common(
"You should set has_phase_equilibrium=False."
)
deprecation_warning(
msg=msg, logger=_log, version="2.0.0", remove_in="3.0.0"
msg=msg, logger=_log, version="2.0.0", remove_in="2.14.0"
)
has_phase_equilibrium = False
else:
Expand Down
2 changes: 1 addition & 1 deletion idaes/core/base/control_volume1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def _add_material_balance_common(
"You should set has_phase_equilibrium=False."
)
deprecation_warning(
msg=msg, logger=_log, version="2.0.0", remove_in="3.0.0"
msg=msg, logger=_log, version="2.0.0", remove_in="2.14.0"
)
has_phase_equilibrium = False
else:
Expand Down
4 changes: 2 additions & 2 deletions idaes/core/base/property_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def VOLUME_MOLE(self):
@property
def MOLAR_VOLUME(self):
msg = "The unit name MOLAR_VOLUME is being deprecated in favor of VOLUME_MOL."
deprecation_warning(msg=msg, logger=_log, version="2.3.0", remove_in="3.0.0")
deprecation_warning(msg=msg, logger=_log, version="2.3.0", remove_in="2.14.0")
return self.VOLUME_MOLE

# Flows
Expand Down Expand Up @@ -542,7 +542,7 @@ def add_properties(self, p: dict):
"different property set by calling the define_property_set() method."
)
deprecation_warning(
msg=msg, logger=_log, version="2.0.0", remove_in="3.0.0"
msg=msg, logger=_log, version="2.0.0", remove_in="2.14.0"
)
n = k
i = None
Expand Down
2 changes: 1 addition & 1 deletion idaes/core/base/tests/test_control_volume_0d.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def test_add_material_balances_single_phase_w_equilibrium(caplog):
"include phase equilibrium terms. Some property packages support phase "
"equilibrium implicitly in which case additional terms are not "
"necessary. You should set has_phase_equilibrium=False. (deprecated in "
"2.0.0, will be removed in (or after) 3.0.0)"
"2.0.0, will be removed in (or after) 2.14.0)"
)
assert msg.replace(" ", "") in caplog.records[0].message.replace("\n", "").replace(
" ", ""
Expand Down
2 changes: 1 addition & 1 deletion idaes/core/base/tests/test_control_volume_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ def test_add_material_balances_single_phase_w_equilibrium(caplog):
"include phase equilibrium terms. Some property packages support phase "
"equilibrium implicitly in which case additional terms are not "
"necessary. You should set has_phase_equilibrium=False. (deprecated in "
"2.0.0, will be removed in (or after) 3.0.0)"
"2.0.0, will be removed in (or after) 2.14.0)"
)
assert msg.replace(" ", "") in caplog.records[0].message.replace("\n", "").replace(
" ", ""
Expand Down
2 changes: 1 addition & 1 deletion idaes/core/solvers/petsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def petsc_dae_by_time_element(
msg="Keyword argument snes_options has been DEPRECATED in favor of initial_solver_options.",
logger=_log,
version="2.2.0",
remove_in="3.0.0",
remove_in="2.14.0",
)
initial_solver_options = snes_options

Expand Down
4 changes: 4 additions & 0 deletions idaes/core/util/scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ def set_scaling_factor(c, v, data_objects=True, overwrite=True):
# doesn't exist. This handles the case where you get a constant 0 and
# need its scale factor to scale the mass balance.
return 1

# Cast scaling factor to float to catch garbage input
v = float(v)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is v supposed to be?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scaling factor. This is in the old tools, I tried to use more descriptive variable names in the new tools.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why do we need to cast it to a float? I'd expect it to either already be one, or fail at some point because it's not in which case we should catch it and have a custom error message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyomo Suffixes allow pretty much anything as values. I've ended up assigning a Pyomo Var or Expression as a scaling factor before due to errors in my code. What happens is that set_scaling_factor allows it to be put on the Suffix, but then an error gets raised when it comes time to write the .nl file. This later error is hard to trace back to the original point where the mistake was made.


try:
suf = c.parent_block().scaling_factor

Expand Down
Loading