From 7e71e04202dd28f55765bf951ac993d215491300 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 11 Dec 2025 08:52:09 +0000 Subject: [PATCH 01/42] Use tactus in surfExp --- README.rst | 12 +++---- docs/example.rst | 9 +++--- index.rst | 4 +-- pyproject.toml | 6 ++-- surfexp/cli.py | 12 +++---- surfexp/data/config/configurations/dt.toml | 8 ++--- .../configurations/hres_an_forcing.toml | 6 ++-- .../config/configurations/metno_ldas.toml | 2 +- surfexp/data/config/configurations/sekf.toml | 6 ++-- .../include/platform_paths/ppi_rhel8_a1.toml | 4 +-- .../include/platform_paths/ppi_rhel8_b1.toml | 6 ++-- .../scheduler/ecflow_atos_bologna.toml | 10 +++--- .../scheduler/ecflow_ppi_rhel8_a1.toml | 10 +++--- .../scheduler/ecflow_ppi_rhel8_b1.toml | 10 +++--- .../include/submission/ppi_rhel8_a1.toml | 2 +- .../include/submission/ppi_rhel8_b1.toml | 2 +- .../config/mods/dev-CY49T2h_deode/dt.toml | 8 ++--- surfexp/data/config/mods/dt_an_forcing.toml | 6 ++-- surfexp/data/config/troika/troika_config.yml | 2 +- surfexp/data/surfexp.toml | 6 ++-- surfexp/experiment.py | 32 +++++++++---------- surfexp/suites/offline.py | 8 ++--- surfexp/tasks/compilation.py | 2 +- surfexp/tasks/fetch_mars.py | 4 +-- surfexp/tasks/forcing.py | 6 ++-- surfexp/tasks/gmtedsoil.py | 19 +++++------ surfexp/tasks/surfex_binary_task.py | 14 ++++---- surfexp/tasks/tasks.py | 10 +++--- surfexp/templates/ecflow/default.py | 16 +++++----- surfexp/templates/ecflow/requeue.py | 16 +++++----- surfexp/templates/stand_alone.py | 14 ++++---- tests/conftest.py | 12 +++---- tests/unit/test_suites.py | 12 +++---- tests/unit/test_tasks.py | 12 +++---- 34 files changed, 154 insertions(+), 154 deletions(-) diff --git a/README.rst b/README.rst index efe322d..557b348 100644 --- a/README.rst +++ b/README.rst @@ -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, @@ -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 @@ -167,7 +167,7 @@ Extra environment on PPI-RHEL8 needed to start experiments export DEODE_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 \ @@ -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 diff --git a/docs/example.rst b/docs/example.rst index 103782e..f031854 100644 --- a/docs/example.rst +++ b/docs/example.rst @@ -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 @@ -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 ------------------------- @@ -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 diff --git a/index.rst b/index.rst index 3d9cf9a..5966dd7 100644 --- a/index.rst +++ b/index.rst @@ -16,7 +16,7 @@ surfExp documentation Classes --------------------------------------------- .. autoclass:: surfexp.experiment.SettingsFromNamelistAndConfig -.. autoclass:: surfexp.experiment.SettingsFromNamelistAndConfigDeode +.. autoclass:: surfexp.experiment.SettingsFromNamelistAndConfigTactus .. autoclass:: surfexp/suites.offline_dt_control.SurfexSuiteDefinitionDTAnalysedForcingControl .. autoclass:: surfexp/suites.offline.SurfexSuiteDefinition .. autoclass:: surfexp/tasks.surfex_binary_task.SurfexBinaryTask @@ -48,7 +48,7 @@ Classes Class methods --------------------------------------------- .. automethod:: surfexp.experiment.SettingsFromNamelistAndConfig.__init__ -.. automethod:: surfexp.experiment.SettingsFromNamelistAndConfigDeode.__init__ +.. automethod:: surfexp.experiment.SettingsFromNamelistAndConfigTactus.__init__ .. automethod:: surfexp/tasks.surfex_binary_task.SurfexBinaryTask.__init__ .. automethod:: surfexp/tasks.surfex_binary_task.SurfexBinaryTask.get_pgdfile .. automethod:: surfexp/tasks.surfex_binary_task.SurfexBinaryTask.execute diff --git a/pyproject.toml b/pyproject.toml index 12eadcb..67be783 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,8 @@ requires = ["poetry-core >= 1.2.0"] [tool.poetry.dependencies] - deode = {git = "git@github.com:destination-earth-digital-twins/Deode-Workflow.git", develop = false, branch = "v0.16.1"} - pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.1", extras = ["plot", "verification"]} + tactus = {git = "git@github.com:mfroelund/Tactus.git", branch = "feature/prepare-tactus-package"} + pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" [tool.poetry.group.doc.dependencies] @@ -192,7 +192,7 @@ [[tool.poe.tasks.doc.switch]] case = "clean" - cmd = "rm -rf docs/_build/ docs/deode.rst docs/markdown_docs/config.md" + cmd = "rm -rf docs/_build/ docs/markdown_docs/config.md" [[tool.poe.tasks.doc.switch]] case = "build" diff --git a/surfexp/cli.py b/surfexp/cli.py index d74353f..5e8df80 100644 --- a/surfexp/cli.py +++ b/surfexp/cli.py @@ -4,9 +4,9 @@ import shutil import sys -import deode -from deode.__main__ import main -from deode.logs import logger +import tactus +from tactus.__main__ import main +from tactus.logs import logger import surfexp @@ -92,7 +92,7 @@ def pysfxexp(argv=None): troika_command = args.troika_command args = args.args - deode_path = deode.__path__[0] + tactus_path = tactus.__path__[0] surfexp_path = surfexp.__path__[0] tmp_output = f"{output}.tmp.{os.getpid()}.toml" tmp_mods_output = f"{output}.mods.tmp.{os.getpid()}.toml" @@ -101,7 +101,7 @@ def pysfxexp(argv=None): "--case-name", case_name, "--config-file", - f"{deode_path}/data/config_files/config.toml", + f"{tactus_path}/data/config_files/config.toml", "--config-data-dir", f"{surfexp_path}/data/config/", "--output", @@ -129,7 +129,7 @@ def pysfxexp(argv=None): argv.append(tmp_mods_output) cmd = " ".join(argv) - logger.debug("deode case command: deode {}", cmd) + logger.debug("tactus case command: tactus {}", cmd) main(argv=argv) with open(tmp_output, mode="r", encoding="utf8") as fhandler_in, open( output, mode="w", encoding="utf8" diff --git a/surfexp/data/config/configurations/dt.toml b/surfexp/data/config/configurations/dt.toml index fdeeb42..d19366c 100644 --- a/surfexp/data/config/configurations/dt.toml +++ b/surfexp/data/config/configurations/dt.toml @@ -141,7 +141,7 @@ [offline] blocks = [] - deode = true + tactus = true [offline.args] forc-zs = true @@ -151,18 +151,18 @@ blocks = [] clay_format = "direct" clay_input = "soilgrid" - deode = true + tactus = true [prep] blocks = [] - deode = true + tactus = true [prep.args] prep-file = "@casedir@/grib/prep_input_@YYYY@@MM@@DD@_@HH@@LL@.grib1" [soda] blocks = ["io", "treedrag", "ecoclimap_sg", "soda"] - deode = false + tactus = false [submission.task_exceptions.FirstGuess4OI.ENV] LD_LIBRARY_PATH = "/usr/local/apps/udunits/2.2.28/lib:$LD_LIBRARY_PATH" diff --git a/surfexp/data/config/configurations/hres_an_forcing.toml b/surfexp/data/config/configurations/hres_an_forcing.toml index 3169620..2d488dc 100644 --- a/surfexp/data/config/configurations/hres_an_forcing.toml +++ b/surfexp/data/config/configurations/hres_an_forcing.toml @@ -141,7 +141,7 @@ [offline] blocks = [] - deode = false + tactus = false [offline.args] forc-zs = true @@ -154,13 +154,13 @@ [prep] blocks = [] - deode = false + tactus = false [prep.args] prep-file = "@casedir@/grib/prep_input_@YYYY@@MM@@DD@_@HH@@LL@.grib1" [soda] - deode = false + tactus = false [submission.task_exceptions.FirstGuess4OI.ENV] LD_LIBRARY_PATH = "/usr/local/apps/udunits/2.2.28/lib:$LD_LIBRARY_PATH" diff --git a/surfexp/data/config/configurations/metno_ldas.toml b/surfexp/data/config/configurations/metno_ldas.toml index eeab544..4177850 100644 --- a/surfexp/data/config/configurations/metno_ldas.toml +++ b/surfexp/data/config/configurations/metno_ldas.toml @@ -112,7 +112,7 @@ "offline_teb", "offline_selected_output", ] - deode = false + tactus = false [offline.args] force = true diff --git a/surfexp/data/config/configurations/sekf.toml b/surfexp/data/config/configurations/sekf.toml index 43a0214..dcecd0f 100644 --- a/surfexp/data/config/configurations/sekf.toml +++ b/surfexp/data/config/configurations/sekf.toml @@ -70,7 +70,7 @@ "offline_teb", "offline_selected_output", ] - deode = false + tactus = false [pgd] blocks = [ @@ -107,7 +107,7 @@ "meb", "pgd_meb", ] - deode = false + tactus = false [prep] blocks = [ @@ -123,7 +123,7 @@ "prep_isba_snow", "meb", ] - deode = false + tactus = false [soda] blocks = [ diff --git a/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml b/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml index 8c99e7a..e2407c9 100644 --- a/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml +++ b/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml @@ -11,9 +11,9 @@ ecoclim_data_path = "@CLIMDATA@/ecoclimap" ecoclimap_bin_dir = "@ecoclim_data_path@" ecosg_data_path = "@CLIMDATA@/ECOCLIMAP-SG/V0" - fixed_bdclimdir = "/home/snh02/work/dev-CY46h1_deode/climate/DEODE_LARGE" + fixed_bdclimdir = "/home/snh02/work/dev-CY46h1_tactus/climate/TACTUS_LARGE" fixed_bddir = "/scratch/sism/DEOL/@YYYY@/@MM@/@DD@/@HH@" - fixed_bddir_sfx = "/home/snh02/work/dev-CY46h1_deode/boundaries/HRES/@YYYY@/@MM@/@DD@/@HH@" + fixed_bddir_sfx = "/home/snh02/work/dev-CY46h1_tactus/boundaries/HRES/@YYYY@/@MM@/@DD@/@HH@" flake_dir = "@STATIC_DATA@/climate/" global_sfcdir = "@STATIC_DATA@/climate_fields_mir/climate.v020_MIR_orog/" gmted2010_data_path = "@CLIMDATA@/gmted2010" diff --git a/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml b/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml index 8d6a4de..4936460 100644 --- a/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml +++ b/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml @@ -11,9 +11,9 @@ ecoclim_data_path = "@CLIMDATA@/ecoclimap" ecoclimap_bin_dir = "@ecoclim_data_path@" ecosg_data_path = "@CLIMDATA@/ECOCLIMAP-SG/V0" - fixed_bdclimdir = "/home/snh02/work/dev-CY46h1_deode/climate/DEODE_LARGE" + fixed_bdclimdir = "/home/snh02/work/dev-CY46h1_tactus/climate/TACTUS_LARGE" fixed_bddir = "/scratch/sism/DEOL/@YYYY@/@MM@/@DD@/@HH@" - fixed_bddir_sfx = "/home/snh02/work/dev-CY46h1_deode/boundaries/HRES/@YYYY@/@MM@/@DD@/@HH@" + fixed_bddir_sfx = "/home/snh02/work/dev-CY46h1_tactus/boundaries/HRES/@YYYY@/@MM@/@DD@/@HH@" flake_dir = "@STATIC_DATA@/climate/" global_sfcdir = "@STATIC_DATA@/climate_fields_mir/climate.v020_MIR_orog/" gmted2010_data_path = "@CLIMDATA@/gmted2010" @@ -22,7 +22,7 @@ osm_data = "@CLIMDATA@/OSM_SFX8_1/GARDEN/" pgd_data_path = "@CLIMDATA@/PGD" rrtm_dir = "@STATIC_DATA@/rrtm/@CYCLE@" - scratch = "/lustre/storeB/users/@USER@/deode" + scratch = "/lustre/storeB/users/@USER@/tactus" soilgrid_data_path = "@CLIMDATA@/soilgrid" static_data = "/lustre/storeB/project/nwp/H2O/" task_name = "@STAND_ALONE_TASK_NAME@" diff --git a/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml b/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml index a9401ad..50bed7c 100644 --- a/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml +++ b/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml @@ -3,12 +3,12 @@ [scheduler.ecfvars] case_prefix = "" ecf_deode_home = "strip_off_mount_path('@DEODE_HOME@',)" - ecf_files = "@HOME@/deode_ecflow/ecf_files" - ecf_files_remotely = "@HOME@/deode_ecflow/ecf_files" - ecf_home = "@HOME@/deode_ecflow/jobout" + ecf_files = "@HOME@/tactus_ecflow/ecf_files" + ecf_files_remotely = "@HOME@/tactus_ecflow/ecf_files" + ecf_home = "@HOME@/tactus_ecflow/jobout" ecf_host = "_select_host_from_list(['ecfg-@USER@-1', 'ecflow-gen-@USER@-001'],)" - ecf_jobout = "@HOME@/deode_ecflow/jobout" - ecf_out = "@HOME@/deode_ecflow/jobout" + ecf_jobout = "@HOME@/tactus_ecflow/jobout" + ecf_out = "@HOME@/tactus_ecflow/jobout" ecf_port = 3141 ecf_ssl = "0" diff --git a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml index 6e0e56b..cc7babb 100644 --- a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml +++ b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml @@ -3,12 +3,12 @@ [scheduler.ecfvars] case_prefix = "" ecf_deode_home = "@DEODE_HOME@" - ecf_files = "@HOME@/deode_ecflow/ecf_files" - ecf_files_remotely = "@HOME@/deode_ecflow/ecf_files" - ecf_home = "@HOME@/deode_ecflow/jobout" + ecf_files = "@HOME@/tactus_ecflow/ecf_files" + ecf_files_remotely = "@HOME@/tactus_ecflow/ecf_files" + ecf_home = "@HOME@/tactus_ecflow/jobout" ecf_host = "ppi-r8login-a1.int.met.no" - ecf_jobout = "@HOME@/deode_ecflow/jobout" - ecf_out = "@HOME@/deode_ecflow/jobout" + ecf_jobout = "@HOME@/tactus_ecflow/jobout" + ecf_out = "@HOME@/tactus_ecflow/jobout" ecf_ssl = "1" [scheduler.ecfvars.troika] diff --git a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml index 69c9ff4..613fd2e 100644 --- a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml +++ b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml @@ -3,12 +3,12 @@ [scheduler.ecfvars] case_prefix = "" ecf_deode_home = "@DEODE_HOME@" - ecf_files = "@HOME@/deode_ecflow/ecf_files" - ecf_files_remotely = "@HOME@/deode_ecflow/ecf_files" - ecf_home = "@HOME@/deode_ecflow/jobout" + ecf_files = "@HOME@/tactus_ecflow/ecf_files" + ecf_files_remotely = "@HOME@/tactus_ecflow/ecf_files" + ecf_home = "@HOME@/tactus_ecflow/jobout" ecf_host = "ppi-r8login-b1.int.met.no" - ecf_jobout = "@HOME@/deode_ecflow/jobout" - ecf_out = "@HOME@/deode_ecflow/jobout" + ecf_jobout = "@HOME@/tactus_ecflow/jobout" + ecf_out = "@HOME@/tactus_ecflow/jobout" ecf_ssl = "1" [scheduler.ecfvars.troika] diff --git a/surfexp/data/config/include/submission/ppi_rhel8_a1.toml b/surfexp/data/config/include/submission/ppi_rhel8_a1.toml index 74f299c..108927f 100644 --- a/surfexp/data/config/include/submission/ppi_rhel8_a1.toml +++ b/surfexp/data/config/include/submission/ppi_rhel8_a1.toml @@ -1,5 +1,5 @@ [submission] - bindir = "/lustre/storeA/users/trygveasp/deode/test_ib_a1/lib/offline/exe/" + bindir = "/lustre/storeA/users/trygveasp/tactus/test_ib_a1/lib/offline/exe/" default_submit_type = "background" lfftw = true module_initpath = "/usr/share/Modules/init/" diff --git a/surfexp/data/config/include/submission/ppi_rhel8_b1.toml b/surfexp/data/config/include/submission/ppi_rhel8_b1.toml index f1e7027..ef48d33 100644 --- a/surfexp/data/config/include/submission/ppi_rhel8_b1.toml +++ b/surfexp/data/config/include/submission/ppi_rhel8_b1.toml @@ -1,5 +1,5 @@ [submission] - bindir = "/lustre/storeA/users/trygveasp/deode/test_ib_a1/lib/offline/exe/" + bindir = "/lustre/storeA/users/trygveasp/tactus/test_ib_a1/lib/offline/exe/" default_submit_type = "background" lfftw = true module_initpath = "/usr/share/Modules/init/" diff --git a/surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml b/surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml index 4f5e09b..2318029 100644 --- a/surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml +++ b/surfexp/data/config/mods/dev-CY49T2h_deode/dt.toml @@ -15,17 +15,17 @@ lrestart_2m = true [offline] - deode = true + tactus = true [pgd] - deode = true + tactus = true [prep] - deode = true + tactus = true [soda] blocks = ["io", "io_nc", "treedrag", "ecoclimap_sg", "soda"] - deode = false + tactus = false [system] namelist_defs = "@PLUGIN_HOME@/surfexp/data/config/nam/dev-CY49T2h_deode/surfex_namelists.yml" diff --git a/surfexp/data/config/mods/dt_an_forcing.toml b/surfexp/data/config/mods/dt_an_forcing.toml index 69d0e83..323c2d4 100644 --- a/surfexp/data/config/mods/dt_an_forcing.toml +++ b/surfexp/data/config/mods/dt_an_forcing.toml @@ -79,7 +79,7 @@ "offline_teb", "offline_selected_output", ] - deode = false + tactus = false [pgd] blocks = [ @@ -115,7 +115,7 @@ "meb", "pgd_meb", ] - deode = false + tactus = false [prep] blocks = [ @@ -130,7 +130,7 @@ "prep_isba_snow", "meb", ] - deode = false + tactus = false [pysurfex] first_guess_yml_file = "@PLUGIN_HOME@/surfexp/data/first_guess_dt.yml" diff --git a/surfexp/data/config/troika/troika_config.yml b/surfexp/data/config/troika/troika_config.yml index 283f527..f127409 100644 --- a/surfexp/data/config/troika/troika_config.yml +++ b/surfexp/data/config/troika/troika_config.yml @@ -150,6 +150,6 @@ sites: scancel_command: 'scancel -f' new_site: - type: deode + type: tactus connection: local diff --git a/surfexp/data/surfexp.toml b/surfexp/data/surfexp.toml index c4679ee..cefe7c3 100644 --- a/surfexp/data/surfexp.toml +++ b/surfexp/data/surfexp.toml @@ -27,7 +27,7 @@ ial_source = "" [offline] - deode = false + tactus = false tolerate_missing = false [pgd] @@ -42,11 +42,11 @@ zs_input = "gmted2010" [prep] - deode = false + tactus = false tolerate_missing = false [soda] - deode = false + tactus = false tolerate_missing = false [suite_control] diff --git a/surfexp/experiment.py b/surfexp/experiment.py index e668096..15290b9 100644 --- a/surfexp/experiment.py +++ b/surfexp/experiment.py @@ -1,8 +1,8 @@ """Experiment tools.""" import yaml -from deode.datetime_utils import as_datetime, as_timedelta -from deode.logs import logger -from deode.namelist import NamelistGenerator as DeodeNamelistGenerator +from tactus.datetime_utils import as_datetime, as_timedelta +from tactus.logs import logger +from tactus.namelist import NamelistGenerator as TactusNamelistGenerator from pysurfex.namelist import NamelistGenerator, NamelistGeneratorAssemble @@ -55,7 +55,7 @@ def setting_is(self, setting, value, sep="#"): """Check if setting is value. Args: - config (deode.config_parser.ParsedConfig): Parsed config file contents. + config (tactus.config_parser.ParsedConfig): Parsed config file contents. setting (str): Setting value (any): Value sep (str, optional): Separator @@ -70,7 +70,7 @@ def get_nnco(self, config, basetime=None): """Get the active observations. Args: - config (deode.config_parser.ParsedConfig): Parsed config file contents. + config (tactus.config_parser.ParsedConfig): Parsed config file contents. basetime (as_datetime, optional): Basetime. Defaults to None. Returns: @@ -120,18 +120,18 @@ def __init__(self, program, config): Args: program (str): Calling program - config (deode.config_parser.ParsedConfig): Parsed config file contents. + config (tactus.config_parser.ParsedConfig): Parsed config file contents. """ try: - deode = config[f"{program}.deode"] + tactus = config[f"{program}.tactus"] except KeyError: - deode = False - if deode: + tactus = False + if tactus: # SURFEX: Namelists and input data if program == "offline": program = "forecast" - nlgen_surfex = DeodeNamelistGenerator(config, "surfex") + nlgen_surfex = TactusNamelistGenerator(config, "surfex") nlgen_surfex.load(program) settings = nlgen_surfex.assemble_namelist(program) try: @@ -180,18 +180,18 @@ def __init__(self, program, config): SettingsFromNamelist.__init__(self, program, settings, assemble=None) -class SettingsFromNamelistAndConfigDeode(SettingsFromNamelist): - """Set namelist and config from Deode configuration.""" +class SettingsFromNamelistAndConfigTactus(SettingsFromNamelist): + """Set namelist and config from Tactus configuration.""" def __init__(self, program, config): - """Set namelist and config from Deode configuration. + """Set namelist and config from Tactus configuration. Args: program (str): Calling program - config (deode.config_parser.ParsedConfig): Parsed config file contents. + config (tactus.config_parser.ParsedConfig): Parsed config file contents. """ - nlgen_surfex = DeodeNamelistGenerator(config, "surfex") + nlgen_surfex = TactusNamelistGenerator(config, "surfex") nlgen_surfex.load(program) settings = nlgen_surfex.assemble_namelist(program) SettingsFromNamelist.__init__(self, program, settings, assemble=None) @@ -201,7 +201,7 @@ def check_consistency(config): """Check consistency. Args: - config (deode.config_parser.ParsedConfig): Parsed config file contents. + config (tactus.config_parser.ParsedConfig): Parsed config file contents. """ modes = ["pgd", "prep", "offline", "soda"] diff --git a/surfexp/suites/offline.py b/surfexp/suites/offline.py index f131df7..eee32eb 100644 --- a/surfexp/suites/offline.py +++ b/surfexp/suites/offline.py @@ -2,9 +2,9 @@ import contextlib from pathlib import Path -from deode.datetime_utils import as_datetime, as_timedelta, get_decadal_list, get_decade -from deode.logs import logger -from deode.suites.base import ( +from tactus.datetime_utils import as_datetime, as_timedelta, get_decadal_list, get_decade +from tactus.logs import logger +from tactus.suites.base import ( EcflowSuiteFamily, EcflowSuiteTask, EcflowSuiteTrigger, @@ -12,7 +12,7 @@ SuiteDefinition, ) -# TODO should be moved to deode.suites or a module +# TODO should be moved to tactus.suites or a module from ecflow import Limit from surfexp.experiment import SettingsFromNamelistAndConfig, get_total_unique_cycle_list diff --git a/surfexp/tasks/compilation.py b/surfexp/tasks/compilation.py index a8b3c6e..67df7ef 100644 --- a/surfexp/tasks/compilation.py +++ b/surfexp/tasks/compilation.py @@ -2,7 +2,7 @@ import os import shutil -from deode.logs import logger +from tactus.logs import logger from pysurfex.run import BatchJob from surfexp.tasks.tasks import PySurfexBaseTask diff --git a/surfexp/tasks/fetch_mars.py b/surfexp/tasks/fetch_mars.py index 7ef76f5..f9e828e 100644 --- a/surfexp/tasks/fetch_mars.py +++ b/surfexp/tasks/fetch_mars.py @@ -3,8 +3,8 @@ import os import shutil -from deode.datetime_utils import as_timedelta -from deode.logs import logger +from tactus.datetime_utils import as_timedelta +from tactus.logs import logger from pysurfex.run import BatchJob from surfexp.tasks.tasks import PySurfexBaseTask diff --git a/surfexp/tasks/forcing.py b/surfexp/tasks/forcing.py index 91b3178..ebe4e35 100644 --- a/surfexp/tasks/forcing.py +++ b/surfexp/tasks/forcing.py @@ -2,9 +2,9 @@ import os from datetime import timedelta -from deode.datetime_utils import as_timedelta -from deode.logs import logger -from deode.os_utils import deodemakedirs +from tactus.datetime_utils import as_timedelta +from tactus.logs import logger +from tactus.os_utils import deodemakedirs from pysurfex.cli import create_forcing, modify_forcing from pysurfex.verification import concat_datasets, converter2ds diff --git a/surfexp/tasks/gmtedsoil.py b/surfexp/tasks/gmtedsoil.py index cf1465d..bb53874 100644 --- a/surfexp/tasks/gmtedsoil.py +++ b/surfexp/tasks/gmtedsoil.py @@ -5,10 +5,10 @@ import sys import netCDF4 -from deode.geo_utils import Projection, Projstring -from deode.logs import logger -from deode.os_utils import Search, deodemakedirs -from deode.tasks.base import Task +from tactus.geo_utils import Projection, Projstring +from tactus.logs import logger +from tactus.os_utils import Search, deodemakedirs +from tactus.tasks.base import Task try: from osgeo import gdal @@ -57,9 +57,10 @@ def __init__(self, config): Task.__init__(self, config, "Gmted") - self.gmted2010_path = self.fmanager.platform.get_platform_value( - "gmted2010_data_path" + self.topo_source = self.fmanager.platform.get_platform_value( + "topo_source", alt="gmted2010" ) + self.topo_data_path = self.fmanager.platform.get_platform_value("topo_data_path") def get_domain_properties(self, config) -> dict: """Get domain properties. @@ -172,7 +173,7 @@ def define_gmted_input(self, domain_properties: dict) -> tuple: for lat in gmted2010_input_lats: for lon in gmted2010_input_lons: - tif_file = f"{self.gmted2010_path}/{lat}{lon}_20101117_gmted_mea075.tif" + tif_file = f"{self.topo_data_path}/{lat}{lon}_20101117_gmted_mea075.tif" tif_files.append(tif_file) for tif_file in tif_files: @@ -294,7 +295,7 @@ def __init__(self, config): Args: ---- - config (deode.ParsedConfig): Configuration + config (tactus.ParsedConfig): Configuration """ self.domain = self.get_domain_properties(config) @@ -307,7 +308,7 @@ def get_domain_properties(self, config) -> dict: Args: ---- - config (deode.ParsedConfig): Configuration + config (tactus.ParsedConfig): Configuration Returns: ------- diff --git a/surfexp/tasks/surfex_binary_task.py b/surfexp/tasks/surfex_binary_task.py index 388b2b5..bb559e2 100644 --- a/surfexp/tasks/surfex_binary_task.py +++ b/surfexp/tasks/surfex_binary_task.py @@ -1,10 +1,10 @@ """Tasks running surfex binaries.""" import json -from deode.datetime_utils import as_datetime, as_timedelta, get_decade -from deode.logs import logger -from deode.namelist import NamelistGenerator -from deode.os_utils import deodemakedirs +from tactus.datetime_utils import as_datetime, as_timedelta, get_decade +from tactus.logs import logger +from tactus.namelist import NamelistGenerator +from tactus.os_utils import deodemakedirs from pysurfex.cli import offline, perturbed_offline, pgd, prep, soda from surfexp.experiment import SettingsFromNamelistAndConfig, check_consistency @@ -18,7 +18,7 @@ def __init__(self, config, name): """Construct object. Args: - config (deode.ParsedConfig): Configuration + config (tactus.ParsedConfig): Configuration name (str): Name """ @@ -51,7 +51,7 @@ def __init__(self, config): """Construct object. Args: - config (deode.ParsedConfig): Configuration + config (tactus.ParsedConfig): Configuration """ SurfexBinaryTask.__init__(self, config, __class__.__name__) @@ -127,7 +127,7 @@ def __init__(self, config): """Construct object. Args: - config (deode.ParsedConfig): Configuration + config (tactus.ParsedConfig): Configuration """ SurfexBinaryTask.__init__(self, config, __class__.__name__) diff --git a/surfexp/tasks/tasks.py b/surfexp/tasks/tasks.py index 41f3e65..5c0936b 100644 --- a/surfexp/tasks/tasks.py +++ b/surfexp/tasks/tasks.py @@ -5,11 +5,11 @@ import os import shutil -from deode.datetime_utils import as_datetime, as_timedelta, get_decade -from deode.logs import InterceptHandler, logger -from deode.logs import builtin_logging as logging -from deode.os_utils import deodemakedirs -from deode.tasks.base import Task +from tactus.datetime_utils import as_datetime, as_timedelta, get_decade +from tactus.logs import InterceptHandler, logger +from tactus.logs import builtin_logging as logging +from tactus.os_utils import deodemakedirs +from tactus.tasks.base import Task from pysurfex.cli import ( cli_oi2soda, cryoclim_pseudoobs, diff --git a/surfexp/templates/ecflow/default.py b/surfexp/templates/ecflow/default.py index dc95ab7..bdbf90f 100644 --- a/surfexp/templates/ecflow/default.py +++ b/surfexp/templates/ecflow/default.py @@ -2,14 +2,14 @@ import os -from deode.config_parser import ConfigParserDefaults, ParsedConfig -from deode.derived_variables import derived_variables -from deode.logs import LogDefaults, LoggerHandlers, logger -from deode.scheduler import EcflowClient, EcflowServer, EcflowTask -from deode.submission import ProcessorLayout -from deode.tasks.discover_task import get_task - -logger.enable("deode") +from tactus.config_parser import ConfigParserDefaults, ParsedConfig +from tactus.derived_variables import derived_variables +from tactus.logs import LogDefaults, LoggerHandlers, logger +from tactus.scheduler import EcflowClient, EcflowServer, EcflowTask +from tactus.submission import ProcessorLayout +from tactus.tasks.discover_task import get_task + +logger.enable("tactus") def parse_ecflow_vars(): diff --git a/surfexp/templates/ecflow/requeue.py b/surfexp/templates/ecflow/requeue.py index 5d62e7c..6c0bcc2 100644 --- a/surfexp/templates/ecflow/requeue.py +++ b/surfexp/templates/ecflow/requeue.py @@ -2,14 +2,14 @@ import os -from deode.config_parser import ConfigParserDefaults, ParsedConfig -from deode.derived_variables import derived_variables -from deode.logs import LogDefaults, LoggerHandlers, logger -from deode.scheduler import EcflowClient, EcflowServer, EcflowTask -from deode.submission import ProcessorLayout -from deode.tasks.discover_task import get_task - -logger.enable("deode") +from tactus.config_parser import ConfigParserDefaults, ParsedConfig +from tactus.derived_variables import derived_variables +from tactus.logs import LogDefaults, LoggerHandlers, logger +from tactus.scheduler import EcflowClient, EcflowServer, EcflowTask +from tactus.submission import ProcessorLayout +from tactus.tasks.discover_task import get_task + +logger.enable("tactus") def parse_ecflow_vars(): diff --git a/surfexp/templates/stand_alone.py b/surfexp/templates/stand_alone.py index eda6dbc..46405e7 100644 --- a/surfexp/templates/stand_alone.py +++ b/surfexp/templates/stand_alone.py @@ -2,13 +2,13 @@ import os -from deode.config_parser import ConfigParserDefaults, ParsedConfig -from deode.derived_variables import derived_variables, set_times -from deode.logs import logger # Use deode's own configs for logger -from deode.submission import ProcessorLayout, TaskSettings -from deode.tasks.discover_task import get_task +from tactus.config_parser import ConfigParserDefaults, ParsedConfig +from tactus.derived_variables import derived_variables, set_times +from tactus.logs import logger # Use tactus's own configs for logger +from tactus.submission import ProcessorLayout, TaskSettings +from tactus.tasks.discover_task import get_task -logger.enable("deode") +logger.enable("tactus") def stand_alone_main(task, config, deode_home): @@ -17,7 +17,7 @@ def stand_alone_main(task, config, deode_home): Args: task (str): Task name config (str): Config file - deode_home(str): Deode home path + deode_home(str): Tactus home path """ config = ParsedConfig.from_file( config, json_schema=ConfigParserDefaults.MAIN_CONFIG_JSON_SCHEMA diff --git a/tests/conftest.py b/tests/conftest.py index e4e8a78..efb5867 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,9 @@ import os import pytest -from deode.config_parser import ConfigParserDefaults, ParsedConfig -from deode.derived_variables import set_times -from deode.logs import logger +from tactus.config_parser import ConfigParserDefaults, ParsedConfig +from tactus.derived_variables import set_times +from tactus.logs import logger from surfexp import PACKAGE_DIRECTORY from surfexp.cli import pysfxexp @@ -26,8 +26,8 @@ def tmp_directory(tmp_path_factory): @pytest.fixture(scope="module") -def deode_config(tmp_directory): - output_file = f"{tmp_directory}/config_deode.toml" +def tactus_config(tmp_directory): + output_file = f"{tmp_directory}/config_tactus.toml" with open(f"{tmp_directory}/mods.toml", mode="w") as fhandler: fhandler.write("[platform]\n") fhandler.write(f'scratch = "{tmp_directory}"\n') @@ -37,7 +37,7 @@ def deode_config(tmp_directory): "-o", output_file, "--case-name", - "deode_case_name", + "tactus_case_name", "--plugin-home", f"{PACKAGE_DIRECTORY}/..", f"{tmp_directory}/mods.toml", diff --git a/tests/unit/test_suites.py b/tests/unit/test_suites.py index 8058e1f..5e9d47a 100644 --- a/tests/unit/test_suites.py +++ b/tests/unit/test_suites.py @@ -1,6 +1,6 @@ import pytest -from deode.config_parser import ConfigParserDefaults, ParsedConfig -from deode.derived_variables import set_times +from tactus.config_parser import ConfigParserDefaults, ParsedConfig +from tactus.derived_variables import set_times from surfexp import PACKAGE_DIRECTORY from surfexp.cli import pysfxexp @@ -9,7 +9,7 @@ @pytest.fixture(name="mock_submission") def fixture_mock_submission(session_mocker): - session_mocker.patch("deode.submission.TaskSettings") + session_mocker.patch("tactus.submission.TaskSettings") @pytest.fixture(name="sekf_config") @@ -24,7 +24,7 @@ def fixture_sekf_config(tmp_directory): "-o", output_file, "--case-name", - "deode_case_name", + "tactus_case_name", "--plugin-home", f"{PACKAGE_DIRECTORY}/..", f"{tmp_directory}/mods_sekf.toml", @@ -42,8 +42,8 @@ def fixture_sekf_config(tmp_directory): @pytest.mark.usefixtures("mock_submission", "project_directory") -def test_offline_deode_suite(deode_config): - SurfexSuiteDefinition(deode_config) +def test_offline_tactus_suite(tactus_config): + SurfexSuiteDefinition(tactus_config) @pytest.mark.usefixtures("mock_submission", "project_directory") diff --git a/tests/unit/test_tasks.py b/tests/unit/test_tasks.py index 936fd6a..15e00a3 100644 --- a/tests/unit/test_tasks.py +++ b/tests/unit/test_tasks.py @@ -5,10 +5,10 @@ from pathlib import Path import pytest -from deode.logs import logger -from deode.os_utils import deodemakedirs -from deode.tasks.base import Task -from deode.tasks.discover_task import discover, get_task +from tactus.logs import logger +from tactus.os_utils import deodemakedirs +from tactus.tasks.base import Task +from tactus.tasks.discover_task import discover, get_task from surfexp import PACKAGE_DIRECTORY @@ -17,7 +17,7 @@ def available_tasks(): """Create a list of available tasks. Args: - reg (DeodePluginRegistry): Deode plugin registry + reg (TactusPluginRegistry): Tactus plugin registry Returns: known_types (list): Task objects @@ -148,7 +148,7 @@ def fixture_task_name_and_configs(request, default_config, tmp_directory): task_name = request.param task_config = default_config - casedir = f"{tmp_directory}/deode/{task_name}" + casedir = f"{tmp_directory}/tactus/{task_name}" update = { "general": {"case": task_name}, "platform": { From 724a0e430484e35f085fb6980d00639b1aa37b7e Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 12 Dec 2025 12:32:08 +0000 Subject: [PATCH 02/42] Bugix for validtime --- surfexp/tasks/tasks.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/surfexp/tasks/tasks.py b/surfexp/tasks/tasks.py index 5c0936b..93a4c9a 100644 --- a/surfexp/tasks/tasks.py +++ b/surfexp/tasks/tasks.py @@ -299,9 +299,13 @@ def __init__(self, config): raise RuntimeError from KeyError try: self.offset = int(self.config["task.args.offset"]) + fcint = self.config["general.times.cycle_length"] + fcint = as_timedelta(f"{fcint}") except KeyError: self.offset = 0 - self.validtime = self.basetime - as_timedelta(f"{self.offset:02d}:00:00") + fcint = as_timedelta(f"PT0H") + + self.validtime = self.basetime - fcint + as_timedelta(f"{self.offset:02d}:00:00") def execute(self): """Execute.""" @@ -527,7 +531,7 @@ def execute(self): "--indent", str(indent), "--validtime", - self.basetime.strftime("%Y%m%d%H"), + self.validtime.strftime("%Y%m%d%H"), "--domain", self.domain_file, ] @@ -563,9 +567,12 @@ def __init__(self, config): raise RuntimeError from KeyError try: self.offset = int(self.config["task.args.offset"]) + fcint = self.config["general.times.cycle_length"] + fcint = as_timedelta(f"{fcint}") except KeyError: self.offset = 0 - self.validtime = self.basetime - as_timedelta(f"{self.offset:02d}:00:00") + fcint = as_timedelta(f"PT0H") + self.validtime = self.basetime -fcint + as_timedelta(f"{self.offset:02d}:00:00") def execute(self): """Execute.""" From aabb31bb49e4ae767108b151c4b20bb99b62cbe9 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 22 Jan 2026 14:42:37 +0100 Subject: [PATCH 03/42] Use ACCORD tactus. Start on automatic testing --- .github/workflows/tests.yml | 114 ++++++++++++++---------------------- pyproject.toml | 2 +- 2 files changed, 46 insertions(+), 70 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0022fa3..6666772 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,21 +15,10 @@ 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" ] + if: github.repository_owner == 'trygveasp' - 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: #---------------------------------------------- @@ -46,6 +35,11 @@ jobs: cache-environment: true post-cleanup: 'all' + - name: Dump mamba environment + run: | + conda env list + shell: micromamba-shell {0} + #---------------------------------------------- # --- configure poetry & install project ---- #---------------------------------------------- @@ -60,28 +54,17 @@ jobs: 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}} + export PATH=$PATH poetry install --no-interaction --only-root - shell: micromamba-shell {0} #---------------------------------------------- # run test suite and report coverage @@ -89,45 +72,38 @@ jobs: - 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 }} +# - 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 +# +# - 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 }} +# \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 67be783..586194c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ requires = ["poetry-core >= 1.2.0"] [tool.poetry.dependencies] - tactus = {git = "git@github.com:mfroelund/Tactus.git", branch = "feature/prepare-tactus-package"} + tactus = {git = "git@github.com:ACCORD-NWP/tactus", branch = "feature/prepare-tactus-package"} pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" From 91066c271ed4aab17fe1699080128783b3e2826b Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 22 Jan 2026 14:47:21 +0100 Subject: [PATCH 04/42] Correct tactus protocol --- .github/workflows/tests.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6666772..f2a9903 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,7 +63,7 @@ jobs: - name: Install the project itself run: | - export PATH=$PATH + export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry install --no-interaction --only-root #---------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 586194c..12cd8ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ requires = ["poetry-core >= 1.2.0"] [tool.poetry.dependencies] - tactus = {git = "git@github.com:ACCORD-NWP/tactus", branch = "feature/prepare-tactus-package"} + tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "feature/prepare-tactus-package"} pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" From 04150d1b604ee66c4f14398f10ca313172316ed3 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 10:38:38 +0100 Subject: [PATCH 05/42] Hopefully fix unit testsing and linting --- pyproject.toml | 21 +-- surfexp/cli.py | 2 +- .../configurations/hres_an_forcing.toml | 2 +- surfexp/data/surfexp.toml | 6 + surfexp/experiment.py | 2 +- surfexp/suites/offline.py | 16 ++- surfexp/tasks/compilation.py | 2 +- surfexp/tasks/fetch_mars.py | 39 ++++- surfexp/tasks/forcing.py | 9 +- surfexp/tasks/surfex_binary_task.py | 2 +- surfexp/tasks/tasks.py | 16 +-- tests/conftest.py | 136 +++++++++++++++--- tests/unit/test_suites.py | 6 +- tests/unit/test_tasks.py | 3 +- 14 files changed, 197 insertions(+), 65 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 12cd8ac..e542169 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,8 +2,8 @@ authors = ["Trygve Aspelien "] description = "surfExp" include = [{path = "surfexp/data", format = ["sdist", "wheel"]}] - name = "surfexp" license = "Apache-2.0" + name = "surfexp" readme = "README.rst" version = "0.4.1" @@ -16,9 +16,9 @@ requires = ["poetry-core >= 1.2.0"] [tool.poetry.dependencies] - tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "feature/prepare-tactus-package"} pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" + tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" @@ -27,10 +27,9 @@ [tool.poetry.group.linting.dependencies] black = {extras = ["jupyter"], version = "^23.10.0"} - isort = "^5.12.0" poethepoet = {extras = ["poetry-plugin"], version = "^0.34.0"} pydoclint = "^0.3.8" # Replaces darglint, but is maintained & faster - ruff = "^0.11.0" + ruff = "^0.14.11" toml-formatter = {git = "https://github.com/paulovcmedeiros/toml-formatter"} [tool.poetry.group.test.dependencies] @@ -62,10 +61,6 @@ # Activate only those plugins not covered by ruff pydoclint = [] -[tool.isort] - line_length = 90 - profile = "black" - [tool.ruff] ignore = [ "C901", @@ -168,7 +163,6 @@ """ # Linting tasks _black = "black ." - _isort = "isort ." _ruff = "ruff check ." _toml_formatter = "toml-formatter check ." # Test-related tasks @@ -211,13 +205,8 @@ [[tool.poe.tasks.lint.switch]] case = "True" - sequence = ["_isort", "_black", "_ruff --fix", "_toml_formatter --fix"] + sequence = ["_black", "_ruff --fix", "_toml_formatter --fix"] [[tool.poe.tasks.lint.switch]] case = "False" - sequence = [ - "_isort --check-only", - "_black --check --diff", - "_ruff", - "_toml_formatter", - ] + sequence = ["_black --check --diff", "_ruff", "_toml_formatter"] diff --git a/surfexp/cli.py b/surfexp/cli.py index 5e8df80..480f257 100644 --- a/surfexp/cli.py +++ b/surfexp/cli.py @@ -129,7 +129,7 @@ def pysfxexp(argv=None): argv.append(tmp_mods_output) cmd = " ".join(argv) - logger.debug("tactus case command: tactus {}", cmd) + logger.info("tactus case command: tactus {}", cmd) main(argv=argv) with open(tmp_output, mode="r", encoding="utf8") as fhandler_in, open( output, mode="w", encoding="utf8" diff --git a/surfexp/data/config/configurations/hres_an_forcing.toml b/surfexp/data/config/configurations/hres_an_forcing.toml index 2d488dc..0ef0434 100644 --- a/surfexp/data/config/configurations/hres_an_forcing.toml +++ b/surfexp/data/config/configurations/hres_an_forcing.toml @@ -21,11 +21,11 @@ dir-sw-converter = "none" diskless-write = true domain = "@climdir@/domain.json" - modify-forcing = false input-format = "surfex" input-geo-file = "@climdir@/domain.json" interpolation = "bilinear" lw-converter = "none" + modify-forcing = false pattern = "@default_forcing_dir@/FORCING.nc" ps-converter = "none" qa = "netcdf" diff --git a/surfexp/data/surfexp.toml b/surfexp/data/surfexp.toml index cefe7c3..8a966cd 100644 --- a/surfexp/data/surfexp.toml +++ b/surfexp/data/surfexp.toml @@ -26,6 +26,9 @@ build_config = "" ial_source = "" +[extractsqlite] + station_list = "" + [offline] tactus = false tolerate_missing = false @@ -45,6 +48,9 @@ tactus = false tolerate_missing = false +[prep.args] + prep-file = "" + [soda] tactus = false tolerate_missing = false diff --git a/surfexp/experiment.py b/surfexp/experiment.py index 15290b9..55d153c 100644 --- a/surfexp/experiment.py +++ b/surfexp/experiment.py @@ -1,9 +1,9 @@ """Experiment tools.""" import yaml +from pysurfex.namelist import NamelistGenerator, NamelistGeneratorAssemble from tactus.datetime_utils import as_datetime, as_timedelta from tactus.logs import logger from tactus.namelist import NamelistGenerator as TactusNamelistGenerator -from pysurfex.namelist import NamelistGenerator, NamelistGeneratorAssemble class SettingsFromNamelist: diff --git a/surfexp/suites/offline.py b/surfexp/suites/offline.py index eee32eb..548a77a 100644 --- a/surfexp/suites/offline.py +++ b/surfexp/suites/offline.py @@ -2,6 +2,8 @@ import contextlib from pathlib import Path +# TODO should be moved to tactus.suites or a module +from ecflow import Limit from tactus.datetime_utils import as_datetime, as_timedelta, get_decadal_list, get_decade from tactus.logs import logger from tactus.suites.base import ( @@ -12,9 +14,6 @@ SuiteDefinition, ) -# TODO should be moved to tactus.suites or a module -from ecflow import Limit - from surfexp.experiment import SettingsFromNamelistAndConfig, get_total_unique_cycle_list @@ -313,8 +312,10 @@ def __init__( if self.do_prep: settings = SettingsFromNamelistAndConfig("prep", self.config) - cfile = settings.get_setting("NAM_PREP_SURF_ATM#CFILE") - cfiletype = settings.get_setting("NAM_PREP_SURF_ATM#CFILETYPE") + cfile = settings.get_setting("NAM_PREP_SURF_ATM#CFILE", default="") + cfiletype = settings.get_setting( + "NAM_PREP_SURF_ATM#CFILETYPE", default="" + ) if cfile != "" and cfiletype == "GRIB": mars_prep = EcflowSuiteTask( "FetchMarsPrep", @@ -325,8 +326,9 @@ def __init__( input_template=template, variables={"ARGS": "prep"}, ) - triggers = EcflowSuiteTriggers([EcflowSuiteTrigger(mars), - EcflowSuiteTrigger(mars_prep)]) + triggers = EcflowSuiteTriggers( + [EcflowSuiteTrigger(mars), EcflowSuiteTrigger(mars_prep)] + ) interpolate_bd = None if config["suite_control.interpolate2grid"]: diff --git a/surfexp/tasks/compilation.py b/surfexp/tasks/compilation.py index 67df7ef..1846c57 100644 --- a/surfexp/tasks/compilation.py +++ b/surfexp/tasks/compilation.py @@ -2,8 +2,8 @@ import os import shutil -from tactus.logs import logger from pysurfex.run import BatchJob +from tactus.logs import logger from surfexp.tasks.tasks import PySurfexBaseTask diff --git a/surfexp/tasks/fetch_mars.py b/surfexp/tasks/fetch_mars.py index 8110c65..66551a8 100644 --- a/surfexp/tasks/fetch_mars.py +++ b/surfexp/tasks/fetch_mars.py @@ -3,9 +3,9 @@ import os import shutil +from pysurfex.run import BatchJob from tactus.datetime_utils import as_timedelta from tactus.logs import logger -from pysurfex.run import BatchJob from surfexp.tasks.tasks import PySurfexBaseTask @@ -19,6 +19,11 @@ class FetchMars(PySurfexBaseTask): """ def __init__(self, config): + """Fetch mars data for forcing. + + :param self: Description + :param config: Description + """ PySurfexBaseTask.__init__(self, config, name="FetchMars") try: mode = self.config["task.args.mode"] @@ -147,6 +152,11 @@ class FetchMarsPrep(PySurfexBaseTask): """ def __init__(self, config): + """Fetch mars data for prep. + + :param self: Description + :param config: Description + """ PySurfexBaseTask.__init__(self, config, name="FetchMarsPrep") gribfile = self.config["prep.args.prep-file"] gribfile = self.platform.substitute(gribfile) @@ -190,8 +200,10 @@ def fetch_mars(self): clas = "RD" expver = self.config[f"mars.{self.mars_config}.expver"] grid = self.config[f"mars.{self.mars_config}.grid"] - params = "32/33/39/40/41/42/139/141/170/172/183/198/235/236/" + \ - "35/36/37/38/238/243/244/245/31/34/129" + params = ( + "32/33/39/40/41/42/139/141/170/172/183/198/235/236/" + + "35/36/37/38/238/243/244/245/31/34/129" + ) req = Request( action="retrieve", dates=self.date, @@ -238,6 +250,27 @@ def __init__( grid=None, area=None, ): + """Create request. + + :param self: Description + :param action: Description + :param source: Description + :param dates: Description + :param hours: Description + :param origin: Description + :param typ: Description + :param step: Description + :param levelist: Description + :param param: Description + :param levtype: Description + :param database: Description + :param expver: Description + :param clas: Description + :param stream: Description + :param target: Description + :param grid: Description + :param area: Description + """ self.action = action self.target = target self.source = source diff --git a/surfexp/tasks/forcing.py b/surfexp/tasks/forcing.py index a1a511c..0757e62 100644 --- a/surfexp/tasks/forcing.py +++ b/surfexp/tasks/forcing.py @@ -2,11 +2,11 @@ import os from datetime import timedelta +from pysurfex.cli import cli_modify_forcing, create_forcing +from pysurfex.verification import concat_datasets, converter2ds from tactus.datetime_utils import as_timedelta from tactus.logs import logger from tactus.os_utils import deodemakedirs -from pysurfex.cli import create_forcing, cli_modify_forcing -from pysurfex.verification import concat_datasets, converter2ds from surfexp.tasks.tasks import PySurfexBaseTask @@ -128,7 +128,7 @@ def execute(self): output_dir = self.platform.substitute(forcing_dir, basetime=self.basetime) input_file = input_dir + "/FORCING.nc" output_file = output_dir + "/FORCING.nc" - time_step = int(self.fcint.total_seconds()/3600) + time_step = int(self.fcint.total_seconds() / 3600) argv = [ "--input_file", @@ -251,7 +251,8 @@ def execute(self): self.basetime.strftime("%Y%m%d%H"), "--validtime", validtime, - "--fcint", "86400", + "--fcint", + "86400", ] logger.info("converter2ds {}", " ".join(argv)) converter2ds(argv=argv) diff --git a/surfexp/tasks/surfex_binary_task.py b/surfexp/tasks/surfex_binary_task.py index bb559e2..6a85844 100644 --- a/surfexp/tasks/surfex_binary_task.py +++ b/surfexp/tasks/surfex_binary_task.py @@ -1,11 +1,11 @@ """Tasks running surfex binaries.""" import json +from pysurfex.cli import offline, perturbed_offline, pgd, prep, soda from tactus.datetime_utils import as_datetime, as_timedelta, get_decade from tactus.logs import logger from tactus.namelist import NamelistGenerator from tactus.os_utils import deodemakedirs -from pysurfex.cli import offline, perturbed_offline, pgd, prep, soda from surfexp.experiment import SettingsFromNamelistAndConfig, check_consistency from surfexp.tasks.tasks import PySurfexBaseTask diff --git a/surfexp/tasks/tasks.py b/surfexp/tasks/tasks.py index 93a4c9a..f210041 100644 --- a/surfexp/tasks/tasks.py +++ b/surfexp/tasks/tasks.py @@ -5,11 +5,6 @@ import os import shutil -from tactus.datetime_utils import as_datetime, as_timedelta, get_decade -from tactus.logs import InterceptHandler, logger -from tactus.logs import builtin_logging as logging -from tactus.os_utils import deodemakedirs -from tactus.tasks.base import Task from pysurfex.cli import ( cli_oi2soda, cryoclim_pseudoobs, @@ -22,6 +17,11 @@ from pysurfex.platform_deps import SystemFilePaths from pysurfex.run import BatchJob from pysurfex.verification import converter2harp_cli +from tactus.datetime_utils import as_datetime, as_timedelta, get_decade +from tactus.logs import InterceptHandler, logger +from tactus.logs import builtin_logging as logging +from tactus.os_utils import deodemakedirs +from tactus.tasks.base import Task from surfexp.experiment import SettingsFromNamelistAndConfig @@ -303,7 +303,7 @@ def __init__(self, config): fcint = as_timedelta(f"{fcint}") except KeyError: self.offset = 0 - fcint = as_timedelta(f"PT0H") + fcint = as_timedelta("PT0H") self.validtime = self.basetime - fcint + as_timedelta(f"{self.offset:02d}:00:00") @@ -571,8 +571,8 @@ def __init__(self, config): fcint = as_timedelta(f"{fcint}") except KeyError: self.offset = 0 - fcint = as_timedelta(f"PT0H") - self.validtime = self.basetime -fcint + as_timedelta(f"{self.offset:02d}:00:00") + fcint = as_timedelta("PT0H") + self.validtime = self.basetime - fcint + as_timedelta(f"{self.offset:02d}:00:00") def execute(self): """Execute.""" diff --git a/tests/conftest.py b/tests/conftest.py index efb5867..bc493af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,7 @@ import os import pytest +import tomli_w from tactus.config_parser import ConfigParserDefaults, ParsedConfig from tactus.derived_variables import set_times from tactus.logs import logger @@ -26,12 +27,123 @@ def tmp_directory(tmp_path_factory): @pytest.fixture(scope="module") -def tactus_config(tmp_directory): +def test_arch(): + my_host = "my_dummy_host" + os.environ["DEODE_HOST"] = my_host + return my_host + + +@pytest.fixture(scope="module") +def scratch_dir(tmp_directory): + return f"{tmp_directory}/scratch" + + +@pytest.fixture(scope="module") +def dummy_include_files(test_arch, module_initfile, scratch_dir): + incdir = f"{PACKAGE_DIRECTORY}/data/config/include" + os.makedirs(incdir, exist_ok=True) + incdirs = ["scheduler", "archiving", "platform_paths", "submission"] + for incdir1 in incdirs: + os.makedirs(f"{incdir}/{incdir1}", exist_ok=True) + with open(f"{incdir}/scheduler/ecflow_{test_arch}.toml", mode="wb") as fhandler: + fdef = { + "scheduler": { + "ecfvars": { + "case_prefix": "", + "ecf_deode_home": "strip_off_mount_path('@DEODE_HOME@',)", + "ecf_files": "@HOME@/deode_ecflow/ecf_files", + "ecf_files_remotely": "@HOME@/deode_ecflow/ecf_files", + "ecf_home": "@HOME@/deode_ecflow/jobout", + "ecf_host": "pc5709", + "ecf_jobout": "@HOME@/deode_ecflow/jobout", + "ecf_out": "@HOME@/deode_ecflow/jobout", + "ecf_port": 44855, + "troika": { + "config_file": "@ECF_DEODE_HOME@/data/config_files/troika.yml" + }, + } + } + } + tomli_w.dump(fdef, fhandler) + with open(f"{incdir}/submission/{test_arch}.toml", mode="wb") as fhandler: + tomli_w.dump( + { + "submission": { + "bindir": f"{scratch_dir}/surfexp/bin", + "default_submit_type": "serial", + "module_initfile": module_initfile, + "task": {"wrapper": ""}, + "types": { + "serial": { + "NPROC": 1, + "NPROCX": 1, + "NPROCY": 1, + "SCHOST": "localhost", + "WRAPPER": "", + "BATCH": {}, + "ENV": {}, + "MODULES": {}, + } + }, + } + }, + fhandler, + ) + + with open(f"{incdir}/archiving/{test_arch}.toml", mode="wb") as fhandler: + tomli_w.dump({"archiving": {}}, fhandler) + + with open(f"{incdir}/platform_paths/{test_arch}.toml", mode="wb") as fhandler: + tomli_w.dump( + { + "platform": { + "scratch": scratch_dir, + "archive_root": "@SCRATCH@/@CASE@/archive", + "albnir_soil_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/ALB_SAT", + "albnir_veg_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/ALB_SAT", + "albvis_soil_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/ALB_SAT", + "albvis_veg_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/ALB_SAT", + "archive_type": "ecfs", + "climdata": "@STATIC_DATA@/climate", + "deode_home": "set-by-the-system", + "e923_data": "@STATIC_DATA@/climate/E923_DATA", + "ecoclim_data_path": "@CLIMDATA@/ecoclimap", + "ecoclimap_bin_dir": "@ecoclim_data_path@", + "ecosg_data_path": "@CLIMDATA@/ECOCLIMAP-SG/V0", + "fixed_bdclimdir": "", + "fixed_bddir": "", + "fixed_bddir_sfx": "", + "flake_dir": "@STATIC_DATA@/climate/", + "global_sfcdir": "@STATIC_DATA@/climate_fields_mir/climate.v020_MIR_orog/", + "lai_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/LAI_SAT", + "ncdir": "@STATIC_DATA@/ncdir", + "osm_data": "@CLIMDATA@/OSM_SFX8_1/GARDEN/", + "pgd_data_path": "@CLIMDATA@/PGD", + "rrtm_dir": "@STATIC_DATA@/rrtm/@CYCLE@", + "soilgrid_data_path": "@CLIMDATA@/soilgrid", + "static_data": "@HOME@/nobackup/harmonie/", + "task_name": "@STAND_ALONE_TASK_NAME@", + "tree_height_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/HT", + "unix_group": "", + "windfarm_path": "@STATIC_DATA@/WFP_input_files/", + "topo_data_path": "@CLIMDATA@/gmted2010", + }, + "system": {"casedir": "@SCRATCH@/surfexp/@CASE@"}, + }, + fhandler, + ) + + +@pytest.fixture(scope="module") +def module_initfile(tmp_directory): + module_initfile = f"{tmp_directory}/module_initfile" + os.system(f"touch {module_initfile}") # noqa S605 + return module_initfile + + +@pytest.fixture(scope="module") +def tactus_config(tmp_directory, dummy_include_files): # noqa output_file = f"{tmp_directory}/config_tactus.toml" - with open(f"{tmp_directory}/mods.toml", mode="w") as fhandler: - fhandler.write("[platform]\n") - fhandler.write(f'scratch = "{tmp_directory}"\n') - fhandler.write('unix_group = "suv"\n') argv = [ "-o", @@ -40,7 +152,6 @@ def tactus_config(tmp_directory): "tactus_case_name", "--plugin-home", f"{PACKAGE_DIRECTORY}/..", - f"{tmp_directory}/mods.toml", f"{PACKAGE_DIRECTORY}/data/config/domains/DRAMMEN.toml", f"{PACKAGE_DIRECTORY}/data/config/configurations/dt.toml", f"{PACKAGE_DIRECTORY}/data/config/mods/dt_an_forcing.toml", @@ -64,26 +175,19 @@ def default_config(default_config_file): @pytest.fixture(scope="module") -def default_config_file(tmp_directory): - output_file_static = "/home/trygveasp/projects/surfExp/config.toml" +def default_config_file(dummy_include_files): # noqa + output_file_static = "static_config.toml" if True: - output_file = f"{tmp_directory}/config_default.toml" - with open(f"{tmp_directory}/mods.toml", mode="w", encoding="utf8") as fhandler: - fhandler.write("[platform]\n") - fhandler.write(f'scratch = "{tmp_directory}"\n') - fhandler.write('unix_group = "suv"\n') argv = [ "-o", - output_file, + output_file_static, "--case-name", "default_case_name", "--plugin-home", f"{PACKAGE_DIRECTORY}/..", - f"{tmp_directory}/mods.toml", f"{PACKAGE_DIRECTORY}/data/config/domains/DRAMMEN.toml", ] pysfxexp(argv=argv) - os.system(f"cp {output_file} {output_file_static}") # noqa S605 output_file = output_file_static return output_file diff --git a/tests/unit/test_suites.py b/tests/unit/test_suites.py index 5e9d47a..f9338b6 100644 --- a/tests/unit/test_suites.py +++ b/tests/unit/test_suites.py @@ -13,12 +13,8 @@ def fixture_mock_submission(session_mocker): @pytest.fixture(name="sekf_config") -def fixture_sekf_config(tmp_directory): +def fixture_sekf_config(tmp_directory, dummy_include_files): # noqa output_file = f"{tmp_directory}/config_sekf.toml" - with open(f"{tmp_directory}/mods_sekf.toml", mode="w", encoding="utf8") as fhandler: - fhandler.write("[platform]\n") - fhandler.write(f'scratch = "{tmp_directory}"\n') - fhandler.write('unix_group = "suv"\n') argv = [ "-o", diff --git a/tests/unit/test_tasks.py b/tests/unit/test_tasks.py index 15e00a3..793718c 100644 --- a/tests/unit/test_tasks.py +++ b/tests/unit/test_tasks.py @@ -148,7 +148,7 @@ def fixture_task_name_and_configs(request, default_config, tmp_directory): task_name = request.param task_config = default_config - casedir = f"{tmp_directory}/tactus/{task_name}" + casedir = f"{tmp_directory}/surfexp/{task_name}" update = { "general": {"case": task_name}, "platform": { @@ -198,6 +198,7 @@ def fixture_task_name_and_configs(request, default_config, tmp_directory): programs = ["PGD-offline", "PREP-offline", "OFFLINE-offline", "SODA-offline"] for program in programs: os.system(f"touch {builddir}/{program}") # noqa S605 + # /tmp/pytest-of-trygveasp/pytest-10/deode/cmakebuild/offline/build/bin/PGD-offline elif task_name.lower() == "soil": soilgrid_data_path = f"{casedir}/SOILGRID" deodemakedirs(soilgrid_data_path) From 94cfc50a9eca652d18a9d188ff8508248d49d7a2 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 10:53:19 +0100 Subject: [PATCH 06/42] Hopefully fix unit testsing and linting --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f2a9903..0a30563 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,6 +63,7 @@ jobs: - name: Install the project itself run: | + ls -l /tmp/micromamba/envs/surfExp/bin export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry install --no-interaction --only-root @@ -71,6 +72,8 @@ jobs: #---------------------------------------------- - name: Run tests run: | + ls -l /tmp/micromamba/envs/surfExp/bin + export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry run pytest # - name: Coveralls From 426dc607c01df0429f85cde335bf12142c6cd052 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 11:31:44 +0100 Subject: [PATCH 07/42] Hopefully fix unit testsing and linting --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a30563..4ec5fc7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,7 +72,12 @@ jobs: #---------------------------------------------- - name: Run tests run: | + echo "/tmp/micromamba/envs/surfExp/bin" ls -l /tmp/micromamba/envs/surfExp/bin + echo "/home/runner/work/surfExp/surfExp/.venv/bin/python" + ls -l /home/runner/work/surfExp/surfExp/.venv/bin/python + echo "/home/runner/work/surfExp/surfExp/.venv/lib/python3.11/site-packages" + ls -l export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry run pytest From ea615b5ba61b639602c8dd1958917f0475240c44 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 12:38:54 +0100 Subject: [PATCH 08/42] Hopefully fix unit testsing and linting --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ec5fc7..9033766 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -65,6 +65,7 @@ jobs: run: | ls -l /tmp/micromamba/envs/surfExp/bin export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH + poetry env use /tmp/micromamba/envs/surfExp/bin/python poetry install --no-interaction --only-root #---------------------------------------------- @@ -77,7 +78,7 @@ jobs: echo "/home/runner/work/surfExp/surfExp/.venv/bin/python" ls -l /home/runner/work/surfExp/surfExp/.venv/bin/python echo "/home/runner/work/surfExp/surfExp/.venv/lib/python3.11/site-packages" - ls -l + ls -l export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry run pytest From 23a15f19489af7d796d687912caae860bd408431 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 12:43:29 +0100 Subject: [PATCH 09/42] Hopefully fix unit testsing and linting --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9033766..5833525 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,6 +59,7 @@ jobs: - name: Install dependencies (if venv cache is not found) if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: | + poetry env use /tmp/micromamba/envs/surfExp/bin/python poetry install --no-interaction --no-root --only main,test - name: Install the project itself From 7e5a936c14b7ac1c6b4a3696cb0ebfee522ff245 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 13:18:10 +0100 Subject: [PATCH 10/42] Hopefully fix unit testsing and linting --- tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index bc493af..4d81287 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -120,13 +120,13 @@ def dummy_include_files(test_arch, module_initfile, scratch_dir): "osm_data": "@CLIMDATA@/OSM_SFX8_1/GARDEN/", "pgd_data_path": "@CLIMDATA@/PGD", "rrtm_dir": "@STATIC_DATA@/rrtm/@CYCLE@", - "soilgrid_data_path": "@CLIMDATA@/soilgrid", - "static_data": "@HOME@/nobackup/harmonie/", + "soilgrid_data_path": "@SCRATCH@/surfexp/@CASE@/SOIL", + "static_data": "@HOME@/static_data/harmonie/", "task_name": "@STAND_ALONE_TASK_NAME@", "tree_height_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/HT", "unix_group": "", "windfarm_path": "@STATIC_DATA@/WFP_input_files/", - "topo_data_path": "@CLIMDATA@/gmted2010", + "topo_data_path": "@SCRATCH@/surfexp/@CASE@/GMTED", }, "system": {"casedir": "@SCRATCH@/surfexp/@CASE@"}, }, From a4192ac209bc3ba237b4e2f549b9d83afdc0f24b Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 14:23:33 +0100 Subject: [PATCH 11/42] Hopefully fix unit testsing and linting --- .github/workflows/linting.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 8e42a8c..441fef8 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -16,7 +16,7 @@ on: jobs: linting: - if: github.repository_owner == 'destination-earth-digital-twins' + if: github.repository_owner == 'metno' name: Run Linters runs-on: ubuntu-latest environment: staging @@ -46,25 +46,25 @@ jobs: uses: actions/cache@v4 with: path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }} + 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: | + export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH + poetry env use /tmp/micromamba/envs/surfExp/bin/python + poetry install --no-interaction --no-root --only linting - name: Install the project itself - run: poetry install --no-interaction --only-root + run: | + export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH + poetry env use /tmp/micromamba/envs/surfExp/bin/python + poetry install --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 . + export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH + poetry run poetry devtools lint From 542045e68cf3a020ca97e3fd159384383e38cffb Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:21:27 +0100 Subject: [PATCH 12/42] Restructure workflows --- .github/workflows/linting.yaml | 30 ++++++++-------- .github/workflows/tests.yml | 63 +++------------------------------- 2 files changed, 20 insertions(+), 73 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 441fef8..77ded51 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -5,7 +5,6 @@ on: pull_request: branches: - master - - develop paths: - '**.py' push: @@ -16,10 +15,9 @@ on: jobs: linting: - if: github.repository_owner == 'metno' name: Run Linters runs-on: ubuntu-latest - environment: staging + steps: #---------------------------------------------- # check-out repo and set-up python @@ -32,14 +30,21 @@ jobs: 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: Set PATH + run: | + - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc + + - name: Set python + run: | + - poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) id: cached-poetry-dependencies @@ -51,14 +56,10 @@ jobs: - name: Install dependencies (if venv cache is not found) if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: | - export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH - poetry env use /tmp/micromamba/envs/surfExp/bin/python poetry install --no-interaction --no-root --only linting - name: Install the project itself run: | - export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH - poetry env use /tmp/micromamba/envs/surfExp/bin/python poetry install --no-interaction --only-root #---------------------------------------------- @@ -66,5 +67,4 @@ jobs: #---------------------------------------------- - name: Linting run: | - export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry run poetry devtools lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5833525..34577cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ env: jobs: tests: - if: github.repository_owner == 'trygveasp' name: "Install and test surfExp" runs-on: "ubuntu-latest" @@ -35,19 +34,13 @@ jobs: cache-environment: true post-cleanup: 'all' - - name: Dump mamba environment + - name: Set PATH run: | - conda env list - shell: micromamba-shell {0} + - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc - #---------------------------------------------- - # --- configure poetry & install project ---- - #---------------------------------------------- - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true + - name: Set python + run: | + - poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) id: cached-poetry-dependencies @@ -59,14 +52,10 @@ jobs: - name: Install dependencies (if venv cache is not found) if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: | - poetry env use /tmp/micromamba/envs/surfExp/bin/python poetry install --no-interaction --no-root --only main,test - name: Install the project itself run: | - ls -l /tmp/micromamba/envs/surfExp/bin - export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH - poetry env use /tmp/micromamba/envs/surfExp/bin/python poetry install --no-interaction --only-root #---------------------------------------------- @@ -74,46 +63,4 @@ jobs: #---------------------------------------------- - name: Run tests run: | - echo "/tmp/micromamba/envs/surfExp/bin" - ls -l /tmp/micromamba/envs/surfExp/bin - echo "/home/runner/work/surfExp/surfExp/.venv/bin/python" - ls -l /home/runner/work/surfExp/surfExp/.venv/bin/python - echo "/home/runner/work/surfExp/surfExp/.venv/lib/python3.11/site-packages" - ls -l - export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH poetry run pytest - -# - 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 -# -# - 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 }} -# \ No newline at end of file From 1c6bd6ead369368a7479788014171fb55a2c2c69 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:24:18 +0100 Subject: [PATCH 13/42] Restructure workflows --- .github/workflows/linting.yaml | 4 ++-- .github/workflows/tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 77ded51..9d3b607 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -40,11 +40,11 @@ jobs: - name: Set PATH run: | - - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc + echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc - name: Set python run: | - - poetry env use /tmp/micromamba/envs/surfExp/bin/python + poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) id: cached-poetry-dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 34577cd..1e5fdf6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,11 +36,11 @@ jobs: - name: Set PATH run: | - - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc + echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc - name: Set python run: | - - poetry env use /tmp/micromamba/envs/surfExp/bin/python + poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) id: cached-poetry-dependencies From cf298f698c7d34b4f7a3bc568bb61f8248e63bf6 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:27:43 +0100 Subject: [PATCH 14/42] Restructure workflows --- .github/workflows/linting.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 9d3b607..ec50b21 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -44,6 +44,9 @@ jobs: - name: Set python run: | + ls -l ~/.bashrc + cat ~/.bashrc + ls -l /tmp/micromamba/envs/surfExp/bin/poetry poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) From 87bfd2f64232ac3b1b3351f42cddd2af7d164e1d Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:30:24 +0100 Subject: [PATCH 15/42] Restructure workflows --- .github/workflows/linting.yaml | 3 --- .github/workflows/tests.yml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index ec50b21..9d3b607 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -44,9 +44,6 @@ jobs: - name: Set python run: | - ls -l ~/.bashrc - cat ~/.bashrc - ls -l /tmp/micromamba/envs/surfExp/bin/poetry poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e5fdf6..829eb8d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,6 +40,9 @@ jobs: - name: Set python run: | + ls -l ~/.bashrc + cat ~/.bashrc + ls -l /tmp/micromamba/envs/surfExp/bin/poetry poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) From cd8b21069d4d7baaeabdb0fad5754469ff2edbda Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:32:48 +0100 Subject: [PATCH 16/42] Restructure workflows --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 829eb8d..c399b10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,12 +36,10 @@ jobs: - name: Set PATH run: | - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc + echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" | sudo tee -a /etc/bash.bashrc - name: Set python run: | - ls -l ~/.bashrc - cat ~/.bashrc ls -l /tmp/micromamba/envs/surfExp/bin/poetry poetry env use /tmp/micromamba/envs/surfExp/bin/python From 98231a5286a840b5f1bde3890f2c4028db0667cc Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:36:50 +0100 Subject: [PATCH 17/42] Restructure workflows --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c399b10..ebf0570 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: - name: Set PATH run: | - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" | sudo tee -a /etc/bash.bashrc + echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> $GITHUB_PATH - name: Set python run: | From ffa96c7fdf595ceff5be1c036a765ee93a00a70f Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:41:52 +0100 Subject: [PATCH 18/42] Restructure workflows --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebf0570..4256c15 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: - name: Set PATH run: | - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> $GITHUB_PATH + echo "export PATH=/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH - name: Set python run: | From 03e2dea3752b61f9bd37370a29335a83757dc392 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:42:54 +0100 Subject: [PATCH 19/42] Restructure workflows --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4256c15..1e306fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: - name: Set PATH run: | - echo "export PATH=/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH + echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH - name: Set python run: | From 463b9a7916a9cd212ecc30eee877385b9223fe4a Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:44:54 +0100 Subject: [PATCH 20/42] Restructure workflows --- .github/workflows/linting.yaml | 2 +- .github/workflows/tests.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 9d3b607..74c0eaa 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -40,7 +40,7 @@ jobs: - name: Set PATH run: | - echo "export PATH=/tmp/micromamba/envs/surfExp/bin:$PATH" >> ~/.bashrc + echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH - name: Set python run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e306fe..b571b03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,6 +41,7 @@ jobs: - name: Set python run: | ls -l /tmp/micromamba/envs/surfExp/bin/poetry + echo $GITHUB_PATH poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) From be57d368d0b7fea0f0dd1862f8fecb7d56080972 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:49:21 +0100 Subject: [PATCH 21/42] Restructure workflows --- .github/workflows/linting.yaml | 4 ---- .github/workflows/tests.yml | 2 -- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 74c0eaa..94e0cbc 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -5,13 +5,9 @@ on: pull_request: branches: - master - paths: - - '**.py' push: branches: - '**' # Every branch - paths: - - '**.py' jobs: linting: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b571b03..741aef3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,8 +40,6 @@ jobs: - name: Set python run: | - ls -l /tmp/micromamba/envs/surfExp/bin/poetry - echo $GITHUB_PATH poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) From bb8e3eeccb400b17bd2fc8f3a035fd67fd900cf4 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 18:54:45 +0100 Subject: [PATCH 22/42] Restructure workflows --- .github/workflows/documentation.yaml | 83 ++++++++++++++++++++++++++++ .github/workflows/linting.yaml | 7 +-- 2 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/documentation.yaml diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 0000000..607e8db --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,83 @@ +#.github/workflows/documetnation.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 --only main,test + + - 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 }} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 94e0cbc..aa6d86a 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -16,15 +16,10 @@ jobs: 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' - uses: mamba-org/setup-micromamba@v2 with: From 27b0f9d59b98f6c8e9608944515516536ef47036 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 19:00:48 +0100 Subject: [PATCH 23/42] Restructure workflows --- .github/workflows/documentation.yaml | 14 +++++++------- .github/workflows/linting.yaml | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 607e8db..2218be7 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -1,4 +1,4 @@ -#.github/workflows/documetnation.yaml +#.github/workflows/documentation.yaml name: Create documentation on: @@ -50,16 +50,16 @@ jobs: - 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 main,test + run: | + poetry install --no-interaction --no-root --only main,test - name: Install the project itself - run: - - poetry install --no-interaction --only-root + run: | + poetry install --no-interaction --only-root - name: Create documentation - run: - - poetry run sphinx-build . docs/build/html + run: | + poetry run sphinx-build . docs/build/html - name: Commit documentation changes if: $(( github.repository_owner == 'metno' && github.event_name != 'pull_request' }} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index aa6d86a..6d81a31 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -9,6 +9,10 @@ on: branches: - '**' # Every branch +env: + USER: "github_runner" + HOME: "/tmp" + jobs: linting: name: Run Linters From 762015bc73a3030d46e6eaee443a2fc12226f769 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 19:07:36 +0100 Subject: [PATCH 24/42] Restructure workflows --- .github/workflows/documentation.yaml | 2 +- .github/workflows/linting.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 2218be7..28b8aef 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -62,7 +62,7 @@ jobs: poetry run sphinx-build . docs/build/html - name: Commit documentation changes - if: $(( github.repository_owner == 'metno' && github.event_name != 'pull_request' }} + 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/ diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 6d81a31..8fc13a6 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -41,12 +41,12 @@ jobs: 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: 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' From a5893722fbf4a4a4a362de5650ec4a4c6adead3f Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Fri, 23 Jan 2026 19:11:44 +0100 Subject: [PATCH 25/42] Restructure workflows --- .github/workflows/documentation.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 28b8aef..4709586 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -41,17 +41,17 @@ jobs: 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: 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 main,test + poetry install --no-interaction --no-root --all-extras - name: Install the project itself run: | From 85c1278f7aa62342335c5faf54f8f72f9c9bb265 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 12:26:04 +0100 Subject: [PATCH 26/42] Update pyproject.toml use master branch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e542169..74c4a38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "feature/prepare-tactus-package"} + tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "master"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From 95b914ecaf75109b477002928cf216085f9c0d36 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 12:27:58 +0100 Subject: [PATCH 27/42] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 74c4a38..bd4076d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "master"} + tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "develop"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From a3637cbd15dc1506ade1d34b0bc5f98a8c84d1b5 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 12:33:23 +0100 Subject: [PATCH 28/42] Update linting.yaml --- .github/workflows/linting.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 8fc13a6..ff1ea5e 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -51,11 +51,11 @@ jobs: - 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 + poetry install -vvv --no-interaction --no-root --only linting - name: Install the project itself run: | - poetry install --no-interaction --only-root + poetry install -vvv --no-interaction --only-root #---------------------------------------------- # Run the linting checks From 5f0dbfdaecba0f9821c78789907d85ba70c8fe6b Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 12:55:04 +0100 Subject: [PATCH 29/42] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bd4076d..7d59183 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - tactus = {git = "https://github.com/ACCORD-NWP/tactus", branch = "develop"} + tactus = {git = "https://github.com/ACCORD-NWP/tactus"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From 4310f835fb6b025581a2f10d701c4f3238177341 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 13:08:39 +0100 Subject: [PATCH 30/42] Update pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7d59183..52dbea2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,8 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - tactus = {git = "https://github.com/ACCORD-NWP/tactus"} + #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} + tactus = {git = "https://github.com/mfroelund/tactus" branch="feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From f6a782e69cd78ce0fca1c65fd8326bbe284b9f6e Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 13:09:47 +0100 Subject: [PATCH 31/42] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 52dbea2..f2ceb89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} - tactus = {git = "https://github.com/mfroelund/tactus" branch="feature/prepare-tactus-package"} + tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From fd3197e27f82b4121d56a509ee81314bd39edda4 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 5 Feb 2026 13:20:38 +0100 Subject: [PATCH 32/42] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f2ceb89..2b4084f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,8 +18,8 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} - tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} + tactus = {git = "https://github.com/ACCORD-NWP/tactus"} + #tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From 33fe598d43a45b4c304345e9ffbb17fbc57c22a2 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 12 Feb 2026 10:35:33 +0100 Subject: [PATCH 33/42] Use my fork as tactus --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2b4084f..7b729a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,8 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - tactus = {git = "https://github.com/ACCORD-NWP/tactus"} + #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} + tactus = {git = "https://github.com/trygveasp/tactus", branch="feature/tactus_installable_in_surfexp"} #tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] From ffe1d4163ee6a5313b98ec3d7498d7bbc2931967 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Thu, 12 Feb 2026 10:46:37 +0100 Subject: [PATCH 34/42] Linting --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7b729a7..6ecd442 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,7 @@ pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} - tactus = {git = "https://github.com/trygveasp/tactus", branch="feature/tactus_installable_in_surfexp"} - #tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} + tactus = {git = "https://github.com/trygveasp/tactus", branch = "feature/tactus_installable_in_surfexp"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From fa7e3ba6f0a4ab3caa939239ffc4da96e884eeee Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 08:32:51 +0100 Subject: [PATCH 35/42] Test with Martins branch again --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ecd442..a6cec79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,8 @@ pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} - tactus = {git = "https://github.com/trygveasp/tactus", branch = "feature/tactus_installable_in_surfexp"} + #tactus = {git = "https://github.com/trygveasp/tactus", branch = "feature/tactus_installable_in_surfexp"} + tactus = {git = "https://github.com/mfroelund", branch="feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From 0c72d25feae7315a3754e28b411746d784ff5f63 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 08:35:16 +0100 Subject: [PATCH 36/42] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a6cec79..4c74f6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ python = ">=3.10,<3.13" #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} #tactus = {git = "https://github.com/trygveasp/tactus", branch = "feature/tactus_installable_in_surfexp"} - tactus = {git = "https://github.com/mfroelund", branch="feature/prepare-tactus-package"} + tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From 6e710b8be45cde5116dae51fe00c7b636e303d23 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 08:37:43 +0100 Subject: [PATCH 37/42] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4c74f6a..451ba07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ poethepoet = {extras = ["poetry-plugin"], version = "^0.34.0"} pydoclint = "^0.3.8" # Replaces darglint, but is maintained & faster ruff = "^0.14.11" - toml-formatter = {git = "https://github.com/paulovcmedeiros/toml-formatter"} + #toml-formatter = {git = "https://github.com/paulovcmedeiros/toml-formatter"} [tool.poetry.group.test.dependencies] pytest = "^7.2.2" From 061ea5d7b39650cf19e3a940ea85bc3b4756cfc6 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 08:41:22 +0100 Subject: [PATCH 38/42] Use ACCORD toml-formatter --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 451ba07..a190c8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ poethepoet = {extras = ["poetry-plugin"], version = "^0.34.0"} pydoclint = "^0.3.8" # Replaces darglint, but is maintained & faster ruff = "^0.14.11" - #toml-formatter = {git = "https://github.com/paulovcmedeiros/toml-formatter"} + toml-formatter = {git = "https://github.com/ACCORD-NWP/toml-formatter.git"} [tool.poetry.group.test.dependencies] pytest = "^7.2.2" From 871266ef2a03412e53fe00b63ebcde97cfcf1761 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 09:21:27 +0100 Subject: [PATCH 39/42] Adapt to tactus branch where deode stuff has been renamed --- README.rst | 4 ++-- docs/example.rst | 4 ++-- pyproject.toml | 2 +- .../include/platform_paths/ppi_rhel8_a1.toml | 2 +- .../include/platform_paths/ppi_rhel8_b1.toml | 2 +- .../include/scheduler/ecflow_atos_bologna.toml | 2 +- .../include/scheduler/ecflow_ppi_rhel8_a1.toml | 2 +- .../include/scheduler/ecflow_ppi_rhel8_b1.toml | 2 +- surfexp/tasks/forcing.py | 4 ++-- surfexp/tasks/gmtedsoil.py | 6 +++--- surfexp/tasks/surfex_binary_task.py | 4 ++-- surfexp/tasks/tasks.py | 6 +++--- surfexp/templates/cli.py | 4 ++-- surfexp/templates/ecflow/default.py | 4 ++-- surfexp/templates/ecflow/requeue.py | 4 ++-- surfexp/templates/stand_alone.py | 10 +++++----- tests/conftest.py | 18 +++++++++--------- tests/smoke/test_templates_cli.py | 4 ++-- 18 files changed, 42 insertions(+), 42 deletions(-) diff --git a/README.rst b/README.rst index 557b348..12074ad 100644 --- a/README.rst +++ b/README.rst @@ -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). @@ -164,7 +164,7 @@ 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) tactus start suite --config-file exps/LDAS.toml diff --git a/docs/example.rst b/docs/example.rst index f031854..2e538a5 100644 --- a/docs/example.rst +++ b/docs/example.rst @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a190c8a..5d770ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ python = ">=3.10,<3.13" #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} #tactus = {git = "https://github.com/trygveasp/tactus", branch = "feature/tactus_installable_in_surfexp"} - tactus = {git = "https://github.com/mfroelund/tactus", branch="feature/prepare-tactus-package"} + tactus = {git = "https://github.com/mfroelund/tactus", branch = "feature/prepare-tactus-package"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" diff --git a/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml b/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml index e2407c9..e28fd7f 100644 --- a/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml +++ b/surfexp/data/config/include/platform_paths/ppi_rhel8_a1.toml @@ -6,7 +6,6 @@ archive_root = "@SCRATCH@/@CASE@/archive" archive_type = "ecfs" climdata = "@STATIC_DATA@/climate" - deode_home = "set-by-the-system" e923_data = "@STATIC_DATA@/climate/E923_DATA" ecoclim_data_path = "@CLIMDATA@/ecoclimap" ecoclimap_bin_dir = "@ecoclim_data_path@" @@ -25,6 +24,7 @@ scratch = "/lustre/storeA/users/@USER@/ecflowdata/work/" soilgrid_data_path = "@CLIMDATA@/soilgrid" static_data = "/lustre/storeA/project/nwp/H2O/" + tactus_home = "set-by-the-system" task_name = "@STAND_ALONE_TASK_NAME@" tree_height_dir = "@CLIMDATA@/ECOCLIMAP-SG/V0/HT" unix_group = "suv" diff --git a/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml b/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml index 4936460..056dca8 100644 --- a/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml +++ b/surfexp/data/config/include/platform_paths/ppi_rhel8_b1.toml @@ -6,7 +6,6 @@ archive_root = "@SCRATCH@/@CASE@/archive" archive_type = "ecfs" climdata = "@STATIC_DATA@/climate" - deode_home = "set-by-the-system" e923_data = "@STATIC_DATA@/climate/E923_DATA" ecoclim_data_path = "@CLIMDATA@/ecoclimap" ecoclimap_bin_dir = "@ecoclim_data_path@" @@ -25,6 +24,7 @@ scratch = "/lustre/storeB/users/@USER@/tactus" soilgrid_data_path = "@CLIMDATA@/soilgrid" static_data = "/lustre/storeB/project/nwp/H2O/" + tactus_home = "set-by-the-system" task_name = "@STAND_ALONE_TASK_NAME@" tree_height_dir = "@CLIMDATA@/ECOCLIMAP-SG/V0/HT" unix_group = "suv" diff --git a/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml b/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml index 50bed7c..1e7c211 100644 --- a/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml +++ b/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml @@ -2,7 +2,6 @@ [scheduler.ecfvars] case_prefix = "" - ecf_deode_home = "strip_off_mount_path('@DEODE_HOME@',)" ecf_files = "@HOME@/tactus_ecflow/ecf_files" ecf_files_remotely = "@HOME@/tactus_ecflow/ecf_files" ecf_home = "@HOME@/tactus_ecflow/jobout" @@ -11,6 +10,7 @@ ecf_out = "@HOME@/tactus_ecflow/jobout" ecf_port = 3141 ecf_ssl = "0" + ecf_tactus_home = "strip_off_mount_path('@TACTUS_HOME@',)" [scheduler.ecfvars.troika] config_file = "@PLUGIN_HOME@/surfexp/data/config/troika/troika_config.yml" diff --git a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml index cc7babb..8549a01 100644 --- a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml +++ b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_a1.toml @@ -2,7 +2,6 @@ [scheduler.ecfvars] case_prefix = "" - ecf_deode_home = "@DEODE_HOME@" ecf_files = "@HOME@/tactus_ecflow/ecf_files" ecf_files_remotely = "@HOME@/tactus_ecflow/ecf_files" ecf_home = "@HOME@/tactus_ecflow/jobout" @@ -10,6 +9,7 @@ ecf_jobout = "@HOME@/tactus_ecflow/jobout" ecf_out = "@HOME@/tactus_ecflow/jobout" ecf_ssl = "1" + ecf_tactus_home = "@TACTUS_HOME@" [scheduler.ecfvars.troika] config_file = "@PLUGIN_HOME@/surfexp/data/config/troika/troika_config.yml" diff --git a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml index 613fd2e..d4cee81 100644 --- a/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml +++ b/surfexp/data/config/include/scheduler/ecflow_ppi_rhel8_b1.toml @@ -2,7 +2,6 @@ [scheduler.ecfvars] case_prefix = "" - ecf_deode_home = "@DEODE_HOME@" ecf_files = "@HOME@/tactus_ecflow/ecf_files" ecf_files_remotely = "@HOME@/tactus_ecflow/ecf_files" ecf_home = "@HOME@/tactus_ecflow/jobout" @@ -10,6 +9,7 @@ ecf_jobout = "@HOME@/tactus_ecflow/jobout" ecf_out = "@HOME@/tactus_ecflow/jobout" ecf_ssl = "1" + ecf_tactus_home = "@TACTUS_HOME@" [scheduler.ecfvars.troika] config_file = "@PLUGIN_HOME@/surfexp/data/config/troika/troika_config.yml" diff --git a/surfexp/tasks/forcing.py b/surfexp/tasks/forcing.py index 0757e62..0040255 100644 --- a/surfexp/tasks/forcing.py +++ b/surfexp/tasks/forcing.py @@ -6,7 +6,7 @@ from pysurfex.verification import concat_datasets, converter2ds from tactus.datetime_utils import as_timedelta from tactus.logs import logger -from tactus.os_utils import deodemakedirs +from tactus.os_utils import tactusmakedirs from surfexp.tasks.tasks import PySurfexBaseTask @@ -63,7 +63,7 @@ def execute(self): self.exp_file_paths.system_file_paths.update( {"default_forcing_dir": default_forcing_dir} ) - deodemakedirs(forcing_dir) + tactusmakedirs(forcing_dir) cforcing_filetype = self.soda_settings.get_setting( "NAM_IO_OFFLINE#CFORCING_FILETYPE" diff --git a/surfexp/tasks/gmtedsoil.py b/surfexp/tasks/gmtedsoil.py index bb53874..30eb14d 100644 --- a/surfexp/tasks/gmtedsoil.py +++ b/surfexp/tasks/gmtedsoil.py @@ -7,7 +7,7 @@ import netCDF4 from tactus.geo_utils import Projection, Projstring from tactus.logs import logger -from tactus.os_utils import Search, deodemakedirs +from tactus.os_utils import Search, tactusmakedirs from tactus.tasks.base import Task try: @@ -237,7 +237,7 @@ def execute(self): """ climdir = self.platform.get_system_value("climdir") unix_group = self.platform.get_platform_value("unix_group") - deodemakedirs(climdir, unixgroup=unix_group) + tactusmakedirs(climdir, unixgroup=unix_group) projstr = Projstring().get_projstring( lon0=self.domain["lon0"], lat0=self.domain["lat0"] @@ -498,7 +498,7 @@ def execute(self): climdir = self.platform.get_system_value("climdir") unix_group = self.platform.get_platform_value("unix_group") - deodemakedirs(climdir, unixgroup=unix_group) + tactusmakedirs(climdir, unixgroup=unix_group) for subarea_file in soilgrid_tif_subarea_files: fact = 10 diff --git a/surfexp/tasks/surfex_binary_task.py b/surfexp/tasks/surfex_binary_task.py index 6a85844..d4167e5 100644 --- a/surfexp/tasks/surfex_binary_task.py +++ b/surfexp/tasks/surfex_binary_task.py @@ -5,7 +5,7 @@ from tactus.datetime_utils import as_datetime, as_timedelta, get_decade from tactus.logs import logger from tactus.namelist import NamelistGenerator -from tactus.os_utils import deodemakedirs +from tactus.os_utils import tactusmakedirs from surfexp.experiment import SettingsFromNamelistAndConfig, check_consistency from surfexp.tasks.tasks import PySurfexBaseTask @@ -148,7 +148,7 @@ def execute(self): output = f"{self.archive}/ICMSH{cnmexp}INIT.sfx" binary = self.get_binary("PREP") - deodemakedirs(self.archive) + tactusmakedirs(self.archive) nml_file = "OPTIONS_input.nam" settings = SettingsFromNamelistAndConfig(self.mode, self.config) diff --git a/surfexp/tasks/tasks.py b/surfexp/tasks/tasks.py index f210041..81126c8 100644 --- a/surfexp/tasks/tasks.py +++ b/surfexp/tasks/tasks.py @@ -20,7 +20,7 @@ from tactus.datetime_utils import as_datetime, as_timedelta, get_decade from tactus.logs import InterceptHandler, logger from tactus.logs import builtin_logging as logging -from tactus.os_utils import deodemakedirs +from tactus.os_utils import tactusmakedirs from tactus.tasks.base import Task from surfexp.experiment import SettingsFromNamelistAndConfig @@ -61,7 +61,7 @@ def __init__(self, config, name): self.geo = ConfProj(conf_proj) self.climdir = self.platform.get_system_value("climdir") - deodemakedirs(self.climdir) + tactusmakedirs(self.climdir) domain_json = self.geo.json domain_json.update({"nam_pgd_grid": {"cgrid": "CONF PROJ"}}) self.domain_file = f"{self.climdir}/domain.json" @@ -1001,7 +1001,7 @@ def execute(self): symlink_files = {} archive = self.config["system.archive_dir"] archive = self.platform.substitute(archive, basetime=self.validtime) - deodemakedirs(archive) + tactusmakedirs(archive) if self.var_name in self.translation: var = self.translation[self.var_name] diff --git a/surfexp/templates/cli.py b/surfexp/templates/cli.py index 69de095..a3ad1de 100644 --- a/surfexp/templates/cli.py +++ b/surfexp/templates/cli.py @@ -27,7 +27,7 @@ def execute_task(argv=None): elif template == "stand_alone": task_name = kwargs["STAND_ALONE_TASK_NAME"] config = kwargs["STAND_ALONE_TASK_CONFIG"] - deode_home = kwargs["STAND_ALONE_DEODE_HOME"] - stand_alone_main(task_name, config, deode_home) + tactus_home = kwargs["STAND_ALONE_TACTUS_HOME"] + stand_alone_main(task_name, config, tactus_home) else: raise NotImplementedError diff --git a/surfexp/templates/ecflow/default.py b/surfexp/templates/ecflow/default.py index bdbf90f..7ce44f6 100644 --- a/surfexp/templates/ecflow/default.py +++ b/surfexp/templates/ecflow/default.py @@ -28,7 +28,7 @@ def parse_ecflow_vars(): "ARGS": os.environ["ARGS"], "WRAPPER": os.environ["WRAPPER"], "CONFIG": os.environ["CONFIG"], - "DEODE_HOME": os.environ["DEODE_HOME"], + "TACTUS_HOME": os.environ["TACTUS_HOME"], } @@ -70,7 +70,7 @@ def default_main(**kwargs): }, "loglevel": loglevel, }, - "platform": {"deode_home": kwargs.get("DEODE_HOME")}, + "platform": {"tactus_home": kwargs.get("TACTUS_HOME")}, } ) diff --git a/surfexp/templates/ecflow/requeue.py b/surfexp/templates/ecflow/requeue.py index 6c0bcc2..4ac504e 100644 --- a/surfexp/templates/ecflow/requeue.py +++ b/surfexp/templates/ecflow/requeue.py @@ -28,7 +28,7 @@ def parse_ecflow_vars(): "ARGS": os.environ["ARGS"], "WRAPPER": os.environ["WRAPPER"], "CONFIG": os.environ["CONFIG"], - "DEODE_HOME": os.environ["DEODE_HOME"], + "TACTUS_HOME": os.environ["TACTUS_HOME"], } @@ -70,7 +70,7 @@ def default_main(**kwargs): }, "loglevel": loglevel, }, - "platform": {"deode_home": kwargs.get("DEODE_HOME")}, + "platform": {"tactus_home": kwargs.get("TACTUS_HOME")}, } ) diff --git a/surfexp/templates/stand_alone.py b/surfexp/templates/stand_alone.py index 46405e7..5b79caa 100644 --- a/surfexp/templates/stand_alone.py +++ b/surfexp/templates/stand_alone.py @@ -11,19 +11,19 @@ logger.enable("tactus") -def stand_alone_main(task, config, deode_home): +def stand_alone_main(task, config, tactus_home): """Execute default main. Args: task (str): Task name config (str): Config file - deode_home(str): Tactus home path + tactus_home(str): Tactus home path """ config = ParsedConfig.from_file( config, json_schema=ConfigParserDefaults.MAIN_CONFIG_JSON_SCHEMA ) config = config.copy(update=set_times(config)) - config = config.copy(update={"platform": {"deode_home": deode_home}}) + config = config.copy(update={"platform": {"tactus_home": tactus_home}}) task_settings = TaskSettings(config).get_task_settings(task) processor_layout = ProcessorLayout(task_settings) @@ -38,5 +38,5 @@ def stand_alone_main(task, config, deode_home): if __name__ == "__main__": TASK_NAME = os.environ["STAND_ALONE_TASK_NAME"] CONFIG = os.environ["STAND_ALONE_TASK_CONFIG"] - DEODE_HOME = os.environ["STAND_ALONE_DEODE_HOME"] - stand_alone_main(TASK_NAME, CONFIG, DEODE_HOME) + TACTUS_HOME = os.environ["STAND_ALONE_TACTUS_HOME"] + stand_alone_main(TASK_NAME, CONFIG, TACTUS_HOME) diff --git a/tests/conftest.py b/tests/conftest.py index 4d81287..43567c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,7 +29,7 @@ def tmp_directory(tmp_path_factory): @pytest.fixture(scope="module") def test_arch(): my_host = "my_dummy_host" - os.environ["DEODE_HOST"] = my_host + os.environ["TACTUS_HOST"] = my_host return my_host @@ -50,16 +50,16 @@ def dummy_include_files(test_arch, module_initfile, scratch_dir): "scheduler": { "ecfvars": { "case_prefix": "", - "ecf_deode_home": "strip_off_mount_path('@DEODE_HOME@',)", - "ecf_files": "@HOME@/deode_ecflow/ecf_files", - "ecf_files_remotely": "@HOME@/deode_ecflow/ecf_files", - "ecf_home": "@HOME@/deode_ecflow/jobout", + "ecf_tactus_home": "strip_off_mount_path('@TACTUS_HOME@',)", + "ecf_files": "@HOME@/tactus_ecflow/ecf_files", + "ecf_files_remotely": "@HOME@/tactus_ecflow/ecf_files", + "ecf_home": "@HOME@/tactus_ecflow/jobout", "ecf_host": "pc5709", - "ecf_jobout": "@HOME@/deode_ecflow/jobout", - "ecf_out": "@HOME@/deode_ecflow/jobout", + "ecf_jobout": "@HOME@/tactus_ecflow/jobout", + "ecf_out": "@HOME@/tactus_ecflow/jobout", "ecf_port": 44855, "troika": { - "config_file": "@ECF_DEODE_HOME@/data/config_files/troika.yml" + "config_file": "@ECF_TACTUS_HOME@/data/config_files/troika.yml" }, } } @@ -105,7 +105,7 @@ def dummy_include_files(test_arch, module_initfile, scratch_dir): "albvis_veg_dir": "@CLIMDATA@/ECOCLIMAP-SG/V0/ALB_SAT", "archive_type": "ecfs", "climdata": "@STATIC_DATA@/climate", - "deode_home": "set-by-the-system", + "tactus_home": "set-by-the-system", "e923_data": "@STATIC_DATA@/climate/E923_DATA", "ecoclim_data_path": "@CLIMDATA@/ecoclimap", "ecoclimap_bin_dir": "@ecoclim_data_path@", diff --git a/tests/smoke/test_templates_cli.py b/tests/smoke/test_templates_cli.py index 2952d8b..34ff49c 100644 --- a/tests/smoke/test_templates_cli.py +++ b/tests/smoke/test_templates_cli.py @@ -30,7 +30,7 @@ def fixture_template_args_ecflow(tmp_directory, default_config_file): "ARGS": "arg1=val1;", "WRAPPER": "time", "CONFIG": default_config_file, - "DEODE_HOME": "DEODE_HOME", + "TACTUS_HOME": "TACTUS_HOME", } with open(fname, mode="w", encoding="utf8") as fhandler: json.dump(data, fhandler) @@ -54,7 +54,7 @@ def fixture_template_args_stand_alone(tmp_directory, default_config_file): "ARGS": "arg1=val1;", "WRAPPER": "time", "STAND_ALONE_TASK_CONFIG": default_config_file, - "STAND_ALONE_DEODE_HOME": "DEODE_HOME", + "STAND_ALONE_TACTUS_HOME": "TACTUS_HOME", "STAND_ALONE_TASK_NAME": "task_name", } with open(fname, mode="w", encoding="utf8") as fhandler: From 09c3b4c672a497dccdffdec74f451379e8ba9319 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 09:24:48 +0100 Subject: [PATCH 40/42] Add forgotten file --- tests/unit/test_tasks.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/unit/test_tasks.py b/tests/unit/test_tasks.py index 793718c..2d36efd 100644 --- a/tests/unit/test_tasks.py +++ b/tests/unit/test_tasks.py @@ -6,7 +6,7 @@ import pytest from tactus.logs import logger -from tactus.os_utils import deodemakedirs +from tactus.os_utils import tactusmakedirs from tactus.tasks.base import Task from tactus.tasks.discover_task import discover, get_task @@ -73,13 +73,13 @@ def create_binaries(casedir, task_name, task_config): args = {"task": {"args": {"pert": "1"}}} task_config = task_config.copy(args) archive = f"{casedir}/archive/2025/02/08/21/" - deodemakedirs(archive) + tactusmakedirs(archive) os.system(f"touch {archive}/ANALYSIS.nc") # noqa S605 else: forcing_dir = f"{casedir}/forcing/2025020900/" diag_output = "SURFOUT.20250209_03h00.nc" archive = f"{casedir}/archive/2025/02/09/00/" - deodemakedirs(archive) + tactusmakedirs(archive) os.system(f"touch {archive}/PREP.nc") # noqa S605 binary = f"{bindir}/OFFLINE" with open(binary, mode="w", encoding="utf8") as fhandler: @@ -87,7 +87,7 @@ def create_binaries(casedir, task_name, task_config): fhandler.write("touch SURFOUT.nc\n") fhandler.write(f"touch {diag_output}\n") os.chmod(binary, 0o0700) - deodemakedirs(forcing_dir) + tactusmakedirs(forcing_dir) os.system(f"touch {forcing_dir}/FORCING.nc") # noqa S605 elif task_name.lower() == "offlinepgd": binary = f"{bindir}/PGD" @@ -117,12 +117,12 @@ def create_binaries(casedir, task_name, task_config): os.chmod(binary, 0o0700) obdir = f"{casedir}/archive/observations/2025/02/09/00/" - deodemakedirs(obdir) + tactusmakedirs(obdir) fg_dir = f"{casedir}/archive/2025/02/08/21/" - deodemakedirs(fg_dir) + tactusmakedirs(fg_dir) archive = f"{casedir}/archive/2025/02/09/00/" - deodemakedirs(archive) - deodemakedirs(f"{casedir}/20250209_0000/") + tactusmakedirs(archive) + tactusmakedirs(f"{casedir}/20250209_0000/") os.system(f"touch {fg_dir}/SURFOUT.nc") # noqa S605 os.system(f"touch {obdir}/OBSERVATIONS_250209H00.DAT") # noqa S605 os.system(f"touch {archive}/SURFOUT_PERT0.nc") # noqa S605 @@ -134,10 +134,10 @@ def create_binaries(casedir, task_name, task_config): raise NotImplementedError if need_pgd: climdir = f"{casedir}/climate/DRAMMEN/" - deodemakedirs(climdir) + tactusmakedirs(climdir) os.system(f"touch {climdir}/PGD_0215.nc") # noqa S605 if need_prep: - deodemakedirs(f"{casedir}/20250209_0000/") + tactusmakedirs(f"{casedir}/20250209_0000/") os.system(f"touch {casedir}/20250209_0000/fc_start_sfx") # noqa S605 return task_config @@ -194,14 +194,13 @@ def fixture_task_name_and_configs(request, default_config, tmp_directory): task_config = task_config.copy(update) elif task_name.lower() == "cmakebuild": builddir = f"{casedir}/offline/build/bin/" - deodemakedirs(builddir) + tactusmakedirs(builddir) programs = ["PGD-offline", "PREP-offline", "OFFLINE-offline", "SODA-offline"] for program in programs: os.system(f"touch {builddir}/{program}") # noqa S605 - # /tmp/pytest-of-trygveasp/pytest-10/deode/cmakebuild/offline/build/bin/PGD-offline elif task_name.lower() == "soil": soilgrid_data_path = f"{casedir}/SOILGRID" - deodemakedirs(soilgrid_data_path) + tactusmakedirs(soilgrid_data_path) update = {"platform": {"soilgrid_data_path": soilgrid_data_path}} task_config = task_config.copy(update) os.system(f"touch {soilgrid_data_path}/CLYPPT.tif") # noqa S605 @@ -210,14 +209,14 @@ def fixture_task_name_and_configs(request, default_config, tmp_directory): os.system(f"touch {soilgrid_data_path}/SOC_SUB") # noqa S605 elif task_name.lower() == "gmted": gmted2010_data_path = f"{casedir}/GMTED" - deodemakedirs(gmted2010_data_path) + tactusmakedirs(gmted2010_data_path) update = {"platform": {"gmted2010_data_path": gmted2010_data_path}} task_config = task_config.copy(update) os.system( # noqa S605 f"touch {gmted2010_data_path}/50N000E_20101117_gmted_mea075.tif" ) elif task_name.lower() == "fetchmars": - deodemakedirs(f"{casedir}/grib/default") + tactusmakedirs(f"{casedir}/grib/default") os.system( # noqa S605 f"touch {casedir}/grib/default/sfx_hres_20250209_0000.grib1" ) @@ -227,7 +226,7 @@ def fixture_task_name_and_configs(request, default_config, tmp_directory): ) elif task_name.lower() == "firstguess4oi": archive = f"{casedir}/archive/2025/02/09/00/" - deodemakedirs(archive) + tactusmakedirs(archive) os.system(f"touch {archive}/raw.nc") # noqa S605 update = {"task": {"args": {"mode": "analysis"}}} task_config = task_config.copy(update) From 22b6d66514cb9eca5a16eb056c7cc5425b3abf3a Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 10:52:32 +0100 Subject: [PATCH 41/42] Use ACCORD default branch --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5d770ec..d85e272 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,9 +18,7 @@ [tool.poetry.dependencies] pysurfex = {git = "https://github.com/metno/pysurfex.git", develop = false, branch = "0.1.2", extras = ["points", "netcdf", "plot", "verification"]} python = ">=3.10,<3.13" - #tactus = {git = "https://github.com/ACCORD-NWP/tactus"} - #tactus = {git = "https://github.com/trygveasp/tactus", branch = "feature/tactus_installable_in_surfexp"} - tactus = {git = "https://github.com/mfroelund/tactus", branch = "feature/prepare-tactus-package"} + tactus = {git = "https://github.com/ACCORD-NWP/tactus"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" From fb87ab322bbfeaebd1975a5f48516c9a83f97a00 Mon Sep 17 00:00:00 2001 From: Trygve Aspelien Date: Wed, 18 Feb 2026 11:01:48 +0100 Subject: [PATCH 42/42] Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d85e272..ac9511c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ license = "Apache-2.0" name = "surfexp" readme = "README.rst" - version = "0.4.1" + version = "0.4.2" [tool.poetry.scripts] execute_task = "surfexp.templates.cli:execute_task"