grdwindinversion 0.2.4__tar.gz → 0.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. grdwindinversion-0.2.5/.github/workflows/ci.yml +97 -0
  2. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/PKG-INFO +1 -1
  3. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/inversion.py +22 -31
  4. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion.egg-info/PKG-INFO +1 -1
  5. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion.egg-info/SOURCES.txt +0 -1
  6. grdwindinversion-0.2.4/.github/workflows/ci.yml +0 -98
  7. grdwindinversion-0.2.4/grdwindinversion/.travis.yml +0 -28
  8. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/.editorconfig +0 -0
  9. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/.github/dependabot.yml +0 -0
  10. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/.github/workflows/publish.yml +0 -0
  11. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/.gitignore +0 -0
  12. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/.pre-commit-config.yaml +0 -0
  13. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/AUTHORS.rst +0 -0
  14. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/CONTRIBUTING.rst +0 -0
  15. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/HISTORY.rst +0 -0
  16. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/LICENSE +0 -0
  17. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/MANIFEST.in +0 -0
  18. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/Makefile +0 -0
  19. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/README.md +0 -0
  20. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/ci/requirements/docs.yaml +0 -0
  21. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/ci/requirements/environment.yaml +0 -0
  22. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/Makefile +0 -0
  23. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/_static/css/grdwindinversion.css +0 -0
  24. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/algorithm.rst +0 -0
  25. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/authors.rst +0 -0
  26. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/conf.py +0 -0
  27. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/contributing.rst +0 -0
  28. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/examples/wind-inversion-from-grd.ipynb +0 -0
  29. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/history.rst +0 -0
  30. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/index.rst +0 -0
  31. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/installation.rst +0 -0
  32. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/make.bat +0 -0
  33. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/modules.rst +0 -0
  34. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/readme.rst +0 -0
  35. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/docs/usage.rst +0 -0
  36. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/.github/ISSUE_TEMPLATE.md +0 -0
  37. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/.gitignore +0 -0
  38. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/__init__.py +0 -0
  39. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/config_prod.yaml +0 -0
  40. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/config_prod_recal.yaml +0 -0
  41. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/data_config.yaml +0 -0
  42. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/load_config.py +0 -0
  43. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/main.py +0 -0
  44. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/streaks.py +0 -0
  45. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/utils.py +0 -0
  46. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion/utils_memory.py +0 -0
  47. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion.egg-info/dependency_links.txt +0 -0
  48. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion.egg-info/entry_points.txt +0 -0
  49. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion.egg-info/requires.txt +0 -0
  50. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/grdwindinversion.egg-info/top_level.txt +0 -0
  51. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/pyproject.toml +0 -0
  52. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/recipe/meta.yaml +0 -0
  53. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/requirements_dev.txt +0 -0
  54. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/requirements_doc.txt +0 -0
  55. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/setup.cfg +0 -0
  56. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/tests/__init__.py +0 -0
  57. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/tests/config_test.yaml +0 -0
  58. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/tests/test_grdwindinversion_ci.py +0 -0
  59. {grdwindinversion-0.2.4 → grdwindinversion-0.2.5}/tox.ini +0 -0
@@ -0,0 +1,97 @@
1
+ name: CI Workflow for grdwindinversion
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 360 # 6 hours limit for the job
15
+
16
+ steps:
17
+ # Checkout the code
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+
21
+ - uses: mamba-org/setup-micromamba@v1
22
+ with:
23
+ micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases
24
+ channels: tcevaer, conda-forge, defaults
25
+ init-shell: bash
26
+ post-cleanup: "all"
27
+
28
+ - name: Create environment and install tools
29
+ run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge
30
+
31
+ - name: Build package
32
+ run: |
33
+ cd recipe
34
+ eval "$(micromamba shell hook --shell bash)"
35
+ micromamba activate grdwind_env
36
+ conda mambabuild . -c tcevaer -c conda-forge
37
+
38
+ # Install the built package into the environment
39
+ - name: Install the built package
40
+ run: |
41
+ eval "$(micromamba shell hook --shell bash)"
42
+ micromamba activate grdwind_env
43
+ conda install --use-local grdwindinversion -y -c tcevaer -c conda-forge
44
+
45
+ # Cache the test data if previously downloaded (up to 10 GB limit for the cache)
46
+ # WARNING : modify the key if the data is modified !!
47
+ - name: Cache test data
48
+ uses: actions/cache@v4
49
+ id: cache
50
+ with:
51
+ path: ./test_data
52
+ key: test-data-v3
53
+ restore-keys: test-data-v3
54
+
55
+ # Download test data if not already cached
56
+ - name: Download test data
57
+ if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss
58
+ run: |
59
+ mkdir -p ./test_data/
60
+ wget https://cloud.ifremer.fr/index.php/s/ExLQ2TnYAqozPWE/download -O /tmp/ecmwf.zip
61
+ unzip /tmp/ecmwf.zip -d ./test_data/
62
+ wget https://cloud.ifremer.fr/index.php/s/kRgdOOPsjoZieZR/download -O /tmp/l1.zip
63
+ unzip /tmp/l1.zip -d ./test_data/
64
+ timeout-minutes: 200 # Adjust depending on the size of your data
65
+
66
+ # Set up xsar configuration
67
+ - name: Setup xsar configuration
68
+ run: |
69
+ mkdir -p ~/.xsar
70
+ echo "data_dir: /tmp" > ~/.xsar/config.yaml
71
+ echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yaml
72
+ echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yaml
73
+
74
+ # Set up grdwindinversion configuration
75
+ - name: Setup grdwindinversion configuration
76
+ run: |
77
+ mkdir -p ~/.grdwindinversion
78
+ 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
79
+ echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml
80
+ #echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
81
+ #echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
82
+ #echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
83
+
84
+ # Run the tests
85
+ - name: Run tests
86
+ run: |
87
+ eval "$(micromamba shell hook --shell bash)"
88
+ micromamba activate grdwind_env
89
+ pytest
90
+
91
+ # Optionally, upload test artifacts (NetCDF files or logs) if needed
92
+ #- name: Upload test artifacts
93
+ # if: failure() # Only upload on failure
94
+ # uses: actions/upload-artifact@v2
95
+ # with:
96
+ # name: test-output
97
+ # path: ./test_output/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: grdwindinversion
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Package to perform Wind inversion from GRD Level-1 SAR images
5
5
  License: MIT
6
6
  Classifier: Development Status :: 2 - Pre-Alpha
@@ -98,10 +98,10 @@ def getOutputName2(input_file, outdir, sensor, meta, subdir=True):
98
98
  regex = re.compile(
99
99
  "([A-Z0-9]+)_OK([0-9]+)_PK([0-9]+)_(.*?)_(.*?)_(.*?)_(.*?)_(.*?)_(.*?)_(.*?)")
100
100
  template = string.Template(
101
- "${MISSIONID}_OK${DATA1}_PK${DATA2}_${DATA3}_${BEAM_MODE}_${DATE}_${TIME}_${POLARIZATION1}_${POLARIZATION2}_${PRODUCT}")
101
+ "${MISSIONID}_OK${DATA1}_PK${DATA2}_${DATA3}_${BEAM}_${DATE}_${TIME}_${POLARIZATION1}_${POLARIZATION2}_${PRODUCT}")
102
102
  match = regex.match(basename_match)
103
103
  MISSIONID, DATA1, DATA2, DATA3, BEAM_MODE, DATE, TIME, POLARIZATION1, POLARIZATION2, LAST = match.groups()
104
- new_format = f"{MISSIONID.lower()}-{BEAM_MODE.lower()}-owi-xx-{meta_start_date.lower()}-{meta_stop_date.lower()}-_____-_____.nc"
104
+ new_format = f"{MISSIONID.lower()}-{BEAM.lower()}-owi-xx-{meta_start_date.lower()}-{meta_stop_date.lower()}-_____-_____.nc"
105
105
  else:
106
106
  raise ValueError(
107
107
  "sensor must be S1A|S1B|RS2|RCM, got sensor %s" % sensor)
@@ -243,7 +243,7 @@ def inverse(dual_pol, inc, sigma0, sigma0_dual, ancillary_wind, dsig_cr, model_c
243
243
  See Also
244
244
  --------
245
245
  xsarsea documentation
246
- https://cyclobs.ifremer.fr/static/sarwing_datarmor/xsarsea/examples/windspeed_inversion.html
246
+ https://cerweb.ifremer.fr/datarmor/doc_sphinx/xsarsea/
247
247
  """
248
248
  logging.debug("inversion")
249
249
 
@@ -282,7 +282,7 @@ def inverse(dual_pol, inc, sigma0, sigma0_dual, ancillary_wind, dsig_cr, model_c
282
282
  return wind_co, None, None
283
283
 
284
284
 
285
- def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, add_streaks):
285
+ def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, add_streaks, apply_flattening):
286
286
  """
287
287
  Rename xr_dataset variables and attributes to match naming convention.
288
288
 
@@ -392,13 +392,18 @@ def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, add_streaks):
392
392
 
393
393
  xr_dataset = xr_dataset.rename({
394
394
  'dsig_cross': 'owiDsig_cross',
395
- 'nesz_cross_final': 'owiNesz_cross_final',
396
395
  'winddir_cross': 'owiWindDirection_cross',
397
396
  'winddir_dual': 'owiWindDirection',
398
397
  'windspeed_cross': 'owiWindSpeed_cross',
399
398
  'windspeed_dual': 'owiWindSpeed',
400
399
  'sigma0_detrend_cross': 'owiNrcs_detrend_cross'
401
400
  })
401
+
402
+ if apply_flattening:
403
+ xr_dataset = xr_dataset.rename({
404
+ 'nesz_cross_flattened': 'owiNesz_cross_flattened',
405
+ })
406
+
402
407
  # nrcs cross
403
408
  xr_dataset['owiNrcs_cross'] = xr_dataset['sigma0_ocean'].sel(
404
409
  pol=crosspol)
@@ -635,15 +640,7 @@ def preprocess(filename, outdir, config_path, overwrite=False, add_streaks=False
635
640
  config["l2_params"]["model_cross"] = model_cross
636
641
  config["sensor_longname"] = sensor_longname
637
642
 
638
- # need to load gmfs before inversion
639
- gmfs_impl = [x for x in [model_co, model_cross] if "gmf_" in x]
640
- windspeed.gmfs.GmfModel.activate_gmfs_impl(gmfs_impl)
641
- sarwings_luts = [x for x in [model_co, model_cross]
642
- if x.startswith("sarwing_lut_")]
643
-
644
- if len(sarwings_luts) > 0:
645
- windspeed.register_sarwing_luts(getConf()["sarwing_luts_path"])
646
-
643
+ # need to load LUTs before inversion
647
644
  nc_luts = [x for x in [model_co, model_cross] if x.startswith("nc_lut")]
648
645
 
649
646
  if len(nc_luts) > 0:
@@ -767,22 +764,17 @@ def preprocess(filename, outdir, config_path, overwrite=False, add_streaks=False
767
764
  xr_dataset['sigma0_detrend_cross'] = xsarsea.sigma0_detrend(
768
765
  xr_dataset.sigma0.sel(pol=crosspol), xr_dataset.incidence, model=model_cross)
769
766
  if config["apply_flattening"]:
770
- xr_dataset = xr_dataset.assign(nesz_cross_final=(
767
+ xr_dataset = xr_dataset.assign(nesz_cross_flattened=(
771
768
  ['line', 'sample'], windspeed.nesz_flattening(xr_dataset.nesz.sel(pol=crosspol), xr_dataset.incidence)))
772
- xr_dataset['nesz_cross_final'].attrs[
769
+ xr_dataset['nesz_cross_flattened'].attrs[
773
770
  "comment"] = 'nesz has been flattened using windspeed.nesz_flattening'
774
-
771
+ # dsig
772
+ xr_dataset["dsig_cross"] = windspeed.get_dsig(config["dsig_"+crosspol_gmf+"_NAME"], xr_dataset.incidence,
773
+ xr_dataset['sigma0_ocean'].sel(pol=crosspol), xr_dataset.nesz_cross_flattened)
775
774
  else:
776
- xr_dataset = xr_dataset.assign(
777
- nesz_cross_final=(['line', 'sample'], xr_dataset.nesz.sel(pol=crosspol).values))
778
- xr_dataset['nesz_cross_final'].attrs["comment"] = 'nesz has not been flattened'
779
-
780
- xr_dataset.nesz_cross_final.attrs['units'] = 'm^2 / m^2'
781
- xr_dataset.nesz_cross_final.attrs['long_name'] = 'Noise Equivalent SigmaNaught'
782
-
783
- # dsig
784
- xr_dataset["dsig_cross"] = windspeed.get_dsig(config["dsig_"+crosspol_gmf+"_NAME"], xr_dataset.incidence,
785
- xr_dataset['sigma0_ocean'].sel(pol=crosspol), xr_dataset.nesz_cross_final)
775
+ # dsig
776
+ xr_dataset["dsig_cross"] = windspeed.get_dsig(config["dsig_"+crosspol_gmf+"_NAME"], xr_dataset.incidence,
777
+ xr_dataset['sigma0_ocean'].sel(pol=crosspol), xr_dataset['sigma0_ocean'].sel(pol=crosspol))
786
778
 
787
779
  xr_dataset.dsig_cross.attrs['comment'] = 'variable used to ponderate copol and crosspol'
788
780
  xr_dataset.dsig_cross.attrs['formula_used'] = config["dsig_" +
@@ -936,8 +928,7 @@ def makeL2(filename, outdir, config_path, overwrite=False, generateCSV=True, add
936
928
 
937
929
  xr_dataset['winddir_dual'] = transform_winddir(
938
930
  wind_dual, xr_dataset.ground_heading, winddir_convention=config["winddir_convention"])
939
- xr_dataset['winddir_dual'].attrs["model"] = "%s (%s) & %s (%s)" % (
940
- model_co, copol, model_cross, crosspol)
931
+ xr_dataset["winddir_dual"].attrs["model"] = "winddir_dual is a copy of copol wind direction"
941
932
 
942
933
  xr_dataset = xr_dataset.assign(
943
934
  windspeed_cross=(['line', 'sample'], windspeed_cr))
@@ -949,7 +940,7 @@ def makeL2(filename, outdir, config_path, overwrite=False, generateCSV=True, add
949
940
 
950
941
  xr_dataset['winddir_cross'] = xr_dataset['winddir_dual'].copy()
951
942
  xr_dataset['winddir_cross'].attrs = xr_dataset['winddir_dual'].attrs
952
- xr_dataset["winddir_cross"].attrs["model"] = "No model used ; content is a copy of dualpol wind direction"
943
+ xr_dataset["winddir_cross"].attrs["model"] = "winddir_cross is a copy of copol wind direction"
953
944
 
954
945
  if config["winddir_convention"] == "oceanographic":
955
946
  attrs = xr_dataset['ancillary_wind_direction'].attrs
@@ -960,7 +951,7 @@ def makeL2(filename, outdir, config_path, overwrite=False, generateCSV=True, add
960
951
  "long_name"] = f"{ancillary_name} wind direction in oceanographic convention (clockwise, to), ex: 0°=to north, 90°=to east"
961
952
 
962
953
  xr_dataset, encoding = makeL2asOwi(
963
- xr_dataset, dual_pol, copol, crosspol, add_streaks=add_streaks)
954
+ xr_dataset, dual_pol, copol, crosspol, add_streaks=add_streaks, apply_flattening=config["apply_flattening"])
964
955
 
965
956
  #  add attributes
966
957
  firstMeasurementTime = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: grdwindinversion
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Package to perform Wind inversion from GRD Level-1 SAR images
5
5
  License: MIT
6
6
  Classifier: Development Status :: 2 - Pre-Alpha
@@ -32,7 +32,6 @@ docs/usage.rst
32
32
  docs/_static/css/grdwindinversion.css
33
33
  docs/examples/wind-inversion-from-grd.ipynb
34
34
  grdwindinversion/.gitignore
35
- grdwindinversion/.travis.yml
36
35
  grdwindinversion/__init__.py
37
36
  grdwindinversion/config_prod.yaml
38
37
  grdwindinversion/config_prod_recal.yaml
@@ -1,98 +0,0 @@
1
- name: CI Workflow for grdwindinversion
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- branches:
9
- - main
10
-
11
- jobs:
12
- test:
13
- runs-on: ubuntu-latest
14
- timeout-minutes: 360 # 6 hours limit for the job
15
-
16
- steps:
17
- # Checkout the code
18
- - name: Checkout code
19
- uses: actions/checkout@v4
20
-
21
- - uses: mamba-org/setup-micromamba@v1
22
- with:
23
- micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases
24
- channels: tcevaer, conda-forge, defaults
25
- init-shell: bash
26
- post-cleanup: "all"
27
-
28
- - name: Create environment and install tools
29
- run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge
30
-
31
- - name: Build package
32
- run: |
33
- cd recipe
34
- eval "$(micromamba shell hook --shell bash)"
35
- micromamba activate grdwind_env
36
- conda mambabuild . -c tcevaer -c conda-forge
37
-
38
- # Install the built package into the environment
39
- - name: Install the built package
40
- run: |
41
- eval "$(micromamba shell hook --shell bash)"
42
- micromamba activate grdwind_env
43
- conda install --use-local grdwindinversion -y -c tcevaer -c conda-forge
44
-
45
- # Cache the test data if previously downloaded (up to 10 GB limit for the cache)
46
- # WARNING : modify the key if the data is modified !!
47
- - name: Cache test data
48
- uses: actions/cache@v4
49
- id: cache
50
- with:
51
- path: ./test_data
52
- key: test-data-v3
53
- restore-keys: test-data-v3
54
-
55
- # Download test data if not already cached
56
- - name: Download test data
57
- if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss
58
- run: |
59
- mkdir -p ./test_data/
60
- wget https://cloud.ifremer.fr/index.php/s/ExLQ2TnYAqozPWE/download -O /tmp/ecmwf.zip
61
- unzip /tmp/ecmwf.zip -d ./test_data/
62
- wget https://cloud.ifremer.fr/index.php/s/kRgdOOPsjoZieZR/download -O /tmp/l1.zip
63
- unzip /tmp/l1.zip -d ./test_data/
64
- timeout-minutes: 200 # Adjust depending on the size of your data
65
-
66
- # Set up xsar configuration
67
- - name: Setup xsar configuration
68
- run: |
69
- mkdir -p ~/.xsar
70
- echo "data_dir: /tmp" > ~/.xsar/config.yaml
71
- echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yaml
72
- echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yaml
73
-
74
- # Set up grdwindinversion configuration
75
- - name: Setup grdwindinversion configuration
76
- run: |
77
- mkdir -p ~/.grdwindinversion
78
- 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
79
- echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml
80
- #echo "'sarwing_luts_path': './test_data/GMFS/v1.6/'" >> ~/.grdwindinversion/data_config.yaml
81
- #echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
82
- #echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
83
- #echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
84
-
85
- # Run the tests
86
- - name: Run tests
87
- run: |
88
- eval "$(micromamba shell hook --shell bash)"
89
- micromamba activate grdwind_env
90
- pytest
91
-
92
- # Optionally, upload test artifacts (NetCDF files or logs) if needed
93
- #- name: Upload test artifacts
94
- # if: failure() # Only upload on failure
95
- # uses: actions/upload-artifact@v2
96
- # with:
97
- # name: test-output
98
- # path: ./test_output/
@@ -1,28 +0,0 @@
1
- # Config file for automatic testing at travis-ci.com
2
-
3
- language: python
4
- python:
5
- - 3.8
6
- - 3.7
7
- - 3.6
8
-
9
- # Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
10
- install: pip install -U tox-travis
11
-
12
- # Command to run tests, e.g. python setup.py test
13
- script: tox
14
-
15
- # Assuming you have installed the travis-ci CLI tool, after you
16
- # create the Github repo and add it to Travis, run the
17
- # following command to finish PyPI deployment setup:
18
- # $ travis encrypt --add deploy.password
19
- deploy:
20
- provider: pypi
21
- distributions: sdist bdist_wheel
22
- user: agrouaze
23
- password:
24
- secure: PLEASE_REPLACE_ME
25
- on:
26
- tags: true
27
- repo: agrouaze/grdwindinversion
28
- python: 3.8