From bd47659c50fa4984865864738f05607eec181c48 Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Wed, 30 Oct 2024 10:09:28 -0400 Subject: [PATCH 1/8] add idaes-flowsheet-processor as a requirement; replace watertap.ui.fsapi imports with that --- .../internal/flowsheet_manager.py | 2 +- .../internal/tests/examples/api_example.py | 2 +- .../internal/tests/examples/api_example_nodiagram.py | 2 +- .../src/idaes_flowsheet_processor_ui/routers/flowsheets.py | 2 +- .../routers/tests/test_flowsheets.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/idaes_flowsheet_processor_ui/internal/flowsheet_manager.py b/backend/src/idaes_flowsheet_processor_ui/internal/flowsheet_manager.py index 4646bd7..ea1c8c5 100644 --- a/backend/src/idaes_flowsheet_processor_ui/internal/flowsheet_manager.py +++ b/backend/src/idaes_flowsheet_processor_ui/internal/flowsheet_manager.py @@ -25,7 +25,7 @@ # package-local from app.internal.settings import AppSettings -from watertap.ui.fsapi import FlowsheetInterface +from idaes_flowsheet_processor.api import FlowsheetInterface import idaes.logger as idaeslog _log = idaeslog.getLogger(__name__) diff --git a/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example.py b/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example.py index fe292ed..f30aa79 100644 --- a/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example.py +++ b/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example.py @@ -1,4 +1,4 @@ -from watertap.ui.fsapi import FlowsheetInterface +from idaes_flowsheet_processor.api import FlowsheetInterface from idaes.core.solvers import get_solver diff --git a/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example_nodiagram.py b/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example_nodiagram.py index d72b972..0aa0c05 100644 --- a/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example_nodiagram.py +++ b/backend/src/idaes_flowsheet_processor_ui/internal/tests/examples/api_example_nodiagram.py @@ -1,4 +1,4 @@ -from watertap.ui.fsapi import FlowsheetInterface +from idaes_flowsheet_processor.api import FlowsheetInterface from idaes.core.solvers import get_solver diff --git a/backend/src/idaes_flowsheet_processor_ui/routers/flowsheets.py b/backend/src/idaes_flowsheet_processor_ui/routers/flowsheets.py index bac9e04..8e080db 100644 --- a/backend/src/idaes_flowsheet_processor_ui/routers/flowsheets.py +++ b/backend/src/idaes_flowsheet_processor_ui/routers/flowsheets.py @@ -22,7 +22,7 @@ from app.internal.parameter_sweep import run_parameter_sweep from app.internal.log_parser import parse_logs from app.internal.settings import get_deployment -from watertap.ui.fsapi import FlowsheetInterface, FlowsheetExport +from idaes_flowsheet_processor.api import FlowsheetInterface, FlowsheetExport import idaes.logger as idaeslog CURRENT = "current" diff --git a/backend/src/idaes_flowsheet_processor_ui/routers/tests/test_flowsheets.py b/backend/src/idaes_flowsheet_processor_ui/routers/tests/test_flowsheets.py index 9292121..d35df5d 100644 --- a/backend/src/idaes_flowsheet_processor_ui/routers/tests/test_flowsheets.py +++ b/backend/src/idaes_flowsheet_processor_ui/routers/tests/test_flowsheets.py @@ -5,7 +5,7 @@ import os from urllib.parse import quote -from watertap.ui.fsapi import FlowsheetExport +from idaes_flowsheet_processor.api import FlowsheetExport from fastapi.responses import FileResponse # add 'examples' to packages, *before* app starts @@ -24,7 +24,7 @@ def client(): def pytest_generate_tests(metafunc): if "flowsheet_id" in metafunc.fixturenames: - from watertap.ui.fsapi import FlowsheetInterface + from idaes_flowsheet_processor.api import FlowsheetInterface module_names = list(FlowsheetInterface.from_installed_packages()) metafunc.parametrize( From a64e0e3b37ccf3bd2f985a9ea911beaec472b339 Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Tue, 5 Nov 2024 14:40:41 -0500 Subject: [PATCH 2/8] test against my fork of watertap with updated imports --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 235b41c..a300e96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,6 +65,10 @@ jobs: run: | pip install --progress-bar off . + - name: Test against my branch of watertap with corresponding changes + working-directory: ../ + run: git clone https://github.com/MichaelPesce/watertap.git && cd watertap && git fetch --all --tags && git checkout use-idaes-flowsheet-processor-api && pip install --progress-bar off . + - name: Display installed environment run: | conda env export --no-builds @@ -165,6 +169,10 @@ jobs: - name: Install watertap-ui Python package run: | pip install --progress-bar off . + + - name: Test against my branch of watertap with corresponding changes + working-directory: ../ + run: git clone https://github.com/MichaelPesce/watertap.git && cd watertap && git fetch --all --tags && git checkout use-idaes-flowsheet-processor-api && pip install --progress-bar off . - name: Install httpx run: | From b5706f0ff19920e14340bcd0a78840b67bd6d6db Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Tue, 5 Nov 2024 16:08:17 -0500 Subject: [PATCH 3/8] check for before trying to rename --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a300e96..ce4bb2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -139,7 +139,10 @@ jobs: - name: Rename conda package cache if: runner.os == 'Windows' shell: bash - run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache" + run: | + if [ -d "${CONDA_PKGS_DIR}" ]; then + mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache" + fi pytest: name: pytest (${{ matrix.os }}) From 29e0d5320382587463ef848e6078934bb7f39ae3 Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Wed, 6 Nov 2024 20:04:24 -0600 Subject: [PATCH 4/8] test against ludovico's branch with watertap changes --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce4bb2f..cc571f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,7 @@ jobs: - name: Test against my branch of watertap with corresponding changes working-directory: ../ - run: git clone https://github.com/MichaelPesce/watertap.git && cd watertap && git fetch --all --tags && git checkout use-idaes-flowsheet-processor-api && pip install --progress-bar off . + run: git clone https://github.com/lbianchi-lbl/watertap.git && cd watertap && git fetch --all --tags && git checkout idaes-flowsheet-processor && pip install --progress-bar off . - name: Display installed environment run: | @@ -175,7 +175,7 @@ jobs: - name: Test against my branch of watertap with corresponding changes working-directory: ../ - run: git clone https://github.com/MichaelPesce/watertap.git && cd watertap && git fetch --all --tags && git checkout use-idaes-flowsheet-processor-api && pip install --progress-bar off . + run: git clone https://github.com/lbianchi-lbl/watertap.git && cd watertap && git fetch --all --tags && git checkout idaes-flowsheet-processor && pip install --progress-bar off . - name: Install httpx run: | From efa9d15f109df6050caa7cc261c7f301b14324d8 Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Wed, 6 Nov 2024 20:16:30 -0600 Subject: [PATCH 5/8] rename step --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc571f2..8a98cb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: run: | pip install --progress-bar off . - - name: Test against my branch of watertap with corresponding changes + - name: Test against PR branch of watertap with corresponding changes working-directory: ../ run: git clone https://github.com/lbianchi-lbl/watertap.git && cd watertap && git fetch --all --tags && git checkout idaes-flowsheet-processor && pip install --progress-bar off . @@ -173,7 +173,7 @@ jobs: run: | pip install --progress-bar off . - - name: Test against my branch of watertap with corresponding changes + - name: Test against PR branch of watertap with corresponding changes working-directory: ../ run: git clone https://github.com/lbianchi-lbl/watertap.git && cd watertap && git fetch --all --tags && git checkout idaes-flowsheet-processor && pip install --progress-bar off . From 1f1e554130ba15b9941ba1511a2534c9b132b6ed Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Tue, 26 Nov 2024 14:05:16 -0600 Subject: [PATCH 6/8] use test flowsheet that imports idaes-flowsheet-processor --- frontend/cypress/e2e/FlowsheetTesting.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/e2e/FlowsheetTesting.cy.js b/frontend/cypress/e2e/FlowsheetTesting.cy.js index 8e2be4e..329841e 100644 --- a/frontend/cypress/e2e/FlowsheetTesting.cy.js +++ b/frontend/cypress/e2e/FlowsheetTesting.cy.js @@ -55,8 +55,8 @@ describe('WaterTAP UI Testing', () => { it('tests new flowsheet', () => { let modelFile = "https://drive.google.com/uc?export=download&id=1XdjuWNpYT9teZxaF8TuwDz0XS2XyXKeT" - // let exportFile = "https://drive.google.com/uc?export=download&id=1-jWQmI4wO2OlyUi32fqobFEmPn3zm9Q9" - let exportFile = "https://drive.google.com/uc?export=download&id=1_KtDRLSQeyKoQ3rH-4kNuxpvuQVuhQCu" + let exportFile = "https://drive.google.com/uc?export=download&id=1-jWQmI4wO2OlyUi32fqobFEmPn3zm9Q9" + // let exportFile = "https://drive.google.com/uc?export=download&id=1_KtDRLSQeyKoQ3rH-4kNuxpvuQVuhQCu" cy.load_flowsheets_list() cy.screenshot('loaded flowsheet list page') From 772cc6cb6ab3b7b34db8def7027f5ec3fdf74ba3 Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Tue, 26 Nov 2024 15:02:01 -0600 Subject: [PATCH 7/8] remove testing against ludovico's branch --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af22ad2..0c6d7a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,10 +65,6 @@ jobs: run: | pip install --progress-bar off . - - name: Test against PR branch of watertap with corresponding changes - working-directory: ../ - run: git clone https://github.com/lbianchi-lbl/watertap.git && cd watertap && git fetch --all --tags && git checkout idaes-flowsheet-processor && pip install --progress-bar off . - - name: Display installed environment run: | conda env export --no-builds From 8c8d2f4613f0a0f5d2b17e5ae064cfc1979df618 Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Tue, 26 Nov 2024 15:04:41 -0600 Subject: [PATCH 8/8] remove testing against ludovico's branch --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c6d7a2..a6af1b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -172,10 +172,6 @@ jobs: - name: Install watertap-ui Python package run: | pip install --progress-bar off . - - - name: Test against PR branch of watertap with corresponding changes - working-directory: ../ - run: git clone https://github.com/lbianchi-lbl/watertap.git && cd watertap && git fetch --all --tags && git checkout idaes-flowsheet-processor && pip install --progress-bar off . - name: Install httpx run: |