From d0e40e911d553069a6db721f61e3c710b56792a3 Mon Sep 17 00:00:00 2001 From: Lorena Hendrix Date: Thu, 30 May 2024 08:40:57 +0200 Subject: [PATCH] fixed checkbox bug, resolved #49 --- .github/workflows/deploy.yml | 35 ++++++++++++------- streamlit/app_scripts/app_view.py | 2 +- .../input_files/battmo_formatted_input.json | 2 +- streamlit/input_files/linked_data_input.json | 14 ++++---- streamlit/output_files/calculated_values.json | 2 +- 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aa35445..c90e8ee 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,14 +6,15 @@ on: - main env: + SSH_USER: lhendrix + SSH_HOST: 51.68.188.78 REGISTRY: ghcr.io IMAGE_NAME: battmoteam/battmogui:latest WORKDIR: battmogui - GITLAB_URL: "https://lorena.hendrix:${{ secrets.GITLAB_PAT}}@gitlab.sintef.no/FFP-products/prod/webapp-instances/102023526-1006.git" jobs: publish: - name: publish docker images + name: publish image runs-on: ubuntu-latest steps: @@ -29,15 +30,25 @@ jobs: - name: Publish run: docker-compose -f docker-compose-deploy.yml push - mirror: - name: mirror repository to GitLab + deploy: + name: Deploy image runs-on: ubuntu-latest + needs: publish + steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Mirror changes - run: | - git remote add gitlab ${{ env.GITLAB_URL }} - git fetch origin main - git push gitlab main:test + - name: Install SSH keys + run: | + install -m 600 -D /dev/null ~/.ssh/id_rsa + echo "${{ secrets.ACTIONS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + ssh-keyscan -H ${{ env.SSH_HOST }} >> ~/.ssh/known_hosts + - name: Test SSH Connection + run: ssh -o StrictHostKeyChecking=no ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "echo SSH connection successful" + - name: Login to Registry + run: echo ${{ secrets.PAT }} | docker login ghcr.io -u lorenah84 --password-stdin + - name: Pull and Run Containers + run: | + ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORKDIR }} && \ + docker compose -f docker-compose.yml pull && \ + docker compose -f docker-compose.yml up -d" + - name: Cleanup + run: rm -rf ~/.ssh \ No newline at end of file diff --git a/streamlit/app_scripts/app_view.py b/streamlit/app_scripts/app_view.py index 7239ff1..5bbe2e1 100644 --- a/streamlit/app_scripts/app_view.py +++ b/streamlit/app_scripts/app_view.py @@ -1184,7 +1184,7 @@ def fill_non_material_components(self,density,category_display_name,category_par key = checkbox_key, value= st.session_state[checkbox_key], on_change = self.checkbox_input_connect, - args = (checkbox_key, tab, category_id, non_material_parameter.name,non_material_parameter), + args = (checkbox_key, tab, category_id, non_material_parameter.name), label_visibility="collapsed") st.text(" ") diff --git a/streamlit/input_files/battmo_formatted_input.json b/streamlit/input_files/battmo_formatted_input.json index cb6381f..d35f944 100644 --- a/streamlit/input_files/battmo_formatted_input.json +++ b/streamlit/input_files/battmo_formatted_input.json @@ -5,7 +5,7 @@ }, "NegativeElectrode": { "Coating": { - "thickness": 8.499999999999999e-05, + "thickness": 7.3e-05, "N": 20, "effectiveDensity": 1770.4, "bruggemanCoefficient": 1.5, diff --git a/streamlit/input_files/linked_data_input.json b/streamlit/input_files/linked_data_input.json index ba26a76..c94553b 100644 --- a/streamlit/input_files/linked_data_input.json +++ b/streamlit/input_files/linked_data_input.json @@ -452,7 +452,7 @@ "@type": "emmo:Thickness", "value": { "@type": "emmo:Numerical", - "hasNumericalData": 85.0 + "hasNumericalData": 73.0 }, "unit": { "label": "MicroMetre", @@ -465,7 +465,7 @@ "@type": "emmo:Porosity", "value": { "@type": "emmo:Numerical", - "hasNumericalData": 0.2 + "hasNumericalData": 0.07148914570811338 }, "unit": { "label": "UnitOne", @@ -478,7 +478,7 @@ "@type": "emmo:MassLoading", "value": { "@type": "emmo:Numerical", - "hasNumericalData": 15.0484 + "hasNumericalData": 15.0 }, "unit": { "label": "MiliGramPerCubicCentiMeter", @@ -530,7 +530,7 @@ "@type": "emmo:Capacity", "value": { "@type": "emmo:Numerical", - "hasNumericalData": 1120.5836528712066 + "hasNumericalData": 962.3836077599775 }, "unit": { "label": "MiliAmpereHour", @@ -1339,7 +1339,7 @@ "@type": "emmo:N/PRatio", "value": { "@type": "emmo:Numerical", - "hasNumericalData": 1.07 + "hasNumericalData": 0.92 }, "unit": { "label": "UnitOne", @@ -1352,7 +1352,7 @@ "@type": "emmo:CellMass", "value": { "@type": "emmo:Numerical", - "hasNumericalData": 31.7796972032 + "hasNumericalData": 31.387528930628832 }, "unit": { "label": "Gram", @@ -1365,7 +1365,7 @@ "@type": null, "value": { "@type": "emmo:Numerical", - "hasNumericalData": 1047.6223333812661 + "hasNumericalData": 962.3836077599775 }, "unit": { "label": "AmpereHour", diff --git a/streamlit/output_files/calculated_values.json b/streamlit/output_files/calculated_values.json index 0027f54..67a73bd 100644 --- a/streamlit/output_files/calculated_values.json +++ b/streamlit/output_files/calculated_values.json @@ -5,7 +5,7 @@ "positive_electrode": 3151.12 }, "mass_loadings": { - "negative_electrode": 15.0484, + "negative_electrode": 15.0, "positive_electrode": 23.948511999999994 } }