Skip to content

Commit 6bc4510

Browse files
authored
Upgrade copernicusmarine to v2.x (#5)
* upgrade copernicusmarine to v2.1.2 * Update version to 2.0.0
1 parent 095b20f commit 6bc4510

File tree

8 files changed

+12
-67
lines changed

8 files changed

+12
-67
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ __pycache__
88

99
# files
1010
poetry.lock
11+
.pid

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ Options:
211211
-v, --dataset-version TEXT Dry run
212212
-nd, --no-directories TEXT Option to not recreate folder hierarchy in
213213
output directory
214-
--force-download TEXT Flag to skip confirmation before download
215214
--disable-progress-bar TEXT Flag to hide progress bar
216215
-n, --username TEXT Username
217216
-w, --password TEXT Password
@@ -263,13 +262,13 @@ Options:
263262
With a specific file:
264263
265264
```shell
266-
mds etag -e s3://mdl-native-12/native/MEDSEA_ANALYSISFORECAST_PHY_006_013/cmems_mod_med_phy-tem_anfc_4.2km_P1D-m_202411/2023/08/20230820_d-CMCC--TEMP-MFSeas9-MEDATL-b20240607_an-sv10.00.nc
265+
mds etag -e s3://mdl-native-12/native/MEDSEA_ANALYSISFORECAST_PHY_006_013/cmems_mod_med_phy-cur_anfc_4.2km_PT15M-i_202411/2025/05/20250501_qm-CMCC--RFVL-MFSeas9-MEDATL-b20250513_an-sv10.00.nc
267266
```
268267
269268
Or:
270269
271270
```shell
272-
mds etag -p MEDSEA_ANALYSISFORECAST_PHY_006_013 -i cmems_mod_med_phy-cur_anfc_4.2km_PT15M-i -g 202411 -f '*b20241212*' -s 2024/12
271+
mds etag -p MEDSEA_ANALYSISFORECAST_PHY_006_013 -i cmems_mod_med_phy-cur_anfc_4.2km_PT15M-i -g 202411 -f '*' -s 2025/05
273272
```
274273
275274
---

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ channels:
44
- defaults
55
dependencies:
66
- python=3.10
7-
- copernicusmarine=1.2.3
7+
- copernicusmarine >2.1
88
- boto3 >=1.37.4
99
- click >=8.1.8

mds/core/copernicus.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717

1818

1919
def subset(**subset_kwargs) -> pathlib.Path:
20-
subset_kwargs.update({"force_download": True, "disable_progress_bar": True})
20+
subset_kwargs.update({"disable_progress_bar": True})
2121
utils.check_dict_validity(subset_kwargs, SUBSET_MANDATORY_ATTRS)
2222

23+
# patch needed because Click returns a tuple but subset() needs a list of variables
24+
subset_kwargs["variables"] = list(subset_kwargs["variables"])
25+
2326
# download
2427
utils.pprint_dict(subset_kwargs)
2528
result = copernicusmarine.subset(
@@ -33,7 +36,7 @@ def get(**get_kwargs) -> List[pathlib.Path]:
3336

3437
# download
3538
utils.pprint_dict(get_kwargs)
36-
result = copernicusmarine.get(**get_kwargs, no_metadata_cache=True)
39+
result = copernicusmarine.get(**get_kwargs)
3740
return result
3841

3942

mds/core/wrapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def mds_list(dataset_id, mds_filter: str, quiet=True, dataset_version=None) -> L
9494
"filter": mds_filter,
9595
"output_directory": tempdir,
9696
"create_file_list": mds_output_filename,
97-
"force_download": True,
9897
"disable_progress_bar": True,
9998
"dataset_version": dataset_version,
10099
}

mds/mng/wrapper_group.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ def subset(**kwargs):
129129
default=True,
130130
help="Option to not recreate folder hierarchy in output directory",
131131
)
132-
@click.option(
133-
"--force-download",
134-
type=str,
135-
default=True,
136-
help="Flag to skip confirmation before download",
137-
)
138132
@click.option(
139133
"--disable-progress-bar", type=str, default=True, help="Flag to hide progress bar"
140134
)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mds-toolbox"
3-
version = "1.0.0"
3+
version = "2.0.0"
44
description = "A custom CMCC library to list and download data from the Marine Data Store"
55
authors = ["Antonio Mariani <[email protected]>"]
66
readme = ["README.md"]
@@ -13,7 +13,7 @@ keywords = ["copernicus", "copernicusmarine", "mds", "marine data store"]
1313
[tool.poetry.dependencies]
1414
python = ">=3.10,<3.13"
1515
boto3 = "^1.37.4"
16-
copernicusmarine = "1.3.5"
16+
copernicusmarine = ">=2.1.1"
1717
click = "^8.1.8"
1818

1919
[build-system]

requirements.txt

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,10 @@
1-
aiohappyeyeballs==2.4.6 ; python_version >= "3.10" and python_version < "3.13"
2-
aiohttp==3.11.13 ; python_version >= "3.10" and python_version < "3.13"
3-
aiosignal==1.3.2 ; python_version >= "3.10" and python_version < "3.13"
4-
asciitree==0.3.3 ; python_version >= "3.10" and python_version < "3.13"
5-
async-timeout==5.0.1 ; python_version >= "3.10" and python_version < "3.11"
6-
attrs==25.1.0 ; python_version >= "3.10" and python_version < "3.13"
7-
beautifulsoup4==4.13.3 ; python_version >= "3.10" and python_version < "3.13"
81
boto3==1.37.4 ; python_version >= "3.10" and python_version < "3.13"
92
botocore==1.37.4 ; python_version >= "3.10" and python_version < "3.13"
10-
cachier==3.1.2 ; python_version >= "3.10" and python_version < "3.13"
11-
certifi==2025.1.31 ; python_version >= "3.10" and python_version < "3.13"
12-
cftime==1.6.4.post1 ; python_version >= "3.10" and python_version < "3.13"
13-
charset-normalizer==3.4.1 ; python_version >= "3.10" and python_version < "3.13"
143
click==8.1.8 ; python_version >= "3.10" and python_version < "3.13"
15-
cloudpickle==3.1.1 ; python_version >= "3.10" and python_version < "3.13"
164
colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.13" and platform_system == "Windows"
17-
copernicusmarine==1.3.5 ; python_version >= "3.10" and python_version < "3.13"
18-
dask==2025.2.0 ; python_version >= "3.10" and python_version < "3.13"
19-
fasteners==0.19 ; python_version >= "3.10" and python_version < "3.13" and sys_platform != "emscripten"
20-
frozenlist==1.5.0 ; python_version >= "3.10" and python_version < "3.13"
21-
fsspec==2025.2.0 ; python_version >= "3.10" and python_version < "3.13"
22-
idna==3.10 ; python_version >= "3.10" and python_version < "3.13"
23-
importlib-metadata==8.6.1 ; python_version >= "3.10" and python_version < "3.12"
5+
copernicusmarine==2.1.2 ; python_version >= "3.10" and python_version < "3.13"
246
jmespath==1.0.1 ; python_version >= "3.10" and python_version < "3.13"
25-
locket==1.0.0 ; python_version >= "3.10" and python_version < "3.13"
26-
lxml==5.3.1 ; python_version >= "3.10" and python_version < "3.13"
27-
motuclient==3.0.0 ; python_version >= "3.10" and python_version < "3.13"
28-
multidict==6.1.0 ; python_version >= "3.10" and python_version < "3.13"
29-
nest-asyncio==1.6.0 ; python_version >= "3.10" and python_version < "3.13"
30-
netcdf4==1.7.2 ; python_version >= "3.10" and python_version < "3.13"
31-
numcodecs==0.13.1 ; python_version >= "3.10" and python_version < "3.13"
32-
numpy==2.2.3 ; python_version >= "3.10" and python_version < "3.13"
33-
packaging==24.2 ; python_version >= "3.10" and python_version < "3.13"
34-
pandas==2.2.3 ; python_version >= "3.10" and python_version < "3.13"
35-
partd==1.4.2 ; python_version >= "3.10" and python_version < "3.13"
36-
portalocker==3.1.1 ; python_version >= "3.10" and python_version < "3.13"
37-
propcache==0.3.0 ; python_version >= "3.10" and python_version < "3.13"
38-
pydap==3.5.3 ; python_version >= "3.10" and python_version < "3.13"
39-
pystac==1.12.2 ; python_version >= "3.10" and python_version < "3.13"
407
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "3.13"
41-
pytz==2025.1 ; python_version >= "3.10" and python_version < "3.13"
42-
pywin32==308 ; python_version >= "3.10" and python_version < "3.13" and platform_system == "Windows"
43-
pyyaml==6.0.2 ; python_version >= "3.10" and python_version < "3.13"
44-
requests==2.32.3 ; python_version >= "3.10" and python_version < "3.13"
458
s3transfer==0.11.3 ; python_version >= "3.10" and python_version < "3.13"
46-
scipy==1.15.2 ; python_version >= "3.10" and python_version < "3.13"
47-
semver==3.0.4 ; python_version >= "3.10" and python_version < "3.13"
48-
setuptools==75.8.2 ; python_version >= "3.10" and python_version < "3.13"
499
six==1.17.0 ; python_version >= "3.10" and python_version < "3.13"
50-
soupsieve==2.6 ; python_version >= "3.10" and python_version < "3.13"
51-
toolz==1.0.0 ; python_version >= "3.10" and python_version < "3.13"
52-
tqdm==4.67.1 ; python_version >= "3.10" and python_version < "3.13"
53-
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "3.13"
54-
tzdata==2025.1 ; python_version >= "3.10" and python_version < "3.13"
5510
urllib3==2.3.0 ; python_version >= "3.10" and python_version < "3.13"
56-
watchdog==6.0.0 ; python_version >= "3.10" and python_version < "3.13"
57-
webob==1.8.9 ; python_version >= "3.10" and python_version < "3.13"
58-
xarray==2025.1.2 ; python_version >= "3.10" and python_version < "3.13"
59-
yarl==1.18.3 ; python_version >= "3.10" and python_version < "3.13"
60-
zarr==2.18.3 ; python_version >= "3.10" and python_version < "3.13"
61-
zipp==3.21.0 ; python_version >= "3.10" and python_version < "3.12"

0 commit comments

Comments
 (0)