wavespectra 3.18.0__tar.gz → 3.19.0__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 (61) hide show
  1. {wavespectra-3.18.0/wavespectra.egg-info → wavespectra-3.19.0}/PKG-INFO +2 -6
  2. {wavespectra-3.18.0 → wavespectra-3.19.0}/pyproject.toml +1 -5
  3. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/__init__.py +1 -1
  4. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/npstats.py +18 -51
  5. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/xrstats.py +7 -4
  6. {wavespectra-3.18.0 → wavespectra-3.19.0/wavespectra.egg-info}/PKG-INFO +2 -6
  7. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra.egg-info/requires.txt +1 -5
  8. {wavespectra-3.18.0 → wavespectra-3.19.0}/AUTHORS.rst +0 -0
  9. {wavespectra-3.18.0 → wavespectra-3.19.0}/LICENSE.txt +0 -0
  10. {wavespectra-3.18.0 → wavespectra-3.19.0}/README.rst +0 -0
  11. {wavespectra-3.18.0 → wavespectra-3.19.0}/setup.cfg +0 -0
  12. {wavespectra-3.18.0 → wavespectra-3.19.0}/setup.py +0 -0
  13. {wavespectra-3.18.0 → wavespectra-3.19.0}/tests/test_cookiecutter_template.py +0 -0
  14. {wavespectra-3.18.0 → wavespectra-3.19.0}/tests/test_specarray.py +0 -0
  15. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/cli.py +0 -0
  16. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/construct/__init__.py +0 -0
  17. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/construct/helpers.py +0 -0
  18. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/construct/jonswap.py +0 -0
  19. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/construct/ochihubble.py +0 -0
  20. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/__init__.py +0 -0
  21. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/attributes.py +0 -0
  22. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/attributes.yml +0 -0
  23. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/select.py +0 -0
  24. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/swan.py +0 -0
  25. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/utils.py +0 -0
  26. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/core/watershed.py +0 -0
  27. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/__init__.py +0 -0
  28. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/dataset.py +0 -0
  29. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/era5.py +0 -0
  30. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/funwave.py +0 -0
  31. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/json.py +0 -0
  32. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/ncswan.py +0 -0
  33. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/ndbc.py +0 -0
  34. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/ndbc_ascii.py +0 -0
  35. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/netcdf.py +0 -0
  36. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/octopus.py +0 -0
  37. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/spotter.py +0 -0
  38. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/swan.py +0 -0
  39. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/triaxys.py +0 -0
  40. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/wavespectra.py +0 -0
  41. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/ww3.py +0 -0
  42. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/ww3_station.py +0 -0
  43. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/input/wwm.py +0 -0
  44. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/__init__.py +0 -0
  45. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/funwave.py +0 -0
  46. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/json.py +0 -0
  47. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/netcdf.py +0 -0
  48. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/octopus.py +0 -0
  49. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/orcaflex.py +0 -0
  50. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/swan.py +0 -0
  51. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/ww3.py +0 -0
  52. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/output/ww3.yml +0 -0
  53. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/plot.py +0 -0
  54. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/specarray.py +0 -0
  55. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/specdataset.py +0 -0
  56. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/specpart/specpart.f90 +0 -0
  57. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra/specpart/specpart.pyf +0 -0
  58. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra.egg-info/SOURCES.txt +0 -0
  59. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra.egg-info/dependency_links.txt +0 -0
  60. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra.egg-info/entry_points.txt +0 -0
  61. {wavespectra-3.18.0 → wavespectra-3.19.0}/wavespectra.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wavespectra
3
- Version: 3.18.0
3
+ Version: 3.19.0
4
4
  Summary: Library for ocean wave spectra
5
5
  Author-email: Wavespectra Developers <r.guedes@oceanum.science>
6
6
  Maintainer-email: Rafael Guedes <r.guedes@oceanum.science>, Tom Durrant <t.durrant@oceanum.science>
@@ -46,16 +46,12 @@ Description-Content-Type: text/x-rst
46
46
  License-File: LICENSE.txt
47
47
  License-File: AUTHORS.rst
48
48
  Requires-Dist: click
49
- Requires-Dist: cmocean
50
49
  Requires-Dist: dask
51
50
  Requires-Dist: matplotlib
52
- Requires-Dist: numba
53
- Requires-Dist: pandas
54
51
  Requires-Dist: python-dateutil
55
52
  Requires-Dist: pyyaml
56
53
  Requires-Dist: sortedcontainers
57
54
  Requires-Dist: scipy
58
- Requires-Dist: toolz
59
55
  Requires-Dist: typing_extensions
60
56
  Requires-Dist: xarray
61
57
  Provides-Extra: test
@@ -65,9 +61,9 @@ Requires-Dist: ruff; extra == "test"
65
61
  Provides-Extra: extra
66
62
  Requires-Dist: fsspec; extra == "extra"
67
63
  Requires-Dist: gcsfs; extra == "extra"
64
+ Requires-Dist: h5netcdf; extra == "extra"
68
65
  Requires-Dist: netCDF4; extra == "extra"
69
66
  Requires-Dist: zarr; extra == "extra"
70
- Requires-Dist: h5netcdf; extra == "extra"
71
67
  Provides-Extra: docs
72
68
  Requires-Dist: autodoc; extra == "docs"
73
69
  Requires-Dist: ipython; extra == "docs"
@@ -33,16 +33,12 @@ classifiers = [
33
33
  requires-python = ">=3.8,<3.12"
34
34
  dependencies = [
35
35
  "click",
36
- "cmocean",
37
36
  "dask",
38
37
  "matplotlib",
39
- "numba",
40
- "pandas",
41
38
  "python-dateutil",
42
39
  "pyyaml",
43
40
  "sortedcontainers",
44
41
  "scipy",
45
- "toolz",
46
42
  "typing_extensions",
47
43
  "xarray",
48
44
  ]
@@ -62,9 +58,9 @@ test = ["pytest", "tox", "ruff"]
62
58
  extra = [
63
59
  "fsspec",
64
60
  "gcsfs",
61
+ "h5netcdf",
65
62
  "netCDF4",
66
63
  "zarr",
67
- "h5netcdf",
68
64
  ]
69
65
  docs = [
70
66
  "autodoc",
@@ -13,7 +13,7 @@ except ImportError:
13
13
  warnings.warn("Cannot import accessors at the main module level")
14
14
 
15
15
 
16
- __version__ = "3.18.0"
16
+ __version__ = "3.19.0"
17
17
 
18
18
 
19
19
  def _import_read_functions(pkgname="input"):
@@ -1,8 +1,7 @@
1
1
  """Wave spectra stats on numpy arrays sourced by apply_ufuncs."""
2
2
  import numpy as np
3
- from numba import guvectorize
4
3
 
5
- from wavespectra.core.utils import D2R, R2D
4
+ from wavespectra.core.utils import R2D
6
5
 
7
6
 
8
7
  def hs(spectrum, freq, dir, tail=True):
@@ -27,15 +26,7 @@ def hs(spectrum, freq, dir, tail=True):
27
26
  return 4.0 * np.sqrt(Etot)
28
27
 
29
28
 
30
- @guvectorize(
31
- "(int64, float64[:], float64[:], float32[:])",
32
- "(), (n), (n) -> ()",
33
- nopython=True,
34
- target="parallel",
35
- cache=True,
36
- forceobj=True,
37
- )
38
- def dpm_gufunc(ipeak, momsin, momcos, out):
29
+ def dpm(ipeak, momsin, momcos):
39
30
  """Mean direction at the peak wave period Dpm.
40
31
 
41
32
  Args:
@@ -48,21 +39,13 @@ def dpm_gufunc(ipeak, momsin, momcos, out):
48
39
 
49
40
  """
50
41
  if not ipeak:
51
- out[0] = np.nan
42
+ return np.nan
52
43
  else:
53
44
  dpm = np.arctan2(momsin[ipeak], momcos[ipeak])
54
- out[0] = np.float32((270 - R2D * dpm) % 360.)
55
-
56
-
57
- @guvectorize(
58
- "(int64, float32[:], float32[:])",
59
- "(), (n) -> ()",
60
- nopython=True,
61
- target="parallel",
62
- cache=True,
63
- forceobj=True,
64
- )
65
- def dp_gufunc(ipeak, dir, out):
45
+ return np.float32((270 - R2D * dpm) % 360.)
46
+
47
+
48
+ def dp(ipeak, dir):
66
49
  """Peak wave direction Dp.
67
50
 
68
51
  Args:
@@ -74,18 +57,10 @@ def dp_gufunc(ipeak, dir, out):
74
57
  frequency-integrated spectrum.
75
58
 
76
59
  """
77
- out[0] = np.float32(dir[ipeak])
78
-
79
-
80
- @guvectorize(
81
- "(int64, float64[:], float32[:], float32[:])",
82
- "(), (n), (n) -> ()",
83
- nopython=True,
84
- target="parallel",
85
- cache=True,
86
- forceobj=True,
87
- )
88
- def tps_gufunc(ipeak, spectrum, freq, out):
60
+ return np.float32(dir[ipeak])
61
+
62
+
63
+ def tps(ipeak, spectrum, freq):
89
64
  """Smooth peak wave period Tp.
90
65
 
91
66
  Args:
@@ -102,7 +77,7 @@ def tps_gufunc(ipeak, spectrum, freq, out):
102
77
 
103
78
  """
104
79
  if not ipeak:
105
- out[0] = np.nan
80
+ return np.nan
106
81
  else:
107
82
  f1 = freq[ipeak - 1]
108
83
  f2 = freq[ipeak]
@@ -115,18 +90,10 @@ def tps_gufunc(ipeak, spectrum, freq, out):
115
90
  q13 = (e1 - e3) / (f1 - f3)
116
91
  qa = (q13 - q12) / (f3 - f2)
117
92
  fp = (s12 - q12 / qa) / 2.0
118
- out[0] = np.float32(1.0 / fp)
119
-
120
-
121
- @guvectorize(
122
- "(int64, float64[:], float32[:], float32[:])",
123
- "(), (n), (n) -> ()",
124
- nopython=True,
125
- target="parallel",
126
- cache=True,
127
- forceobj=True,
128
- )
129
- def tp_gufunc(ipeak, spectrum, freq, out):
93
+ return np.float32(1.0 / fp)
94
+
95
+
96
+ def tp(ipeak, spectrum, freq):
130
97
  """Peak wave period Tp.
131
98
 
132
99
  Args:
@@ -142,6 +109,6 @@ def tp_gufunc(ipeak, spectrum, freq, out):
142
109
 
143
110
  """
144
111
  if not ipeak:
145
- out[0] = np.nan
112
+ return np.nan
146
113
  else:
147
- out[0] = np.float32(1.0 / freq[ipeak])
114
+ return np.float32(1.0 / freq[ipeak])
@@ -34,10 +34,11 @@ def peak_wave_direction(dset):
34
34
 
35
35
  # Apply function over the full dataset
36
36
  darr = xr.apply_ufunc(
37
- npstats.dp_gufunc,
37
+ npstats.dp,
38
38
  ipeak.astype("int64"),
39
39
  dset[attrs.DIRNAME].astype("float32"),
40
40
  input_core_dims=[[], [attrs.DIRNAME]],
41
+ vectorize=True,
41
42
  dask="parallelized",
42
43
  output_dtypes=["float32"],
43
44
  )
@@ -81,11 +82,12 @@ def mean_direction_at_peak_wave_period(dset):
81
82
 
82
83
  # Apply function over the full dataset
83
84
  darr = xr.apply_ufunc(
84
- npstats.dpm_gufunc,
85
+ npstats.dpm,
85
86
  ipeak.astype("int64"),
86
87
  msin.astype("float64"),
87
88
  mcos.astype("float64"),
88
89
  input_core_dims=[[], [attrs.FREQNAME], [attrs.FREQNAME]],
90
+ vectorize=True,
89
91
  dask="parallelized",
90
92
  output_dtypes=["float32"],
91
93
  )
@@ -115,9 +117,9 @@ def peak_wave_period(dset, smooth=True):
115
117
 
116
118
  # Choose peak period function
117
119
  if smooth:
118
- func = npstats.tps_gufunc
120
+ func = npstats.tps
119
121
  else:
120
- func = npstats.tp_gufunc
122
+ func = npstats.tp
121
123
 
122
124
  # Integrate over directions
123
125
  if attrs.DIRNAME in dset.dims:
@@ -136,6 +138,7 @@ def peak_wave_period(dset, smooth=True):
136
138
  dset.astype("float64"),
137
139
  dset[attrs.FREQNAME].astype("float32"),
138
140
  input_core_dims=[[], [attrs.FREQNAME], [attrs.FREQNAME]],
141
+ vectorize=True,
139
142
  dask="parallelized",
140
143
  output_dtypes=["float32"],
141
144
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wavespectra
3
- Version: 3.18.0
3
+ Version: 3.19.0
4
4
  Summary: Library for ocean wave spectra
5
5
  Author-email: Wavespectra Developers <r.guedes@oceanum.science>
6
6
  Maintainer-email: Rafael Guedes <r.guedes@oceanum.science>, Tom Durrant <t.durrant@oceanum.science>
@@ -46,16 +46,12 @@ Description-Content-Type: text/x-rst
46
46
  License-File: LICENSE.txt
47
47
  License-File: AUTHORS.rst
48
48
  Requires-Dist: click
49
- Requires-Dist: cmocean
50
49
  Requires-Dist: dask
51
50
  Requires-Dist: matplotlib
52
- Requires-Dist: numba
53
- Requires-Dist: pandas
54
51
  Requires-Dist: python-dateutil
55
52
  Requires-Dist: pyyaml
56
53
  Requires-Dist: sortedcontainers
57
54
  Requires-Dist: scipy
58
- Requires-Dist: toolz
59
55
  Requires-Dist: typing_extensions
60
56
  Requires-Dist: xarray
61
57
  Provides-Extra: test
@@ -65,9 +61,9 @@ Requires-Dist: ruff; extra == "test"
65
61
  Provides-Extra: extra
66
62
  Requires-Dist: fsspec; extra == "extra"
67
63
  Requires-Dist: gcsfs; extra == "extra"
64
+ Requires-Dist: h5netcdf; extra == "extra"
68
65
  Requires-Dist: netCDF4; extra == "extra"
69
66
  Requires-Dist: zarr; extra == "extra"
70
- Requires-Dist: h5netcdf; extra == "extra"
71
67
  Provides-Extra: docs
72
68
  Requires-Dist: autodoc; extra == "docs"
73
69
  Requires-Dist: ipython; extra == "docs"
@@ -1,14 +1,10 @@
1
1
  click
2
- cmocean
3
2
  dask
4
3
  matplotlib
5
- numba
6
- pandas
7
4
  python-dateutil
8
5
  pyyaml
9
6
  sortedcontainers
10
7
  scipy
11
- toolz
12
8
  typing_extensions
13
9
  xarray
14
10
 
@@ -24,9 +20,9 @@ sphinx-gallery
24
20
  [extra]
25
21
  fsspec
26
22
  gcsfs
23
+ h5netcdf
27
24
  netCDF4
28
25
  zarr
29
- h5netcdf
30
26
 
31
27
  [test]
32
28
  pytest
File without changes
File without changes
File without changes
File without changes
File without changes