From 31af9aa3acdca03ba583902f579ccae07add5543 Mon Sep 17 00:00:00 2001 From: kbonney Date: Mon, 17 Jun 2024 09:12:11 -0400 Subject: [PATCH 01/17] adding continue on error --- .github/workflows/build_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 6e28fe818..2e36cb72d 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -10,6 +10,7 @@ on: branches: [ main, dev ] schedule: - cron: '0 0 1 * *' + workflow_dispatch: jobs: @@ -94,6 +95,7 @@ jobs: coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" --append -m pytest --doctest-glob="*.rst" documentation env: COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + continue-on-error: true - name: Save coverage uses: actions/upload-artifact@v2 From 44eed085cffef6c3bd3ac4c0d61bb54fcec44087 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:09:39 -0400 Subject: [PATCH 02/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 2e36cb72d..d88c661ba 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -10,7 +10,6 @@ on: branches: [ main, dev ] schedule: - cron: '0 0 1 * *' - workflow_dispatch: jobs: @@ -69,6 +68,7 @@ jobs: - name: Usage of wntr run: | python -c "import wntr" + continue-on-error: true pytest_coverage: runs-on: ${{ matrix.os }} From e086ac9f803f19fa471c68503ac7ed1588d11c5e Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:31:48 -0400 Subject: [PATCH 03/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index d88c661ba..4d7ae4a8a 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - os: [windows-latest, macOS-latest, ubuntu-latest] + os: [windows-latest, macOS-13, ubuntu-latest] steps: - uses: actions/checkout@v2 - name: Set up Python @@ -47,7 +47,7 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - os: [windows-latest, macOS-latest, ubuntu-latest] + os: [windows-latest, macOS-13, ubuntu-latest] steps: - name: Set up Python uses: actions/setup-python@v4 @@ -68,14 +68,13 @@ jobs: - name: Usage of wntr run: | python -c "import wntr" - continue-on-error: true pytest_coverage: runs-on: ${{ matrix.os }} strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - os: [windows-latest, macOS-latest, ubuntu-latest] + os: [windows-latest, macOS-13, ubuntu-latest] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -95,7 +94,6 @@ jobs: coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" --append -m pytest --doctest-glob="*.rst" documentation env: COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }} - continue-on-error: true - name: Save coverage uses: actions/upload-artifact@v2 From dee4ccbca2b5d18be5e9d4264afcaeb45658a495 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:46:14 -0400 Subject: [PATCH 04/17] Update requirements.txt --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index dcac431d4..94ca62f08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Required -numpy>=1.21 +numpy>=1.21, <2.0 scipy<1.13.0 networkx pandas @@ -26,4 +26,4 @@ pytest nbformat nbconvert ipykernel -coverage \ No newline at end of file +coverage From 99bc0165f34469e54fb68de42db91cd7b7b0d34e Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:48:44 -0400 Subject: [PATCH 05/17] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 609502d22..0e4de3db7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-2019, macOS-11, ubuntu-20.04] + os: [windows-2019, macOS-13, ubuntu-20.04] steps: - uses: actions/checkout@v3 - name: Build wheels From 9d58aec29c6a08240642c8630d64dc363461097b Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:26:32 -0400 Subject: [PATCH 06/17] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d7fa01ee0..50cc2f986 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "numpy>=1.21"] +requires = ["setuptools", "numpy>=1.21, <2.0"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] From 3fe29cc499633d9ba469d93d6583e5562784d1f2 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:27:39 -0400 Subject: [PATCH 07/17] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0ae9e1510..215a74eed 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ MAINTAINER_EMAIL = 'kaklise@sandia.gov' LICENSE = 'Revised BSD' URL = 'https://github.com/USEPA/WNTR' -DEPENDENCIES = ['numpy>=1.21', 'scipy', 'networkx', 'pandas', 'matplotlib', 'setuptools'] +DEPENDENCIES = ['numpy>=1.21, <2.0', 'scipy', 'networkx', 'pandas', 'matplotlib', 'setuptools'] # use README file as the long description file_dir = os.path.abspath(os.path.dirname(__file__)) From 2a6a9e34d6e89785fb18d43ea77127ad1296ea84 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:12:51 -0400 Subject: [PATCH 08/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 4d7ae4a8a..7f5b40ccb 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -18,7 +18,8 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - os: [windows-latest, macOS-13, ubuntu-latest] + os: [windows-latest, macOS-13, ubuntu-latest] + fail-fast: false steps: - uses: actions/checkout@v2 - name: Set up Python From d82fae59d46f6aadf12422eb075b8e41d18ba98c Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:02:22 -0400 Subject: [PATCH 09/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 7f5b40ccb..8cc055db2 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -48,7 +48,8 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - os: [windows-latest, macOS-13, ubuntu-latest] + os: [windows-latest, macOS-13, ubuntu-latest] + fail-fast: false steps: - name: Set up Python uses: actions/setup-python@v4 @@ -76,6 +77,7 @@ jobs: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] os: [windows-latest, macOS-13, ubuntu-latest] + fail-fast: false steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From bb987abd2eab7f17fa635dbe54ab9d114d8323b5 Mon Sep 17 00:00:00 2001 From: kbonney Date: Mon, 17 Jun 2024 16:41:37 -0400 Subject: [PATCH 10/17] addressing enum member naming bug --- wntr/tests/test_network.py | 4 ++-- wntr/tests/test_network_controls.py | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wntr/tests/test_network.py b/wntr/tests/test_network.py index d7ec9a1ce..5e30e1204 100644 --- a/wntr/tests/test_network.py +++ b/wntr/tests/test_network.py @@ -142,7 +142,7 @@ def test_add_pipe(self): self.assertEqual(l.name, "p1") self.assertEqual(l.start_node_name, "j1") self.assertEqual(l.end_node_name, "j2") - self.assertEqual(l.initial_status, self.wntr.network.LinkStatus.opened) + self.assertEqual(l.initial_status, self.wntr.network.LinkStatus.Opened) self.assertEqual(l.length, 1000.0) self.assertEqual(l.diameter, 1.0) self.assertEqual(l.roughness, 100.0) @@ -255,7 +255,7 @@ def test_remove_controls_for_removing_link(self): wn = self.wntr.network.WaterNetworkModel(inp_file) control_action = self.wntr.network.ControlAction( - wn.get_link("21"), "status", self.wntr.network.LinkStatus.opened + wn.get_link("21"), "status", self.wntr.network.LinkStatus.Opened ) control = self.wntr.network.controls.Control._conditional_control( wn.get_node("2"), "head", np.greater_equal, 10.0, control_action diff --git a/wntr/tests/test_network_controls.py b/wntr/tests/test_network_controls.py index 6650d6ea1..9b6222a68 100644 --- a/wntr/tests/test_network_controls.py +++ b/wntr/tests/test_network_controls.py @@ -102,13 +102,13 @@ def test_time_control_open_vs_closed(self): link_res["flowrate"].at[t, "pipe2"], 150 / 3600.0 ) self.assertEqual( - link_res["status"].at[t, "pipe2"], self.wntr.network.LinkStatus.open + link_res["status"].at[t, "pipe2"], self.wntr.network.LinkStatus.Open ) else: self.assertAlmostEqual(link_res["flowrate"].at[t, "pipe2"], 0.0) self.assertEqual( link_res["status"].at[t, "pipe2"], - self.wntr.network.LinkStatus.closed, + self.wntr.network.LinkStatus.Closed, ) @@ -147,14 +147,14 @@ def test_close_link_by_tank_level(self): self.assertAlmostEqual(link_res["flowrate"].at[t, "pump1"], 0.0) self.assertEqual( link_res["status"].at[t, "pump1"], - self.wntr.network.LinkStatus.closed, + self.wntr.network.LinkStatus.Closed, ) count += 1 else: self.assertGreaterEqual(link_res["flowrate"].at[t, "pump1"], 0.0001) self.assertEqual( link_res["status"].loc[t, "pump1"], - self.wntr.network.LinkStatus.open, + self.wntr.network.LinkStatus.Open, ) self.assertEqual(activated_flag, True) self.assertGreaterEqual(count, 2) @@ -229,20 +229,20 @@ def test_open_link_by_tank_level(self): self.assertGreaterEqual(results.link["flowrate"].at[t, "pipe1"], 0.002) self.assertEqual( results.link["status"].at[t, "pipe1"], - self.wntr.network.LinkStatus.open, + self.wntr.network.LinkStatus.Open, ) count += 1 else: self.assertAlmostEqual(results.link["flowrate"].at[t, "pipe1"], 0.0) self.assertEqual( results.link["status"].at[t, "pipe1"], - self.wntr.network.LinkStatus.closed, + self.wntr.network.LinkStatus.Closed, ) self.assertEqual(activated_flag, True) self.assertGreaterEqual(count, 2) self.assertEqual( results.link["status"].at[results.link["status"].index[0], "pipe1"], - self.wntr.network.LinkStatus.closed, + self.wntr.network.LinkStatus.Closed, ) # make sure the pipe starts closed self.assertLessEqual( results.node["pressure"].at[results.node["pressure"].index[0], "tank1"], @@ -277,7 +277,7 @@ def test_pipe_closed_for_low_level(self): self.assertLessEqual(results.link["flowrate"].at[t, "pipe1"], 0.0) self.assertEqual( results.link["status"].at[t, "pipe1"], - self.wntr.network.LinkStatus.closed, + self.wntr.network.LinkStatus.Closed, ) tank_level_dropped_flag = True self.assertEqual(tank_level_dropped_flag, True) @@ -384,7 +384,7 @@ def test_open_by_time_close_by_condition(self): inp_file = join(test_datadir, "control_comb.inp") wn = self.wntr.network.WaterNetworkModel(inp_file) control_action = self.wntr.network.ControlAction( - wn.get_link("pipe1"), "status", self.wntr.network.LinkStatus.opened + wn.get_link("pipe1"), "status", self.wntr.network.LinkStatus.Opened ) control = self.wntr.network.controls.Control._time_control( wn, 6 * 3600, "SIM_TIME", False, control_action @@ -432,9 +432,9 @@ def test_close_by_condition_open_by_time_stay(self): tank1.init_level = 40.0 tank1._head = tank1.elevation + 40.0 pipe1 = wn.get_link("pipe1") - pipe1._user_status = self.wntr.network.LinkStatus.opened + pipe1._user_status = self.wntr.network.LinkStatus.Opened control_action = self.wntr.network.ControlAction( - wn.get_link("pipe1"), "status", self.wntr.network.LinkStatus.opened + wn.get_link("pipe1"), "status", self.wntr.network.LinkStatus.Opened ) control = self.wntr.network.controls.Control._time_control( wn, 19 * 3600, "SIM_TIME", False, control_action @@ -482,9 +482,9 @@ def test_close_by_condition_open_by_time_reclose(self): tank1.init_level = 40.0 tank1._head = tank1.elevation + 40.0 pipe1 = wn.get_link("pipe1") - pipe1._user_status = self.wntr.network.LinkStatus.opened + pipe1._user_status = self.wntr.network.LinkStatus.Opened control_action = self.wntr.network.ControlAction( - wn.get_link("pipe1"), "status", self.wntr.network.LinkStatus.opened + wn.get_link("pipe1"), "status", self.wntr.network.LinkStatus.Opened ) control = self.wntr.network.controls.Control._time_control( wn, 5 * 3600, "SIM_TIME", False, control_action From a6ed11074811e4fdf461518e7546bc144be94ca5 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 09:37:04 -0400 Subject: [PATCH 11/17] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 215a74eed..25d730df7 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ MAINTAINER_EMAIL = 'kaklise@sandia.gov' LICENSE = 'Revised BSD' URL = 'https://github.com/USEPA/WNTR' -DEPENDENCIES = ['numpy>=1.21, <2.0', 'scipy', 'networkx', 'pandas', 'matplotlib', 'setuptools'] +DEPENDENCIES = ['numpy>=1.21,<2.0', 'scipy', 'networkx', 'pandas', 'matplotlib', 'setuptools'] # use README file as the long description file_dir = os.path.abspath(os.path.dirname(__file__)) From e40dd12b0e2975530482aa9dbc2391e15158301b Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 09:37:19 -0400 Subject: [PATCH 12/17] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 50cc2f986..ffac3e2fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "numpy>=1.21, <2.0"] +requires = ["setuptools", "numpy>=1.21,<2.0"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] From 1f4c9cd9a27d01f3cb213d4da8c8af63599bcc2f Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 09:37:29 -0400 Subject: [PATCH 13/17] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 94ca62f08..94d0b96be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Required -numpy>=1.21, <2.0 +numpy>=1.21,<2.0 scipy<1.13.0 networkx pandas From d6fa6bb3fd75d6ef0397424cc8d38710c8db180a Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:08:29 -0400 Subject: [PATCH 14/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 8cc055db2..c7d4e6041 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -65,7 +65,7 @@ jobs: - name: Install wntr run: | python -m pip install --upgrade pip - pip install wheel numpy scipy networkx pandas matplotlib setuptools + # pip install wheel numpy scipy networkx pandas matplotlib setuptools pip install --no-index --pre --find-links=. wntr - name: Usage of wntr run: | From f0f7775ea58567b1c318dc46fa96ed05fadf21ea Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:53:00 -0400 Subject: [PATCH 15/17] another attempt --- .github/workflows/build_tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index c7d4e6041..1bf3b6d59 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -59,14 +59,10 @@ jobs: uses: actions/download-artifact@v3 with: name: wntr_${{ matrix.python-version }}_${{ matrix.os }}.whl - # - name: Discover - # run: | - # ls . - name: Install wntr run: | python -m pip install --upgrade pip - # pip install wheel numpy scipy networkx pandas matplotlib setuptools - pip install --no-index --pre --find-links=. wntr + pip install wntr_${{ matrix.python-version }}_${{ matrix.os }}.whl - name: Usage of wntr run: | python -c "import wntr" From d64813fc058e32390436985d206d999da73cb719 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:06:22 -0400 Subject: [PATCH 16/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 1bf3b6d59..2e6068cf5 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -62,7 +62,8 @@ jobs: - name: Install wntr run: | python -m pip install --upgrade pip - pip install wntr_${{ matrix.python-version }}_${{ matrix.os }}.whl + pip install wheel numpy>=1.2.1,<2.0 scipy networkx pandas matplotlib setuptools + pip install --no-index --pre --find-links=. wntr - name: Usage of wntr run: | python -c "import wntr" From 64519a2f9ba1c97ed31f8f2fcb034edc1b07e7f3 Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:30:34 -0400 Subject: [PATCH 17/17] Update build_tests.yml --- .github/workflows/build_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 2e6068cf5..4f067327d 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -62,7 +62,7 @@ jobs: - name: Install wntr run: | python -m pip install --upgrade pip - pip install wheel numpy>=1.2.1,<2.0 scipy networkx pandas matplotlib setuptools + pip install wheel "numpy>=1.2.1,<2.0" scipy networkx pandas matplotlib setuptools pip install --no-index --pre --find-links=. wntr - name: Usage of wntr run: |