Skip to content

Commit

Permalink
Merge pull request #95 from umr-lops/fix-issue-pypi
Browse files Browse the repository at this point in the history
fix an issue related to long_description
  • Loading branch information
agrouaze authored Dec 2, 2024
2 parents 080179d + 97262e8 commit 28c51f1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 32 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
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
echo "unit_test_s1_product: './test_data/L1/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE'" >> ~/.grdwindinversion/data_config.yaml
echo "unit_test_rcm_product: './test_data/L1/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD'" >> ~/.grdwindinversion/data_config.yaml
echo "unit_test_rs2_product: './test_data/L1/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF'" >> ~/.grdwindinversion/data_config.yaml
#echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
#echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
#echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# grdwindinversion

[![Python Version](https://img.shields.io/pypi/pyversions/grdwindinversion.svg)](https://pypi.org/project/grdwindinversion/)
[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/umr-lops/grdwindinversion/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)
Expand Down
12 changes: 7 additions & 5 deletions docs/examples/streaks-display.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"outputs": [],
"source": [
"# test on an dummy GRD IW product\n",
"import xsar\n",
"import xsar,os\n",
"import grdwindinversion \n",
"filename = xsar.get_test_file('S1A_IW_GRDH_1SDV_20170907T103020_20170907T103045_018268_01EB76_Z010.SAFE')\n",
"outdir = \"/tmp/\"\n",
"config_path = \"/home/vincelhx/Documents/autoentreprise/IFREMER/libs/fork_grdwi/grdwindinversion/grdwindinversion/config_prod_streaks.yaml\"\n",
"config_path = os.path.join(os.path.dirname(grdwindinversion.__file__),'config_prod_streaks.yaml')\n",
"assert os.path.exists(config_path)\n",
"overwrite = True\n",
"resolution = '1000m'"
]
Expand Down Expand Up @@ -300,7 +302,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "env_xsar",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -314,9 +316,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.15"
"version": "3.11.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
11 changes: 7 additions & 4 deletions grdwindinversion/data_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#'ecmwf_0100_1h': '../ecmwf/forecast/hourly/0100deg/netcdf_light_REPRO_tree/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
#'ecmwf_0125_1h': '../ecmwf/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
'ecmwf_0100_1h': '../ecmwf/forecast/hourly/0100deg/netcdf_light_REPRO_tree/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
'ecmwf_0125_1h': '../ecmwf/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc'


unit_test_s1_product: './sentinel-1a/L1/IW/S1A_IW_GRDH_1S/2021/252/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE'
unit_test_rcm_product: './l1/rcm/rcm-1/sclnd/2023/273/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD'
unit_test_rs2_product: './L1/VV_VH/2022/247/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF'

'ecmwf_0100_1h': '/home/datawork-cersat-public/provider/ecmwf/forecast/hourly/0100deg/netcdf_light_REPRO_tree/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
'ecmwf_0125_1h': '/home/datawork-cersat-intranet/project/ecmwf/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
11 changes: 7 additions & 4 deletions grdwindinversion/load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import os
import grdwindinversion
from yaml import CLoader as Loader
local_config_potential_path = os.path.expanduser(
local_config_potential_path1 = os.path.expanduser(
'~/.grdwindinversion/data_config.yaml')

if os.path.exists(local_config_potential_path):
config_path = local_config_potential_path
local_config_potential_path2 = os.path.join(os.path.dirname(
grdwindinversion.__file__), 'local_data_config.yaml')
if os.path.exists(local_config_potential_path1):
config_path = local_config_potential_path1
elif os.path.exists(local_config_potential_path2):
config_path = local_config_potential_path2
else:
config_path = os.path.join(os.path.dirname(
grdwindinversion.__file__), 'data_config.yaml')
Expand Down
42 changes: 28 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
[project]
name = "grdwindinversion"
description="Package to perform Wind inversion from GRD Level-1 SAR images"
readme = "README.md"
keywords = [
"xarray",
"earth-observation",
"remote-sensing",
"satellite-imagery",
"Sentinel-1",
"RCM",
"RadarSat2",
"sar",
"synthetic-aperture-radar",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
]
requires-python = ">= 3.9"
description = "Package to perform Wind inversion from GRD Level-1 SAR images"
readme = "README.rst"
license = {text = "MIT"}
authors = [
{ name = "Antoine Grouazel", email = "[email protected]" },
]

dependencies = [
"xsar",
"xsarsea",
Expand All @@ -14,21 +40,9 @@ dependencies = [
"scipy",
"fsspec",
"aiohttp",
"xarray-safe-s1",
"xradarsat2",
"xarray-safe-rcm"
]

dynamic = ["version"]
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]

[build-system]
requires = ["setuptools>=64.0", "setuptools-scm"]
Expand Down
4 changes: 4 additions & 0 deletions tests/config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ RCM:
wspd_step: 0.1
phi_step: 1.0
resolution: "high"

unit_test_s1_product: "./test_data/L1/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE"
unit_test_rcm_product: "./test_data/L1/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD"
unit_test_rs2_product: "./test_data/L1/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF"
16 changes: 12 additions & 4 deletions tests/test_grdwindinversion_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import urllib.request
from grdwindinversion.inversion import makeL2
import xsar
from grdwindinversion.load_config import getConf

# What must be done by the tests:
# - Download L1 data
Expand All @@ -13,12 +15,15 @@
# - For recal : download auxiliary files
#


S1_path = getConf()['unit_test_s1_product']
rcm_path = getConf()['unit_test_rcm_product']
rs2_path = getConf()['unit_test_rs2_product']
print('S1_path',S1_path)
def test_makeL2_generation():
l1_files = [
"./test_data/L1/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE",
"./test_data/L1/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD",
"./test_data/L1/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF"
S1_path,
rcm_path,
rs2_path
]

# l1_files = [
Expand Down Expand Up @@ -52,3 +57,6 @@ def test_makeL2_generation():
assert (
"owiWindSpeed" in dataset.variables
), "Expected variable 'owiWindSpeed' missing in the dataset"

if __name__ == '__main__':
test_makeL2_generation()

0 comments on commit 28c51f1

Please sign in to comment.