diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index caabd96..8b9baca 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -105,6 +105,10 @@ jobs: jupyter kernelspec list - name: Run pytest with nbmake run: | + # watertap is needed to run the following notebooks in src/reaktoro_pse/tutorials: + # - basic_reaktoro_block_interaction.ipynb + # - integration_with_ro.ipynb + pip install watertap pytest --nbmake --nbmake-kernel="${{ env.KERNEL_NAME }}" src/reaktoro_pse/tutorials/*.ipynb - name: Upload coverage report as job artifact if: matrix.coverage diff --git a/pyproject.toml b/pyproject.toml index 39224c6..c6bc931 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ readme = "README.md" dynamic = ["version"] dependencies = [ "pyomo", + "watertap-solvers >=24.12.9", ] [project.optional-dependencies] testing = [ diff --git a/requirements-dev.txt b/requirements-dev.txt index d16d263..801e515 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,5 @@ black==24.8.0 pytest-cov idaes-pse>=2.5.0 -watertap>=1.0.0 pyomo>=6.8.0 --editable .[testing] \ No newline at end of file diff --git a/src/reaktoro_pse/core/tests/test_reaktoro_builder.py b/src/reaktoro_pse/core/tests/test_reaktoro_builder.py index c9c4d42..fe563c3 100644 --- a/src/reaktoro_pse/core/tests/test_reaktoro_builder.py +++ b/src/reaktoro_pse/core/tests/test_reaktoro_builder.py @@ -35,7 +35,7 @@ ) from pyomo.environ import Block, assert_optimal_termination from idaes.core.util.model_statistics import degrees_of_freedom -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver @pytest.fixture diff --git a/src/reaktoro_pse/examples/biogas_combustion.py b/src/reaktoro_pse/examples/biogas_combustion.py index a761654..287c908 100644 --- a/src/reaktoro_pse/examples/biogas_combustion.py +++ b/src/reaktoro_pse/examples/biogas_combustion.py @@ -17,7 +17,7 @@ Constraint, units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver from pyomo.util.calc_var_value import calculate_variable_from_constraint import idaes.core.util.scaling as iscale diff --git a/src/reaktoro_pse/examples/reaktoro_pse_to_phreeqc_comparison/standard_model.py b/src/reaktoro_pse/examples/reaktoro_pse_to_phreeqc_comparison/standard_model.py index 75af141..99dd04b 100644 --- a/src/reaktoro_pse/examples/reaktoro_pse_to_phreeqc_comparison/standard_model.py +++ b/src/reaktoro_pse/examples/reaktoro_pse_to_phreeqc_comparison/standard_model.py @@ -17,7 +17,7 @@ Constraint, units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver from pyomo.util.calc_var_value import calculate_variable_from_constraint import idaes.core.util.scaling as iscale diff --git a/src/reaktoro_pse/examples/simple_desalination.py b/src/reaktoro_pse/examples/simple_desalination.py index 7ad74c3..7bc208b 100644 --- a/src/reaktoro_pse/examples/simple_desalination.py +++ b/src/reaktoro_pse/examples/simple_desalination.py @@ -19,7 +19,7 @@ units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver from pyomo.util.calc_var_value import calculate_variable_from_constraint import idaes.core.util.scaling as iscale diff --git a/src/reaktoro_pse/examples/simple_ion_exchange.py b/src/reaktoro_pse/examples/simple_ion_exchange.py index d309344..851c890 100644 --- a/src/reaktoro_pse/examples/simple_ion_exchange.py +++ b/src/reaktoro_pse/examples/simple_ion_exchange.py @@ -18,7 +18,7 @@ Constraint, units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver from pyomo.util.calc_var_value import calculate_variable_from_constraint import idaes.core.util.scaling as iscale diff --git a/src/reaktoro_pse/examples/thermal_precipitation.py b/src/reaktoro_pse/examples/thermal_precipitation.py index 986b043..e26876a 100644 --- a/src/reaktoro_pse/examples/thermal_precipitation.py +++ b/src/reaktoro_pse/examples/thermal_precipitation.py @@ -19,7 +19,7 @@ assert_optimal_termination, units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver from pyomo.util.calc_var_value import calculate_variable_from_constraint import reaktoro import idaes.core.util.scaling as iscale diff --git a/src/reaktoro_pse/parallel_tools/reaktoro_block_manager.py b/src/reaktoro_pse/parallel_tools/reaktoro_block_manager.py index 084ae02..15643b6 100644 --- a/src/reaktoro_pse/parallel_tools/reaktoro_block_manager.py +++ b/src/reaktoro_pse/parallel_tools/reaktoro_block_manager.py @@ -219,7 +219,7 @@ class ReaktoroBlockManagerData(ProcessBlockData): default=True, domain=bool, description="Enables use of parallel workers", - doc="""If true, will parallelize all rekatoro solver calls using multiprocessing""", + doc="""If true, will parallelize all reaktoro solver calls using multiprocessing""", ), ) CONFIG.declare( diff --git a/src/reaktoro_pse/parallel_tools/tests/test_manager.py b/src/reaktoro_pse/parallel_tools/tests/test_manager.py index 1a34170..addf873 100644 --- a/src/reaktoro_pse/parallel_tools/tests/test_manager.py +++ b/src/reaktoro_pse/parallel_tools/tests/test_manager.py @@ -24,7 +24,7 @@ assert_optimal_termination, units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver def test_blockBuild_with_speciation_block(build_rkt_state_with_species): diff --git a/src/reaktoro_pse/tests/test_reaktoro_block.py b/src/reaktoro_pse/tests/test_reaktoro_block.py index a51984d..6c256a1 100644 --- a/src/reaktoro_pse/tests/test_reaktoro_block.py +++ b/src/reaktoro_pse/tests/test_reaktoro_block.py @@ -19,7 +19,7 @@ assert_optimal_termination, units as pyunits, ) -from watertap.core.solvers import get_solver +from watertap_solvers import get_solver @pytest.fixture diff --git a/src/reaktoro_pse/tutorials/basic_reaktoro_block_interaction.ipynb b/src/reaktoro_pse/tutorials/basic_reaktoro_block_interaction.ipynb index 506df63..a452bcb 100644 --- a/src/reaktoro_pse/tutorials/basic_reaktoro_block_interaction.ipynb +++ b/src/reaktoro_pse/tutorials/basic_reaktoro_block_interaction.ipynb @@ -13,7 +13,8 @@ "* IDAES - Python package extending Pyomo for flowsheet modeling\n", "* cyipopt - Solver necessary for use with gray box models\n", "* Reaktoro-pse - Python package for building Reaktoro gray box models\n", - "* WaterTAP - for cyipopt-solver wrapper " + "* watertap-solvers - for cyipopt solver wrapper\n", + "* WaterTAP - for NaCl property package" ] }, { @@ -40,7 +41,7 @@ "\n", "* Input ion composition (apparent or exact species)\n", "* System temperature, pressure, pH, and charge neutrality\n", - "* Rekatoro databases and activity models\n", + "* Reaktoro databases and activity models\n", "* Outputs supported by Reaktoro and custom outputs built using Reaktoro database information and outputs \n", "\n", "The general API structure is shown in Figure bellow. The figure shows the type of inputs and outputs and how they are handled by core api to configure Reaktoro Graybox model. " @@ -132,7 +133,7 @@ ")\n", "\n", "from idaes.core.util.model_statistics import degrees_of_freedom\n", - "from watertap.core.solvers import get_solver\n", + "from watertap_solvers import get_solver\n", "\n", "from pyomo.util.calc_var_value import calculate_variable_from_constraint\n", "\n", diff --git a/src/reaktoro_pse/tutorials/integration_with_ro.ipynb b/src/reaktoro_pse/tutorials/integration_with_ro.ipynb index d6d43a4..66ca614 100644 --- a/src/reaktoro_pse/tutorials/integration_with_ro.ipynb +++ b/src/reaktoro_pse/tutorials/integration_with_ro.ipynb @@ -13,6 +13,7 @@ "* IDAES - Python package extending Pyomo for flowsheet modeling\n", "* cyipopt - Solver necessary for use with gray box models\n", "* Reaktoro-pse - Python package for building Reaktoro gray box models\n", + "* watertap-solvers - for cyipopt solver wrapper\n", "* WaterTAP - Unit models" ] }, @@ -69,7 +70,7 @@ ")\n", "\n", "from idaes.core.util.model_statistics import degrees_of_freedom\n", - "from watertap.core.solvers import get_solver\n", + "from watertap_solvers import get_solver\n", "\n", "from idaes.core.util.initialization import propagate_state\n", "\n",