tfv-get-tools 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.
@@ -208,30 +208,23 @@ class BaseMerger(ABC):
208
208
  download_interval = self.cfg.get("_DOWNLOAD_INTERVAL", "monthly")
209
209
 
210
210
  if download_interval == "monthly":
211
- start_time_strings = [x.stem.split("_")[-2] for x in file_list]
212
- end_time_strings = [x.stem.split("_")[-1] for x in file_list]
211
+ time_stings = [re.search(r'_(\d{8})_(\d{8})', x.stem) for x in file_list]
212
+ start_time_strings = [x.group(1) for x in time_stings]
213
+ end_time_strings = [x.group(2) for x in time_stings]
214
+
213
215
  start_times = pd.DatetimeIndex(
214
- [pd.Timestamp(x, unit="h") for x in start_time_strings]
216
+ [pd.to_datetime(x, format="%Y%m%d") for x in start_time_strings]
215
217
  )
216
218
  end_times = pd.DatetimeIndex(
217
- [pd.Timestamp(x, unit="h") for x in end_time_strings]
219
+ [pd.to_datetime(x, format="%Y%m%d") for x in end_time_strings]
218
220
  )
219
221
 
220
222
  elif download_interval == "daily":
221
- start_time_strings = [x.stem.split("_")[-1] for x in file_list]
222
-
223
- # Handle legacy HYCOM files
224
- if start_time_strings and start_time_strings[0] == "0000":
225
- if self.verbose:
226
- print("WARNING: Detected legacy HYCOM files with time suffixes")
227
- start_time_strings = [
228
- x.name.split(".")[0].split("_")[-2] for x in file_list
229
- ]
230
-
223
+ start_time_strings = [re.search(r'_(\d{8})_', x.stem).group(1) for x in file_list]
231
224
  start_times = pd.DatetimeIndex(
232
- [pd.Timestamp(x, unit="h") for x in start_time_strings]
225
+ [pd.to_datetime(x, format="%Y%m%d") for x in start_time_strings]
233
226
  )
234
- end_times = start_times + pd.Timedelta("23.9h")
227
+ end_times = start_times + pd.Timedelta("23.99h")
235
228
  else:
236
229
  raise ValueError(f"Unknown download interval: {download_interval}")
237
230
 
@@ -99,13 +99,19 @@ class DownloadERA5Wave(BaseDownloader):
99
99
  print("You can find your key at: https://cds.climate.copernicus.eu/user/")
100
100
  print("="*60)
101
101
 
102
+ elif "cds-beta.climate.copernicus.eu" in error_msg:
103
+ print("\n" + "="*60)
104
+ print("CDS API AUTHENTICATION ERROR")
105
+ print("="*60)
106
+ print("Your CDS API key appears to be invalid.")
107
+ print("This is likely due to an update by the Copernicus Climate Data Store.")
108
+ print("Please check your .cdsapirc file and ensure your API key is correct.")
109
+ print("You can find your key at: https://cds.climate.copernicus.eu/user/")
110
+ print("="*60)
111
+
102
112
  else:
103
- # For any other errors, show the original message if verbose
104
- if self.verbose:
105
- print(f"Failed to download via CDS API: {e}")
106
- else:
107
- # Always show some info for unhandled errors
108
- print(f"\nCDS API Error: {e}")
113
+ print(f"Failed to download via CDS API: {e}")
114
+
109
115
 
110
116
  return False
111
117
 
@@ -229,4 +235,4 @@ class MergeERA5Wave(BaseMerger):
229
235
  if 'latitude' in merged.coords:
230
236
  merged = merged.sortby("latitude")
231
237
 
232
- return merged, skipped_files
238
+ return merged, skipped_files
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tfv_get_tools
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Tool for downloading and processing data for TUFLOW FV modelling
5
5
  Author-email: Alex Waterhouse <alex.waterhouse@apac.bmt.org>, Mitchell Smith <mitchell.smith@apac.bmt.org>, TUFLOW Support <support@tuflow.com>
6
6
  License: MIT
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
19
  Requires-Python: <3.14,>=3.9
20
20
  Description-Content-Type: text/markdown
21
+ License-File: LICENSE
21
22
  Requires-Dist: netCDF4>=1.6.2
22
23
  Requires-Dist: tqdm>=4.65.0
23
24
  Requires-Dist: xarray>=2023.1.0
@@ -41,6 +42,7 @@ Requires-Dist: sphinx>=7.3.7; extra == "dev"
41
42
  Requires-Dist: recommonmark>=0.7.1; extra == "dev"
42
43
  Requires-Dist: sphinx-markdown-builder>=0.6.6; extra == "dev"
43
44
  Requires-Dist: pyprojroot; extra == "dev"
45
+ Dynamic: license-file
44
46
 
45
47
  # TFV Get Tools
46
48
 
@@ -58,22 +60,22 @@ TFV Get Tools is a Python package that simplifies the process of downloading and
58
60
  ### Supported Data Sources
59
61
 
60
62
  **Atmospheric Data:**
61
- - [ECMWF ERA5](https://www.ecmwf.int/en/forecasts/datasets/reanalysis-datasets/era5) (Default - registration required, see [CDS API](https://cds.climate.copernicus.eu/api-how-to))
63
+ - [ECMWF ERA5](https://www.ecmwf.int/en/forecasts/datasets/reanalysis-datasets/era5) (*Atmos Default* - registration required, see [CDS API](https://cds.climate.copernicus.eu/api-how-to))
62
64
  - [NOAA CFSR](https://www.ncei.noaa.gov/data/climate-forecast-system/) (Climate Forecast System Reanalysis)
63
65
  - [BARRA2](http://www.bom.gov.au/research/projects/reanalysis/) (Australian Bureau of Meteorology)
64
66
 
65
67
  **Ocean Data:**
66
- - [HYCOM](https://www.hycom.org/) (Naval Research Laboratory - Global Ocean Forecast System)
68
+ - [HYCOM](https://www.hycom.org/) (*Ocean Default* Naval Research Laboratory - Global Ocean Forecast System)
67
69
  - [Copernicus Marine](https://marine.copernicus.eu/) Global and NWS (registration required, see [Copernicus Marine Service](https://marine.copernicus.eu/))
68
70
 
69
71
  **Wave Data:**
70
- - [CSIRO CAWCR](https://data.csiro.au/collection/csiro:39819) (glob_24m, aus_10m, aus_4m, pac_10m, pac_4m)
72
+ - [CSIRO CAWCR](https://data.csiro.au/collection/csiro:39819) (*Wave Default* glob_24m, aus_10m, aus_4m, pac_10m, pac_4m)
71
73
  - [Copernicus Marine](https://marine.copernicus.eu/) Global and NWS
72
74
  - [ECMWF ERA5](https://www.ecmwf.int/en/forecasts/datasets/reanalysis-datasets/era5) (registration required, see [CDS API](https://cds.climate.copernicus.eu/api-how-to))
73
75
 
74
76
  **Tidal Data:**
75
77
  - [FES2014](https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html) (AVISO+ Finite Element Solution 2014)
76
- - [FES2022](https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html) (AVISO+ Finite Element Solution 2022)
78
+ - [FES2022](https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html) (*Tide Default* AVISO+ Finite Element Solution 2022)
77
79
 
78
80
  ## Installation
79
81
 
@@ -255,7 +257,6 @@ This package utilises data from multiple authoritative sources. Please ensure ap
255
257
  For questions, bug reports, or feature requests:
256
258
  - 📧 **Email**: support@tuflow.com
257
259
  - 🐛 **Issues**: Submit via the project repository
258
- - 📖 **Documentation**: [Link to documentation] (if available)
259
260
 
260
261
  ## Contributing
261
262
 
@@ -275,7 +276,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
275
276
 
276
277
  ## Authors
277
278
 
278
- Developed by [BMT](https://www.bmt.org/), 2025
279
+ Developed by [TUFLOW](https://www.tuflow.com/), 2025
279
280
 
280
281
  ## Project Status
281
282
 
@@ -16,7 +16,7 @@ tfv_get_tools/fvc/_tide.py,sha256=tjs4GTg4NRIa7cFcBNFqMqo-yMzOZ6BKgdixSWZafTo,63
16
16
  tfv_get_tools/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  tfv_get_tools/providers/_custom_conversions.py,sha256=0w9wUkq2k4yireErfLwKKRaj6RkWDC_Cash7raqrGho,927
18
18
  tfv_get_tools/providers/_downloader.py,sha256=zLwYSweTKYJ_OmtikwzEQRw1s8Rc4Ma1aCIqY1jIxXM,19786
19
- tfv_get_tools/providers/_merger.py,sha256=g4-_6ft9gGwBinqzuKm3zMvk8wztvwDiStb45zj_TgQ,18602
19
+ tfv_get_tools/providers/_merger.py,sha256=gj6NkEsdx2QIUT8QmhaOzEXaFKEjpqBEmf_g2qaufzo,18367
20
20
  tfv_get_tools/providers/_utilities.py,sha256=8JiiadD8OGsMjZhGn8ce8s7vqtYZpDB-oQFieGAvKeA,7873
21
21
  tfv_get_tools/providers/atmos/barra2.py,sha256=8k_NJdlHwNgc2FMElabWaycuAdJBRARGc9QfzzDxQXc,6820
22
22
  tfv_get_tools/providers/atmos/cfsr.py,sha256=Cf_6mCBiPi1SCUd3NDX_psmDdITU1lqwqf5vNhj7ttY,8055
@@ -36,7 +36,7 @@ tfv_get_tools/providers/ocean/cfgs/copernicus_nws.yaml,sha256=rQhSEynvKgypohDhyI
36
36
  tfv_get_tools/providers/ocean/cfgs/hycom.yaml,sha256=GQoEcyLYmF_PRPXeY2IO7jiqFcZad7y8bzPjsBn9PS4,1599
37
37
  tfv_get_tools/providers/wave/cawcr.py,sha256=95YZCewImgtldiDj6qJ6lkcIo_QIz2rFTYDB0qwkwVk,6028
38
38
  tfv_get_tools/providers/wave/copernicus_wave.py,sha256=FeoJUSDMH_tuo29VoZYSDXalra-lcfm9Mue--fJ-E7U,1031
39
- tfv_get_tools/providers/wave/era5.py,sha256=Re_auemuSl0dX-uW44VD86DwqiGAoE9YUja356XWJ5I,8860
39
+ tfv_get_tools/providers/wave/era5.py,sha256=ku7UyXVpS6mYtGvUnL_g9Ginwbykja1X3d9Jlwj3bpU,9171
40
40
  tfv_get_tools/providers/wave/era5_gcp.py,sha256=hLY_4YqQxhQ-P9uPC30Knv_LJ4vFMu1ZJJbGccR4xb8,6165
41
41
  tfv_get_tools/providers/wave/cfgs/cawcr_aus_10m.yaml,sha256=PCk6fkYHTD1uMv1oZP_7M4BuFWMxLaUdZmbbrJ4zA4w,936
42
42
  tfv_get_tools/providers/wave/cfgs/cawcr_aus_4m.yaml,sha256=LJ-8C8PFzVO4nmIMM4CUfhHsnnb1cTdKeYRr_DLIFKI,935
@@ -55,8 +55,9 @@ tfv_get_tools/utilities/horizontal_padding.py,sha256=-bqLDzqm17fOZqYrjJPXYwdVYwo
55
55
  tfv_get_tools/utilities/land_masking.py,sha256=19r9iiMMqxXChGlfmmXPzEM5VyhsnR-nqTsSjaKzP34,2743
56
56
  tfv_get_tools/utilities/parsers.py,sha256=V4ZBcpLPtSbkM3k5XoZS_xpauJVEzHUs9woNHznbHI4,1284
57
57
  tfv_get_tools/utilities/warnings.py,sha256=GWrj7Jh2gU3b9u2kzSfaqYPk8cL9aeMbkJgspn0a9W8,1146
58
- tfv_get_tools-0.2.0.dist-info/METADATA,sha256=oaxLWZhUTNu5I7ZLy4jHlWHR8SVCDPEtsAeEvNksP5U,10662
59
- tfv_get_tools-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
- tfv_get_tools-0.2.0.dist-info/entry_points.txt,sha256=pTCS55WUArvFH-Z_EsjTpICz9p1rqqVJ10e7aX3S2MA,194
61
- tfv_get_tools-0.2.0.dist-info/top_level.txt,sha256=K_ewT8V9jhtf59kUDU5YqahUczoInqs7ZFlc4Ho3IjE,14
62
- tfv_get_tools-0.2.0.dist-info/RECORD,,
58
+ tfv_get_tools-0.2.2.dist-info/licenses/LICENSE,sha256=ALmu4D6vRZ-Xxz6IjzUIc_XyZGfVIWCOxIA1qe3tnVY,1059
59
+ tfv_get_tools-0.2.2.dist-info/METADATA,sha256=m5YM9Y9L2HT7qqplWIBYcD5blW5JTI2qZnwRSFm1A5c,10701
60
+ tfv_get_tools-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
+ tfv_get_tools-0.2.2.dist-info/entry_points.txt,sha256=pTCS55WUArvFH-Z_EsjTpICz9p1rqqVJ10e7aX3S2MA,194
62
+ tfv_get_tools-0.2.2.dist-info/top_level.txt,sha256=K_ewT8V9jhtf59kUDU5YqahUczoInqs7ZFlc4Ho3IjE,14
63
+ tfv_get_tools-0.2.2.dist-info/RECORD,,
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BMT
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.