diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 0000000..4709586 --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,83 @@ +#.github/workflows/documentation.yaml +name: Create documentation + +on: + pull_request: + branches: + - master + push: + branches: + - '**' # Every branch + +env: + USER: "github_runner" + HOME: "/tmp" + +jobs: + tests: + name: "Create documentation" + runs-on: "ubuntu-latest" + + steps: + #---------------------------------------------- + # check-out repo + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v4 + + - uses: mamba-org/setup-micromamba@v2 + with: + environment-file: environment.yml + init-shell: >- + bash + cache-environment: true + post-cleanup: 'all' + + - name: Set PATH + run: | + echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH + + - name: Set python + run: | + poetry env use /tmp/micromamba/envs/surfExp/bin/python + + #- name: Load cached venv (if cache exists) + # id: cached-poetry-dependencies + # uses: actions/cache@v4 + # with: + # path: .venv + # key: venv-${{ hashFiles('pyproject.toml') }} + + - name: Install dependencies (if venv cache is not found) + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: | + poetry install --no-interaction --no-root --all-extras + + - name: Install the project itself + run: | + poetry install --no-interaction --only-root + + - name: Create documentation + run: | + poetry run sphinx-build . docs/build/html + + - name: Commit documentation changes + if: ${{ github.repository_owner == 'metno' && github.event_name != 'pull_request' }} + run: | + git clone https://github.com/metno/surfExp.git --branch gh-pages --single-branch gh-pages + cp -r docs/build/html/* gh-pages/ + cd gh-pages + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Update documentation" -a || true + # The above command will fail if no changes were present, so we ignore + # the return code. + + - name: Push changes + if: ${{ github.repository_owner == 'metno' && github.event_name != 'pull_request' }} + uses: ad-m/github-push-action@master + with: + branch: gh-pages + directory: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 8e42a8c..ff1ea5e 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -5,66 +5,61 @@ on: pull_request: branches: - master - - develop - paths: - - '**.py' push: branches: - '**' # Every branch - paths: - - '**.py' + +env: + USER: "github_runner" + HOME: "/tmp" jobs: linting: - if: github.repository_owner == 'destination-earth-digital-twins' name: Run Linters runs-on: ubuntu-latest - environment: staging + steps: #---------------------------------------------- - # check-out repo and set-up python + # check-out repo #---------------------------------------------- - name: Check out repository uses: actions/checkout@v4 - - name: Set up python - id: setup-python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - #---------------------------------------------- - # --- configure poetry & install project ---- - #---------------------------------------------- - - name: Install Poetry - uses: snok/install-poetry@v1 + - uses: mamba-org/setup-micromamba@v2 with: - virtualenvs-create: true - virtualenvs-in-project: true + environment-file: environment.yml + init-shell: >- + bash + cache-environment: true + post-cleanup: 'all' - - name: Load cached venv (if cache exists) - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }} + - name: Set PATH + run: | + echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH + + - name: Set python + run: | + poetry env use /tmp/micromamba/envs/surfExp/bin/python + + #- name: Load cached venv (if cache exists) + # id: cached-poetry-dependencies + # uses: actions/cache@v4 + # with: + # path: .venv + # key: venv-${{ hashFiles('pyproject.toml') }} - name: Install dependencies (if venv cache is not found) if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root --only linting + run: | + poetry install -vvv --no-interaction --no-root --only linting - name: Install the project itself - run: poetry install --no-interaction --only-root + run: | + poetry install -vvv --no-interaction --only-root #---------------------------------------------- # Run the linting checks #---------------------------------------------- - - name: isort - run: | - poetry run isort --check-only . - - name: black - run: | - poetry run black --check --diff . - - name: flakeheaven + - name: Linting run: | - export FLAKEHEAVEN_CACHE="${TMPDIR:-${TEMP:-${TMP:-/tmp}}}/flakeheaven_cache.$(openssl rand -hex 12)" - poetry run flakeheaven lint . + poetry run poetry devtools lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0022fa3..741aef3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,21 +15,9 @@ env: jobs: tests: - if: github.repository_owner == 'destination-earth-digital-twins' - strategy: - fail-fast: true - matrix: - os: [ "ubuntu-latest" ] - env: [ "pytest" ] - python-version: [ "3.11" ] - name: "${{ matrix.os }}, python=${{ matrix.python-version }}" - runs-on: ${{ matrix.os }} - - container: - image: python:${{ matrix.python-version }}-bullseye - env: - COVERAGE_FILE: ".coverage.${{ matrix.env }}.${{ matrix.python-version }}" + name: "Install and test surfExp" + runs-on: "ubuntu-latest" steps: #---------------------------------------------- @@ -46,42 +34,29 @@ jobs: cache-environment: true post-cleanup: 'all' - #---------------------------------------------- - # --- configure poetry & install project ---- - #---------------------------------------------- - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true + - name: Set PATH + run: | + echo "/tmp/micromamba/envs/surfExp/bin" >> $GITHUB_PATH + + - name: Set python + run: | + poetry env use /tmp/micromamba/envs/surfExp/bin/python - name: Load cached venv (if cache exists) id: cached-poetry-dependencies uses: actions/cache@v4 with: path: .venv - key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} + key: venv-${{ hashFiles('pyproject.toml') }} - - name: Modify pyproject.toml - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: | - #export GITHUB_TOKEN=${{ secrets.GH_REPO_READ_TOKEN }} - #export GITHUB_TOKEN="trygve" - sed -i "s#https://github.com/destination-earth-digital-twins/Deode-Workflow#https://${GITHUB_TOKEN}@github.com/destination-earth-digital-twins/Deode-Workflow#g" pyproject.toml - - name: Install dependencies (if venv cache is not found) if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: | - cat pyproject.toml poetry install --no-interaction --no-root --only main,test - shell: micromamba-shell {0} - + - name: Install the project itself run: | - # poetry config http-basic.deode x-token-auth ${{secrets.DEODE_WORKFLOW_ACCESS}} poetry install --no-interaction --only-root - shell: micromamba-shell {0} #---------------------------------------------- # run test suite and report coverage @@ -89,45 +64,3 @@ 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 }} diff --git a/README.rst b/README.rst index efe322d..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). @@ -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 @@ -164,10 +164,10 @@ Extra environment on PPI-RHEL8 needed to start experiments export ECF_SSL=1 # Set HOST - export DEODE_HOST="ppi_rhel8_b1" + export TACTUS_HOST="ppi_rhel8_b1" # Start suite (modify dates) - deode start suite --config-file exps/LDAS.toml + tactus start suite --config-file exps/LDAS.toml # MET-Norway LDAS single decade surfExp -o exps/LDAS_decade.toml --case-name LDAS_decade \ @@ -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..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 @@ -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..ac9511c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,10 +2,10 @@ 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" + version = "0.4.2" [tool.poetry.scripts] execute_task = "surfexp.templates.cli:execute_task" @@ -16,9 +16,9 @@ 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"]} + 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"} [tool.poetry.group.doc.dependencies] coveralls = "^3.3.1" @@ -27,11 +27,10 @@ [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" - toml-formatter = {git = "https://github.com/paulovcmedeiros/toml-formatter"} + ruff = "^0.14.11" + toml-formatter = {git = "https://github.com/ACCORD-NWP/toml-formatter.git"} [tool.poetry.group.test.dependencies] pytest = "^7.2.2" @@ -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 @@ -192,7 +186,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" @@ -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 d74353f..480f257 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.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/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..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" @@ -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..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,14 +6,13 @@ 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@" 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" @@ -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 8d6a4de..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,14 +6,13 @@ 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@" 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,9 +21,10 @@ 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/" + 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 a9401ad..1e7c211 100644 --- a/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml +++ b/surfexp/data/config/include/scheduler/ecflow_atos_bologna.toml @@ -2,15 +2,15 @@ [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" + 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 6e0e56b..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,14 +2,14 @@ [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" + 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 69c9ff4..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,14 +2,14 @@ [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" + 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/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..8a966cd 100644 --- a/surfexp/data/surfexp.toml +++ b/surfexp/data/surfexp.toml @@ -26,8 +26,11 @@ build_config = "" ial_source = "" +[extractsqlite] + station_list = "" + [offline] - deode = false + tactus = false tolerate_missing = false [pgd] @@ -42,11 +45,14 @@ zs_input = "gmted2010" [prep] - deode = false + tactus = false tolerate_missing = false +[prep.args] + prep-file = "" + [soda] - deode = false + tactus = false tolerate_missing = false [suite_control] diff --git a/surfexp/experiment.py b/surfexp/experiment.py index e668096..55d153c 100644 --- a/surfexp/experiment.py +++ b/surfexp/experiment.py @@ -1,9 +1,9 @@ """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 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 class SettingsFromNamelist: @@ -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..548a77a 100644 --- a/surfexp/suites/offline.py +++ b/surfexp/suites/offline.py @@ -2,9 +2,11 @@ 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 ( +# 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 ( EcflowSuiteFamily, EcflowSuiteTask, EcflowSuiteTrigger, @@ -12,9 +14,6 @@ SuiteDefinition, ) -# TODO should be moved to deode.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 a8b3c6e..1846c57 100644 --- a/surfexp/tasks/compilation.py +++ b/surfexp/tasks/compilation.py @@ -2,8 +2,8 @@ import os import shutil -from deode.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 ddaf3cc..66551a8 100644 --- a/surfexp/tasks/fetch_mars.py +++ b/surfexp/tasks/fetch_mars.py @@ -3,9 +3,9 @@ import os import shutil -from deode.datetime_utils import as_timedelta -from deode.logs import logger from pysurfex.run import BatchJob +from tactus.datetime_utils import as_timedelta +from tactus.logs import logger 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 c2c2852..0040255 100644 --- a/surfexp/tasks/forcing.py +++ b/surfexp/tasks/forcing.py @@ -2,11 +2,11 @@ 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 pysurfex.cli import create_forcing, cli_modify_forcing +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 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" @@ -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/gmtedsoil.py b/surfexp/tasks/gmtedsoil.py index cf1465d..30eb14d 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, tactusmakedirs +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: @@ -236,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"] @@ -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: ------- @@ -497,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 388b2b5..d4167e5 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 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 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 tactusmakedirs from surfexp.experiment import SettingsFromNamelistAndConfig, check_consistency from surfexp.tasks.tasks import PySurfexBaseTask @@ -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__) @@ -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 41f3e65..81126c8 100644 --- a/surfexp/tasks/tasks.py +++ b/surfexp/tasks/tasks.py @@ -5,11 +5,6 @@ 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 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 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" @@ -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("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("PT0H") + self.validtime = self.basetime - fcint + as_timedelta(f"{self.offset:02d}:00:00") def execute(self): """Execute.""" @@ -994,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 dc95ab7..7ce44f6 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 +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("deode") +logger.enable("tactus") def parse_ecflow_vars(): @@ -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 5d62e7c..4ac504e 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 +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("deode") +logger.enable("tactus") def parse_ecflow_vars(): @@ -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 eda6dbc..5b79caa 100644 --- a/surfexp/templates/stand_alone.py +++ b/surfexp/templates/stand_alone.py @@ -2,28 +2,28 @@ 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): +def stand_alone_main(task, config, tactus_home): """Execute default main. Args: task (str): Task name config (str): Config file - deode_home(str): Deode 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 e4e8a78..43567c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,10 @@ import os import pytest -from deode.config_parser import ConfigParserDefaults, ParsedConfig -from deode.derived_variables import set_times -from deode.logs import logger +import tomli_w +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,21 +27,131 @@ def tmp_directory(tmp_path_factory): @pytest.fixture(scope="module") -def deode_config(tmp_directory): - output_file = f"{tmp_directory}/config_deode.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') +def test_arch(): + my_host = "my_dummy_host" + os.environ["TACTUS_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_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@/tactus_ecflow/jobout", + "ecf_out": "@HOME@/tactus_ecflow/jobout", + "ecf_port": 44855, + "troika": { + "config_file": "@ECF_TACTUS_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", + "tactus_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": "@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": "@SCRATCH@/surfexp/@CASE@/GMTED", + }, + "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" argv = [ "-o", output_file, "--case-name", - "deode_case_name", + "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/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: diff --git a/tests/unit/test_suites.py b/tests/unit/test_suites.py index 8058e1f..f9338b6 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,22 +9,18 @@ @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") -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", output_file, "--case-name", - "deode_case_name", + "tactus_case_name", "--plugin-home", f"{PACKAGE_DIRECTORY}/..", f"{tmp_directory}/mods_sekf.toml", @@ -42,8 +38,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..2d36efd 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 tactusmakedirs +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 @@ -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 @@ -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}/surfexp/{task_name}" update = { "general": {"case": task_name}, "platform": { @@ -194,13 +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 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 @@ -209,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" ) @@ -226,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)