Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate old Cubic EoS #1519

Merged
merged 10 commits into from
Nov 21, 2024
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Cubic Equations of State
========================

.. deprecated:: 2.7
Use :class:`idaes.models.properties.modular_properties.eos.ceos` in the Modular Property Framework instead.

This property package implements a general form of a cubic equation of state which can be used for most cubic-type equations of state. This package supports phase equilibrium calculations with a smooth phase transition formulation that makes it amenable for equation oriented optimization. The following equations of state are currently supported:

* Peng-Robinson
Expand Down
13 changes: 13 additions & 0 deletions idaes/models/properties/cubic_eos/cubic_prop_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
)
from pyomo.common.config import ConfigDict, ConfigValue, In
from pyomo.contrib.incidence_analysis import solve_strongly_connected_components
from pyomo.common.deprecation import deprecated

# Import IDAES cores
from idaes.core import (
Expand Down Expand Up @@ -97,6 +98,12 @@
_log = idaeslog.getLogger(__name__)


@deprecated(
msg="The standalone cubic property package has been deprecated in favor of the "
"cubic equation of state for the modular property framework. This class will be "
"removed in the May 2025 release.",
version="2.7.0",
)
@declare_process_block_class("CubicParameterBlock")
class CubicParameterData(PhysicalParameterBlock):
"""
Expand Down Expand Up @@ -222,6 +229,12 @@ def define_metadata(cls, obj):
)


@deprecated(
msg="The standalone cubic property package has been deprecated in favor of the "
"cubic equation of state for the modular property framework. This class will be "
"removed in the May 2025 release.",
version="2.7.0",
)
class CubicEoSInitializer(InitializerBase):
"""
Initializer for CubicEoS property packages.
Expand Down
8 changes: 5 additions & 3 deletions idaes/models/properties/cubic_eos/tests/test_BT_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)
from pyomo.util.check_units import assert_units_consistent

import idaes.logger as idaeslog
from idaes.models.properties.tests.test_harness import PropertyTestHarness
from idaes.core.solvers import get_solver

Expand Down Expand Up @@ -76,12 +77,13 @@ def configure(self):
@pytest.mark.skipif(not prop_available, reason="Cubic root finder not available")
class TestBTExample(object):
@pytest.mark.component
def test_units(self):
def test_units(self, caplog):
m = ConcreteModel()

m.fs = FlowsheetBlock(dynamic=False)

m.fs.props = BT_PR.BTParameterBlock(valid_phase=("Vap", "Liq"))
with caplog.at_level(idaeslog.WARNING):
m.fs.props = BT_PR.BTParameterBlock(valid_phase=("Vap", "Liq"))
assert "May 2025 release." in caplog.text

m.fs.state = m.fs.props.build_state_block([0], defined_state=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)

from idaes.core import FlowsheetBlock, Component
import idaes.logger as idaeslog
from idaes.models.properties.cubic_eos.cubic_prop_pack import (
CubicParameterBlock,
CubicStateBlock,
Expand Down Expand Up @@ -51,12 +52,13 @@ class TestParameterBlock(object):
not cubic_roots_available(), reason="Cubic functions not available"
)
@pytest.mark.unit
def test_build_default(self):
def test_build_default(self, caplog):
m = ConcreteModel()

m.fs = FlowsheetBlock(dynamic=False)

m.fs.params = CubicParameterBlock()
with caplog.at_level(idaeslog.WARNING):
m.fs.params = CubicParameterBlock()
assert "May 2025 release." in caplog.text

assert m.fs.params.state_block_class is CubicStateBlock
assert m.fs.params.config.valid_phase == ("Vap", "Liq")
Expand Down
Loading