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

Add dependency on watertap-solvers #14

Merged
merged 7 commits into from
Dec 10, 2024
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ readme = "README.md"
dynamic = ["version"]
dependencies = [
"pyomo",
"watertap-solvers >=24.12.9",
]
[project.optional-dependencies]
testing = [
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion src/reaktoro_pse/core/tests/test_reaktoro_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/examples/biogas_combustion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/examples/simple_desalination.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/examples/simple_ion_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/examples/thermal_precipitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/parallel_tools/reaktoro_block_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/parallel_tools/tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/reaktoro_pse/tests/test_reaktoro_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand All @@ -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. "
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/reaktoro_pse/tutorials/integration_with_ro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -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",
Expand Down
Loading