From 40ba0425fd510292fe088ddac1d858fe3905cc64 Mon Sep 17 00:00:00 2001 From: Skealz Date: Mon, 21 Oct 2024 09:59:38 +0200 Subject: [PATCH 1/5] Update ci.yml Fix ci.yml wrong indent --- .github/workflows/ci.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 363ded8..4c5c995 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ jobs: steps: # Checkout the code - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - uses: mamba-org/setup-micromamba@v1 with: @@ -44,36 +44,36 @@ jobs: # Cache the test data if previously downloaded (up to 10 GB limit for the cache) # WARNING : modify the key if the data is modified !! - - name: Cache test data - uses: actions/cache@v4 - id: cache - with: - path: ./test_data - key: test-data-v3 - restore-keys: test-data-v3 + - name: Cache test data + uses: actions/cache@v4 + id: cache + with: + path: ./test_data + key: test-data-v3 + restore-keys: test-data-v3 # Download test data if not already cached - - name: Download test data - if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss - run: | + - name: Download test data + if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss + run: | mkdir -p ./test_data/ wget https://cloud.ifremer.fr/index.php/s/ExLQ2TnYAqozPWE/download -O /tmp/ecmwf.zip unzip /tmp/ecmwf.zip -d ./test_data/ wget https://cloud.ifremer.fr/index.php/s/kRgdOOPsjoZieZR/download -O /tmp/l1.zip unzip /tmp/l1.zip -d ./test_data/ - timeout-minutes: 200 # Adjust depending on the size of your data + timeout-minutes: 200 # Adjust depending on the size of your data # Set up xsar configuration - - name: Setup xsar configuration - run: | + - name: Setup xsar configuration + run: | mkdir -p ~/.xsar echo "data_dir: /tmp" > ~/.xsar/config.yaml echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yaml echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yaml # Set up grdwindinversion configuration - - name: Setup grdwindinversion configuration - run: | + - name: Setup grdwindinversion configuration + run: | mkdir -p ~/.grdwindinversion echo "'ecmwf_0100_1h': ./test_data/ECMWF/forecast/hourly/0100deg/netcdf_light/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc" > ~/.grdwindinversion/data_config.yaml echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml @@ -82,8 +82,8 @@ jobs: #echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml # Run the tests - - name: Run tests - run: | + - name: Run tests + run: | eval "$(micromamba shell hook --shell bash)" micromamba activate grdwind_env pytest From d184c11d47900ec7783ff636180c6c801e9a170a Mon Sep 17 00:00:00 2001 From: tcevaer Date: Mon, 21 Oct 2024 17:01:39 +0200 Subject: [PATCH 2/5] Flexible channel priority in CI --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c5c995..00e9f9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,10 @@ jobs: - name: Create environment and install tools run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge + - name: Configure Conda channel priority to flexible + run: | + micromamba config --set channel_priority flexible + - name: Build package run: | cd recipe From b4d17033f48ba8d02e9db1845d44607a7ccd356d Mon Sep 17 00:00:00 2001 From: tcevaer Date: Mon, 21 Oct 2024 17:03:55 +0200 Subject: [PATCH 3/5] conda for channel prio in CI --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00e9f9d..b0c09e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,12 @@ jobs: init-shell: bash post-cleanup: "all" - - name: Create environment and install tools - run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge - - name: Configure Conda channel priority to flexible run: | - micromamba config --set channel_priority flexible + conda config --set channel_priority flexible + + - name: Create environment and install tools + run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge - name: Build package run: | From 7e4e1a75b3b1be85c575b2f6bda3261c3538009d Mon Sep 17 00:00:00 2001 From: tcevaer Date: Mon, 21 Oct 2024 17:12:39 +0200 Subject: [PATCH 4/5] Disabled channel prio in CI to make package version more important, remove default channel. --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0c09e7..f74a9ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,30 +21,30 @@ jobs: - uses: mamba-org/setup-micromamba@v1 with: micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases - channels: tcevaer, conda-forge, defaults + channels: tcevaer, conda-forge init-shell: bash post-cleanup: "all" - - name: Configure Conda channel priority to flexible + - name: Configure Conda channel priority to disabled run: | - conda config --set channel_priority flexible + conda config --set channel_priority disabled - name: Create environment and install tools - run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge + run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y - name: Build package run: | cd recipe eval "$(micromamba shell hook --shell bash)" micromamba activate grdwind_env - conda mambabuild . -c tcevaer -c conda-forge + conda mambabuild . # Install the built package into the environment - name: Install the built package run: | eval "$(micromamba shell hook --shell bash)" micromamba activate grdwind_env - conda install --use-local grdwindinversion -y -c tcevaer -c conda-forge + conda install --use-local grdwindinversion -y # Cache the test data if previously downloaded (up to 10 GB limit for the cache) # WARNING : modify the key if the data is modified !! From 394c9d41f9e12f21b876b2cdbbf1ccfef897f2d0 Mon Sep 17 00:00:00 2001 From: tcevaer Date: Mon, 21 Oct 2024 17:31:11 +0200 Subject: [PATCH 5/5] Fix BEAM_MODE --- grdwindinversion/inversion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grdwindinversion/inversion.py b/grdwindinversion/inversion.py index 3239239..3e294e6 100644 --- a/grdwindinversion/inversion.py +++ b/grdwindinversion/inversion.py @@ -101,7 +101,7 @@ def getOutputName2(input_file, outdir, sensor, meta, subdir=True): "${MISSIONID}_OK${DATA1}_PK${DATA2}_${DATA3}_${BEAM}_${DATE}_${TIME}_${POLARIZATION1}_${POLARIZATION2}_${PRODUCT}") match = regex.match(basename_match) MISSIONID, DATA1, DATA2, DATA3, BEAM_MODE, DATE, TIME, POLARIZATION1, POLARIZATION2, LAST = match.groups() - new_format = f"{MISSIONID.lower()}-{BEAM.lower()}-owi-xx-{meta_start_date.lower()}-{meta_stop_date.lower()}-_____-_____.nc" + new_format = f"{MISSIONID.lower()}-{BEAM_MODE.lower()}-owi-xx-{meta_start_date.lower()}-{meta_stop_date.lower()}-_____-_____.nc" else: raise ValueError( "sensor must be S1A|S1B|RS2|RCM, got sensor %s" % sensor)