Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7e71e04
Use tactus in surfExp
trygveasp Dec 11, 2025
2823d33
Merge branch 'master' into feature/use_tactus_in_surfexp
trygveasp Dec 11, 2025
724a0e4
Bugix for validtime
trygveasp Dec 12, 2025
aabb31b
Use ACCORD tactus. Start on automatic testing
trygveasp Jan 22, 2026
91066c2
Correct tactus protocol
trygveasp Jan 22, 2026
04150d1
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
94cfc50
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
426dc60
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
ea615b5
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
23a15f1
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
7e5a936
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
a4192ac
Hopefully fix unit testsing and linting
trygveasp Jan 23, 2026
542045e
Restructure workflows
trygveasp Jan 23, 2026
1c6bd6e
Restructure workflows
trygveasp Jan 23, 2026
cf298f6
Restructure workflows
trygveasp Jan 23, 2026
87bfd2f
Restructure workflows
trygveasp Jan 23, 2026
cd8b210
Restructure workflows
trygveasp Jan 23, 2026
98231a5
Restructure workflows
trygveasp Jan 23, 2026
ffa96c7
Restructure workflows
trygveasp Jan 23, 2026
03e2dea
Restructure workflows
trygveasp Jan 23, 2026
463b9a7
Restructure workflows
trygveasp Jan 23, 2026
be57d36
Restructure workflows
trygveasp Jan 23, 2026
bb8e3ee
Restructure workflows
trygveasp Jan 23, 2026
27b0f9d
Restructure workflows
trygveasp Jan 23, 2026
762015b
Restructure workflows
trygveasp Jan 23, 2026
a589372
Restructure workflows
trygveasp Jan 23, 2026
85c1278
Update pyproject.toml
trygveasp Feb 5, 2026
95b914e
Update pyproject.toml
trygveasp Feb 5, 2026
a3637cb
Update linting.yaml
trygveasp Feb 5, 2026
5f0dbfd
Update pyproject.toml
trygveasp Feb 5, 2026
4310f83
Update pyproject.toml
trygveasp Feb 5, 2026
f6a782e
Update pyproject.toml
trygveasp Feb 5, 2026
fd3197e
Update pyproject.toml
trygveasp Feb 5, 2026
33fe598
Use my fork as tactus
trygveasp Feb 12, 2026
ffe1d41
Linting
trygveasp Feb 12, 2026
fa7e3ba
Test with Martins branch again
trygveasp Feb 18, 2026
0c72d25
Update pyproject.toml
trygveasp Feb 18, 2026
6e710b8
Update pyproject.toml
trygveasp Feb 18, 2026
061ea5d
Use ACCORD toml-formatter
trygveasp Feb 18, 2026
871266e
Adapt to tactus branch where deode stuff has been renamed
trygveasp Feb 18, 2026
09c3b4c
Add forgotten file
trygveasp Feb 18, 2026
22b6d66
Use ACCORD default branch
trygveasp Feb 18, 2026
fb87ab3
Bump version
trygveasp Feb 18, 2026
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
83 changes: 83 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#.github/workflows/documentation.yaml
name: Create documentation

on:
pull_request:
branches:
- master
push:
branches:
- '**' # Every branch

env:
USER: "github_runner"
HOME: "/tmp"

jobs:
tests:
name: "Create documentation"
runs-on: "ubuntu-latest"

steps:
#----------------------------------------------
# check-out repo
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'

- name: Set PATH
run: |
echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH

- name: Set python
run: |
poetry env use /tmp/micromamba/envs/surfExp/bin/python

#- name: Load cached venv (if cache exists)
# id: cached-poetry-dependencies
# uses: actions/cache@v4
# with:
# path: .venv
# key: venv-${{ hashFiles('pyproject.toml') }}

- name: Install dependencies (if venv cache is not found)
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root --all-extras

- name: Install the project itself
run: |
poetry install --no-interaction --only-root

- name: Create documentation
run: |
poetry run sphinx-build . docs/build/html

- name: Commit documentation changes
if: ${{ github.repository_owner == 'metno' && github.event_name != 'pull_request' }}
run: |
git clone https://github.com/metno/surfExp.git --branch gh-pages --single-branch gh-pages
cp -r docs/build/html/* gh-pages/
cd gh-pages
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.

- name: Push changes
if: ${{ github.repository_owner == 'metno' && github.event_name != 'pull_request' }}
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
69 changes: 32 additions & 37 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,61 @@ on:
pull_request:
branches:
- master
- develop
paths:
- '**.py'
push:
branches:
- '**' # Every branch
paths:
- '**.py'

env:
USER: "github_runner"
HOME: "/tmp"

jobs:
linting:
if: github.repository_owner == 'destination-earth-digital-twins'
name: Run Linters
runs-on: ubuntu-latest
environment: staging

steps:
#----------------------------------------------
# check-out repo and set-up python
# check-out repo
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'

#----------------------------------------------
# --- configure poetry & install project ----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
- uses: mamba-org/setup-micromamba@v2
with:
virtualenvs-create: true
virtualenvs-in-project: true
environment-file: environment.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'

- name: Load cached venv (if cache exists)
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}
- name: Set PATH
run: |
echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH

- name: Set python
run: |
poetry env use /tmp/micromamba/envs/surfExp/bin/python

#- name: Load cached venv (if cache exists)
# id: cached-poetry-dependencies
# uses: actions/cache@v4
# with:
# path: .venv
# key: venv-${{ hashFiles('pyproject.toml') }}

- name: Install dependencies (if venv cache is not found)
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --only linting
run: |
poetry install -vvv --no-interaction --no-root --only linting

- name: Install the project itself
run: poetry install --no-interaction --only-root
run: |
poetry install -vvv --no-interaction --only-root

#----------------------------------------------
# Run the linting checks
#----------------------------------------------
- name: isort
run: |
poetry run isort --check-only .
- name: black
run: |
poetry run black --check --diff .
- name: flakeheaven
- name: Linting
run: |
export FLAKEHEAVEN_CACHE="${TMPDIR:-${TEMP:-${TMP:-/tmp}}}/flakeheaven_cache.$(openssl rand -hex 12)"
poetry run flakeheaven lint .
poetry run poetry devtools lint
89 changes: 11 additions & 78 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,9 @@ env:

jobs:
tests:
if: github.repository_owner == 'destination-earth-digital-twins'
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ]
env: [ "pytest" ]
python-version: [ "3.11" ]

name: "${{ matrix.os }}, python=${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}

container:
image: python:${{ matrix.python-version }}-bullseye
env:
COVERAGE_FILE: ".coverage.${{ matrix.env }}.${{ matrix.python-version }}"
name: "Install and test surfExp"
runs-on: "ubuntu-latest"

steps:
#----------------------------------------------
Expand All @@ -46,88 +34,33 @@ jobs:
cache-environment: true
post-cleanup: 'all'

#----------------------------------------------
# --- configure poetry & install project ----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set PATH
run: |
echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH

- name: Set python
run: |
poetry env use /tmp/micromamba/envs/surfExp/bin/python

- name: Load cached venv (if cache exists)
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
key: venv-${{ hashFiles('pyproject.toml') }}

- name: Modify pyproject.toml
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
#export GITHUB_TOKEN=${{ secrets.GH_REPO_READ_TOKEN }}
#export GITHUB_TOKEN="trygve"
sed -i "s#https://github.com/destination-earth-digital-twins/Deode-Workflow#https://${GITHUB_TOKEN}@github.com/destination-earth-digital-twins/Deode-Workflow#g" pyproject.toml

- name: Install dependencies (if venv cache is not found)
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
cat pyproject.toml
poetry install --no-interaction --no-root --only main,test
shell: micromamba-shell {0}


- name: Install the project itself
run: |
# poetry config http-basic.deode x-token-auth ${{secrets.DEODE_WORKFLOW_ACCESS}}
poetry install --no-interaction --only-root
shell: micromamba-shell {0}

#----------------------------------------------
# run test suite and report coverage
#----------------------------------------------
- name: Run tests
run: |
poetry run pytest
shell: micromamba-shell {0}

#- name: Upload test coverage report to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./.coverage.xml

- name: Coveralls
if: ${{ matrix.python-version == 3.11 }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
export COVERALLS_REPO_TOKEN=${{secrets.COVERALLS_REPO_TOKEN}}
poetry run coveralls
shell: micromamba-shell {0}

- name: Create documentation
if: ${{ matrix.python-version == 3.11 }}
run: |
poetry run sphinx-build . docs/build/html
shell: micromamba-shell {0}
- name: Commit documentation changes
if: ${{ matrix.python-version == 3.11 && github.event_name != 'pull_request' }}
run: |
git clone https://github.com/metno/surfExp.git --branch gh-pages --single-branch gh-pages
cp -r docs/build/html/* gh-pages/
cd gh-pages
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.

- name: Push changes
if: ${{ matrix.python-version == 3.11 && github.event_name != 'pull_request' }}
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This repository is a setup to create and run offline SURFEX experiments.

See online documentation in https://metno.github.io/surfExp/

The setup is dependent of pysurfex (https://metno.github.io/pysurfex) and deode workflow (https://github.com/destination-earth-digital-twins/Deode-Workflow).
The setup is dependent of pysurfex (https://metno.github.io/pysurfex) and tactus (https://github.com/ACCORD-NWP/tactus).



Expand Down Expand Up @@ -76,9 +76,9 @@ In addition you can add optional arguments like the start and end times and if y

The surfex binaries executed from surfExp are of course depending on source code version.
This means the fortran namelists must correspond to the binaries being run.
There are two ways to generate the fortran namelists. Since surfexp is a plugin to deode
the first way is to create the namelists is with the deode namelist generator.
This is achieved by setting ldeode = true for the surfex binary sections.
There are two ways to generate the fortran namelists. Since surfexp is a plugin to tactus
the first way is to create the namelists is with the tactus namelist generator.
This is achieved by setting tactus = true for the surfex binary sections.

The other method is using the pysurfex namelist generator and is handled by the keyword blocks in the settings for the different binaries.
Please note that since this is a list, it is not merged between diffentent configuration inputs,
Expand Down Expand Up @@ -110,7 +110,7 @@ from the config file.
surfExp -o my_config.toml --case-name LDAS --plugin-home $PWD surfexp/data/config/configurations/metno_ldas.toml surfexp/data/config/mods/cy46_aa_offline/ppi.toml

# To start you experiment
deode start suite --config-file my_config.toml
tactus start suite --config-file my_config.toml



Expand Down Expand Up @@ -164,10 +164,10 @@ Extra environment on PPI-RHEL8 needed to start experiments
export ECF_SSL=1

# Set HOST
export DEODE_HOST="ppi_rhel8_b1"
export TACTUS_HOST="ppi_rhel8_b1"

# Start suite (modify dates)
deode start suite --config-file exps/LDAS.toml
tactus start suite --config-file exps/LDAS.toml

# MET-Norway LDAS single decade
surfExp -o exps/LDAS_decade.toml --case-name LDAS_decade \
Expand All @@ -179,5 +179,5 @@ Extra environment on PPI-RHEL8 needed to start experiments
surfexp/data/config/scheduler/ecflow_ppi_rhel8-$USER.toml

# Start the suite
deode start suite --config-file exps/LDAS_decade.toml
tactus start suite --config-file exps/LDAS_decade.toml

13 changes: 6 additions & 7 deletions docs/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ To detect the proper host on MET-Norway PPI you need to export one of the follow

.. code-block:: bash

export DEODE_HOST="ppi_rhel8_b1"
export DEODE_HOST="ppi_rhel8_a1"
export TACTUS_HOST="ppi_rhel8_b1"
export TACTUS_HOST="ppi_rhel8_a1"

The variables below are needed for ecflow for MET-Norway PPI

Expand All @@ -62,14 +62,13 @@ South-Norway domain

surfExp -o dt_offline_drammen.toml \
--case-name CY49DT_OFFLINE_DRAMMEN \
--plugin-home /home/$USER/projects/surfExp \
--plugin-home $PWD \
--troika troika \

surfexp/data/config/configurations/dt.toml \
surfexp/data/config/domains/DRAMMEN.toml \
surfExp/surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml

deode start suite --config-file dt_offline_drammen.toml
tactus start suite --config-file dt_offline_drammen.toml


DT_2_5_2500x2500
Expand All @@ -85,7 +84,7 @@ DT_2_5_2500x2500
surfexp/data/config/domains/dt_2_5_2500x2500.toml \
surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml

deode start suite --config-file dt_offline_dt_2_5_2500x2500.toml
tactus start suite --config-file dt_offline_dt_2_5_2500x2500.toml

DT_2_5_2500x2500 Initial conditions from namelist
-------------------------
Expand All @@ -101,5 +100,5 @@ DT_2_5_2500x2500 Initial conditions from namelist
surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml \
surfexp/data/config/mods/dev-CY49T2h_deode/dt_prep_from_namelist.toml

deode start suite --config-file dt_offline_dt_2_5_2500x2500.toml
tactus start suite --config-file dt_offline_dt_2_5_2500x2500.toml

Loading