resourcecode 1.1.3__tar.gz → 2.0.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 (108) hide show
  1. {resourcecode-1.1.3 → resourcecode-2.0.0}/CHANGELOG.md +6 -1
  2. {resourcecode-1.1.3 → resourcecode-2.0.0}/CITATION.cff +1 -1
  3. {resourcecode-1.1.3 → resourcecode-2.0.0}/MANIFEST.in +6 -2
  4. {resourcecode-1.1.3 → resourcecode-2.0.0}/PKG-INFO +54 -60
  5. {resourcecode-1.1.3 → resourcecode-2.0.0}/README.md +23 -38
  6. {resourcecode-1.1.3 → resourcecode-2.0.0}/examples/plot_0_Database_exploration.py +3 -6
  7. {resourcecode-1.1.3 → resourcecode-2.0.0}/examples/plot_1_data_extraction.py +5 -12
  8. {resourcecode-1.1.3 → resourcecode-2.0.0}/examples/plot_2_Multivariate_Extremes.py +1 -0
  9. {resourcecode-1.1.3 → resourcecode-2.0.0}/examples/plot_3_Operation_Planning.py +4 -15
  10. {resourcecode-1.1.3 → resourcecode-2.0.0}/examples/plot_4_Producible.py +4 -9
  11. {resourcecode-1.1.3 → resourcecode-2.0.0}/fp_hs.png +0 -0
  12. resourcecode-2.0.0/pyproject.toml +109 -0
  13. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/__version__.py +1 -1
  14. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/client.py +4 -14
  15. resourcecode-2.0.0/resourcecode/config/config.ini +4 -0
  16. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/eva/censgaussfit.py +17 -12
  17. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/eva/huseby.py +5 -18
  18. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/eva/simulation.py +2 -2
  19. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/io.py +2 -6
  20. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/opsplanning/__init__.py +10 -29
  21. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/producible_assessment/main.py +10 -24
  22. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/resassess/__init__.py +4 -11
  23. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/compute_parameters.py +18 -18
  24. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/convert2D1D.py +2 -4
  25. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/download_data.py +16 -38
  26. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/jonswap.py +10 -21
  27. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/plots.py +1 -1
  28. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/utils.py +1 -0
  29. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/weatherwindow/__init__.py +0 -1
  30. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/weatherwindow/weatherwindow.py +1 -1
  31. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode.egg-info/PKG-INFO +54 -60
  32. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode.egg-info/SOURCES.txt +4 -3
  33. resourcecode-2.0.0/resourcecode.egg-info/requires.txt +24 -0
  34. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode.egg-info/top_level.txt +0 -1
  35. resourcecode-2.0.0/tests/conftest.py +27 -0
  36. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_client.py +3 -9
  37. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_resassess.py +11 -11
  38. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_spectrum.py +16 -13
  39. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_weather_window.py +3 -9
  40. {resourcecode-1.1.3 → resourcecode-2.0.0}/tox.ini +16 -9
  41. resourcecode-2.0.0/uv.lock +1917 -0
  42. resourcecode-1.1.3/dev_requirements.txt +0 -1
  43. resourcecode-1.1.3/resourcecode.egg-info/not-zip-safe +0 -1
  44. resourcecode-1.1.3/resourcecode.egg-info/requires.txt +0 -11
  45. resourcecode-1.1.3/setup.py +0 -109
  46. {resourcecode-1.1.3 → resourcecode-2.0.0}/CLA/RESOURCECODE-Entity.pdf +0 -0
  47. {resourcecode-1.1.3 → resourcecode-2.0.0}/CLA/RESOURCECODE-Individual.pdf +0 -0
  48. {resourcecode-1.1.3 → resourcecode-2.0.0}/COPYING +0 -0
  49. {resourcecode-1.1.3 → resourcecode-2.0.0}/LICENSE +0 -0
  50. {resourcecode-1.1.3 → resourcecode-2.0.0}/config/config.ini +0 -0
  51. {resourcecode-1.1.3 → resourcecode-2.0.0}/examples/README.rst +0 -0
  52. {resourcecode-1.1.3 → resourcecode-2.0.0}/mypy.ini +0 -0
  53. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/__init__.py +0 -0
  54. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/__init__.py +0 -0
  55. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/coastline.feather +0 -0
  56. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/grid_FIELD.feather +0 -0
  57. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/grid_SPEC.feather +0 -0
  58. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/islands.feather +0 -0
  59. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/netcdf_description.json +0 -0
  60. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/triangles.feather +0 -0
  61. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/data/variables.feather +0 -0
  62. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/eva/__init__.py +0 -0
  63. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/eva/extrema.py +0 -0
  64. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/exceptions.py +0 -0
  65. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/plotly_theme.py +0 -0
  66. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/Frequencies.csv +0 -0
  67. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/HsTptimeseries.csv +0 -0
  68. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/PTO_values.csv +0 -0
  69. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/capture_width.csv +0 -0
  70. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/producible_assessment/__init__.py +0 -0
  71. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/__init__.py +0 -0
  72. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode/spectrum/dispersion.py +0 -0
  73. {resourcecode-1.1.3 → resourcecode-2.0.0}/resourcecode.egg-info/dependency_links.txt +0 -0
  74. {resourcecode-1.1.3 → resourcecode-2.0.0}/setup.cfg +0 -0
  75. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/__init__.py +0 -0
  76. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/censgaussfit/input_0.csv +0 -0
  77. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/censgaussfit/output_0.csv +0 -0
  78. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/huseby/input_0.csv +0 -0
  79. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/huseby/output_0.csv +0 -0
  80. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/huseby/output_1.csv +0 -0
  81. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/opsplanning/input.csv +0 -0
  82. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/df_average_energy.csv +0 -0
  83. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/df_number_occurence.csv +0 -0
  84. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/df_percentage_occurence.csv +0 -0
  85. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/df_standard_deviation_energy.csv +0 -0
  86. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/input.csv +0 -0
  87. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/monthly_stat.csv +0 -0
  88. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/resassess/yearly_stat.csv +0 -0
  89. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/Etfh.csv +0 -0
  90. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/RSCD_WW3-RSCD-UG-W001933N55743_201605_freq.nc +0 -0
  91. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/W001933N55743_201605.nc +0 -0
  92. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/depth.csv +0 -0
  93. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/dir.csv +0 -0
  94. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/freq.csv +0 -0
  95. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/parameters_1D.csv +0 -0
  96. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/parameters_2D.csv +0 -0
  97. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/spectrum/spec.csv +0 -0
  98. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/timeseries_fp.json +0 -0
  99. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/timeseries_hs.json +0 -0
  100. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/timeseries_uust.json +0 -0
  101. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/data/weather_window/hs.csv +0 -0
  102. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/output/empty.out +0 -0
  103. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_data.py +0 -0
  104. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_eva.py +0 -0
  105. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_netfcd.py +0 -0
  106. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_opsplanning.py +0 -0
  107. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_producible_assessment.py +0 -0
  108. {resourcecode-1.1.3 → resourcecode-2.0.0}/tests/test_utils.py +0 -0
@@ -1,7 +1,12 @@
1
+ ## Version 1.3.1 (TBD)
2
+ ### 👷 Bug fixes
3
+ - Pin version of Numpy to be < 2.0.0 because `trapz` is renamed in higher versions
4
+ - Pin version of Scipy to be < 1.14.0 because `mvnun` is deprecated in higher versions
5
+
1
6
  ## Version 1.3 (18/03/2024)
2
7
  ### 🎉 New Features
3
8
  - Add support for pandas 2.X branch
4
-
9
+
5
10
  ## Version 1.2 (15/3/2024)
6
11
  ### 🎉 New Features
7
12
  - Add support for python 3.12
@@ -8,7 +8,7 @@ type: software
8
8
  license: 'GPL-3.0-or-later'
9
9
  repository-code: "https://resourcecode-project.github.io/py-resourcecode/"
10
10
  url: "https://resourcecode-project.github.io/py-resourcecode/"
11
- version: 1.1.3
11
+ version: 1.3.1
12
12
  date-released: '2023-03-18'
13
13
  authors:
14
14
  - given-names: Nicolas
@@ -2,16 +2,19 @@ include LICENSE
2
2
  include CITATION.cff
3
3
  include tox.ini
4
4
  include mypy.ini
5
- include config/config.ini
6
- include dev_requirements.txt
7
5
  include fp_hs.png
8
6
  exclude .gitlab-ci.yml .gitlab-ci-ifremer.yml
9
7
  include *.md
8
+ include uv.lock
9
+ include *.txt
10
10
 
11
+ recursive-include config *.ini
11
12
  recursive-include notebooks *.ipynb
13
+ global-exclude **/.ipynb_checkpoints/*
12
14
  recursive-include resourcecode *.py
13
15
  recursive-include resourcecode/data *.feather *.json
14
16
  recursive-include resourcecode *.csv
17
+ recursive-include resourcecode/config *.ini
15
18
 
16
19
  recursive-include examples *.py
17
20
  recursive-include examples *.rst
@@ -22,6 +25,7 @@ recursive-include CLA *.pdf
22
25
 
23
26
  recursive-exclude joss_paper *
24
27
  exclude joss_paper
28
+ exclude dev_requirements.txt
25
29
 
26
30
  prune codes_to_migrate
27
31
  prune doc
@@ -1,11 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: resourcecode
3
- Version: 1.1.3
4
- Summary: The ResourceCODE Marine Data Toolbox is a python package to facilitate the access to recent hindcast database of sea-state , along with a set of state-of-the-art methods for data analysis.
5
- Home-page: https://gitlab.ifremer.fr/resourcecode/resourcecode
6
- Author: Nicolas Raillard (IFREMER, Brest)
7
- Author-email: nicolas.raillard@ifremer.fr
8
- License: GPL-v3.0
3
+ Version: 2.0.0
4
+ Summary: The ResourceCODE Marine Data Toolbox is a python package to facilitate the access to recent hindcast database of sea-state, along with a set of state-of-the-art methods for data analysis.
5
+ Author-email: Nicolas Raillard <nicolas.raillard@ifremer.fr>
6
+ License: GPL-3.0-or-later
7
+ Project-URL: Homepage, https://resourcecode-project.github.io/py-resourcecode/
9
8
  Project-URL: GitHub, https://github.com/Resourcecode-project/py-resourcecode
10
9
  Project-URL: Web Portal, https://resourcecode.ifremer.fr
11
10
  Project-URL: PyPI, https://pypi.org/project/resourcecode
@@ -14,38 +13,48 @@ Classifier: Development Status :: 5 - Production/Stable
14
13
  Classifier: Intended Audience :: Science/Research
15
14
  Classifier: Intended Audience :: Developers
16
15
  Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
16
  Classifier: Programming Language :: Python :: 3.11
20
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
21
19
  Classifier: Programming Language :: Python :: 3 :: Only
22
20
  Classifier: Operating System :: OS Independent
23
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
24
21
  Classifier: Topic :: Scientific/Engineering
25
22
  Classifier: Topic :: Scientific/Engineering :: Mathematics
26
23
  Classifier: Topic :: Scientific/Engineering :: Physics
27
- Requires-Python: >=3.9, <3.13
24
+ Requires-Python: <3.14,>=3.11
28
25
  Description-Content-Type: text/markdown
29
26
  License-File: LICENSE
30
27
  License-File: COPYING
31
- Requires-Dist: pandas<3.0.0,>=1.0.0
32
- Requires-Dist: requests>=2.23.0
33
- Requires-Dist: numpy>=1.20.1
34
- Requires-Dist: scipy>=1.6.1
35
- Requires-Dist: pyextremes>=2.0.0
36
- Requires-Dist: pytest>=7.0.0
37
- Requires-Dist: pyarrow>=6.0.0
38
- Requires-Dist: plotly>=4.12.0
39
- Requires-Dist: numexpr>=2.7.0
40
- Requires-Dist: xarray>=0.19.0
41
- Requires-Dist: netCDF4>=1.6.0
28
+ Requires-Dist: pandas<3,>=2.2
29
+ Requires-Dist: requests<3,>=2.31.0
30
+ Requires-Dist: numpy<3,>=2.0
31
+ Requires-Dist: scipy<2,>=1.14.1
32
+ Requires-Dist: pyextremes<3,>=2.5.0
33
+ Requires-Dist: pyarrow<19,>=18.1.0
34
+ Requires-Dist: plotly<7,>=6
35
+ Requires-Dist: xarray>=2024.11.0
36
+ Requires-Dist: netCDF4<2,>=1.7.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: flake8>=3.6; extra == "dev"
39
+ Requires-Dist: black>=19.10b0; extra == "dev"
40
+ Requires-Dist: mypy; extra == "dev"
41
+ Requires-Dist: nbqa; extra == "dev"
42
+ Requires-Dist: check-manifest; extra == "dev"
43
+ Requires-Dist: tox; extra == "dev"
44
+ Requires-Dist: tox-uv; extra == "dev"
45
+ Provides-Extra: doc
46
+ Requires-Dist: sphinx>=4.5; extra == "doc"
47
+ Requires-Dist: sphinx-book-theme; extra == "doc"
48
+ Requires-Dist: sphinx_gallery; extra == "doc"
49
+ Requires-Dist: plotly; extra == "doc"
50
+ Dynamic: license-file
42
51
 
43
52
  # Resourcecode library
44
53
 
45
54
  [![Tests](https://github.com/Resourcecode-project/py-resourcecode/actions/workflows/check.yml/badge.svg)](https://github.com/Resourcecode-project/py-resourcecode/actions/workflows/check.yml)
46
55
  [![PyPI version](https://badge.fury.io/py/resourcecode.svg)](https://badge.fury.io/py/resourcecode)
47
56
  [![Status](https://joss.theoj.org/papers/e43574f4a0b6782ee6a112180912dae0/status.svg)](https://joss.theoj.org/papers/e43574f4a0b6782ee6a112180912dae0)
48
- [![Downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Fresourcecode%2Frecent&query=data.last_month&colorB=brightgreen&suffix=%2FMonth)](https://pypistats.org/packages/2Fresourcecode)
57
+ [![Downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Fresourcecode%2Frecent&query=data.last_month&colorB=brightgreen&suffix=%2FMonth)](https://pypistats.org/packages/resourcecode)
49
58
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
50
59
 
51
60
  ## Description
@@ -66,58 +75,43 @@ in expected environmental conditions,and de-risk investment in future technology
66
75
 
67
76
  ## Installation
68
77
 
69
- ### Dependencies
78
+ ### Requirements
70
79
 
71
- To install the toolbox, the following packages are necessary:
80
+ - Python (>= 3.11, < 3.14)
81
+ - pandas (>= 2.2, < 3)
82
+ - numpy (>= 2.0, < 3)
83
+ - scipy (>= 1.14.1, < 2)
84
+ - xarray (>= 2024.11.0)
85
+ - netCDF4 (>= 1.7.0, < 2)
86
+ - And other dependencies (see `pyproject.toml` for the complete list)
72
87
 
73
- - python (>= 3.9, <3.13)
74
- - pandas (>= 1.0.0)
75
- - requests (>= 2.23.0)
76
- - numpy (>= 1.20.1)
77
- - scipy (>= 1.6.1)
78
- - pyextremes (>= 2.0.0)
79
- - pytest (>7.0.0)
80
- - pyarrow (>= 6.0.0)
81
- - plotly (>= 4.12.0)
82
- - numexpr (>= 2.7.0)
83
- - xarray (>= 0.19.0)
88
+ ### Using uv (recommended)
84
89
 
85
-
86
- ### Using an environment
87
-
88
- Maybe the easiest way to install the toolbox is to create a dedicated virtual
89
- environment:
90
+ The recommended way to install the toolbox is to use [`uv`](https://docs.astral.sh/uv/), a fast Python package installer:
90
91
 
91
92
  ```shell
92
- $ cd /your/work/directory
93
- $ python3 -m venv env-resourcecode
93
+ $ uv pip install resourcecode
94
94
  ```
95
95
 
96
- then, you activate it:
96
+ ### Using pip
97
+
98
+ Alternatively, you can use pip:
97
99
 
98
100
  ```shell
99
- $ source env-resourcecode/bin/activate
100
- (env-resourcecode)$
101
+ $ python -m pip install resourcecode
101
102
  ```
102
103
 
103
- In this virtual environment, you can now install the library. The library is
104
- available on PyPI, and installation is straightforward, using the following
105
- command:
106
-
107
- ```
108
- (env-resourcecode)$ python -m pip install resourcecode
109
- […]
110
- ```
104
+ ### Development installation
111
105
 
112
- To test whether the install has been successful, you can run:
106
+ For development, clone the repository and install with all dependencies:
113
107
 
114
- ```bash
115
- (env-resourcecode)$ python -c "import resourcecode ; print(resourcecode.__version__)"
116
- 1.1.2
108
+ ```shell
109
+ $ git clone https://github.com/Resourcecode-project/py-resourcecode
110
+ $ cd py-resourcecode
111
+ $ uv sync --all-extras --dev
112
+ $ uv run pytest
117
113
  ```
118
114
 
119
- which should print the current locally installed version of `resourcecode`.
120
-
121
115
  ## Example of use
122
116
 
123
117
  Once the library is installed and the configuration is done, you can use the
@@ -3,7 +3,7 @@
3
3
  [![Tests](https://github.com/Resourcecode-project/py-resourcecode/actions/workflows/check.yml/badge.svg)](https://github.com/Resourcecode-project/py-resourcecode/actions/workflows/check.yml)
4
4
  [![PyPI version](https://badge.fury.io/py/resourcecode.svg)](https://badge.fury.io/py/resourcecode)
5
5
  [![Status](https://joss.theoj.org/papers/e43574f4a0b6782ee6a112180912dae0/status.svg)](https://joss.theoj.org/papers/e43574f4a0b6782ee6a112180912dae0)
6
- [![Downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Fresourcecode%2Frecent&query=data.last_month&colorB=brightgreen&suffix=%2FMonth)](https://pypistats.org/packages/2Fresourcecode)
6
+ [![Downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Fresourcecode%2Frecent&query=data.last_month&colorB=brightgreen&suffix=%2FMonth)](https://pypistats.org/packages/resourcecode)
7
7
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
8
8
 
9
9
  ## Description
@@ -24,58 +24,43 @@ in expected environmental conditions,and de-risk investment in future technology
24
24
 
25
25
  ## Installation
26
26
 
27
- ### Dependencies
27
+ ### Requirements
28
28
 
29
- To install the toolbox, the following packages are necessary:
29
+ - Python (>= 3.11, < 3.14)
30
+ - pandas (>= 2.2, < 3)
31
+ - numpy (>= 2.0, < 3)
32
+ - scipy (>= 1.14.1, < 2)
33
+ - xarray (>= 2024.11.0)
34
+ - netCDF4 (>= 1.7.0, < 2)
35
+ - And other dependencies (see `pyproject.toml` for the complete list)
30
36
 
31
- - python (>= 3.9, <3.13)
32
- - pandas (>= 1.0.0)
33
- - requests (>= 2.23.0)
34
- - numpy (>= 1.20.1)
35
- - scipy (>= 1.6.1)
36
- - pyextremes (>= 2.0.0)
37
- - pytest (>7.0.0)
38
- - pyarrow (>= 6.0.0)
39
- - plotly (>= 4.12.0)
40
- - numexpr (>= 2.7.0)
41
- - xarray (>= 0.19.0)
37
+ ### Using uv (recommended)
42
38
 
43
-
44
- ### Using an environment
45
-
46
- Maybe the easiest way to install the toolbox is to create a dedicated virtual
47
- environment:
39
+ The recommended way to install the toolbox is to use [`uv`](https://docs.astral.sh/uv/), a fast Python package installer:
48
40
 
49
41
  ```shell
50
- $ cd /your/work/directory
51
- $ python3 -m venv env-resourcecode
42
+ $ uv pip install resourcecode
52
43
  ```
53
44
 
54
- then, you activate it:
45
+ ### Using pip
46
+
47
+ Alternatively, you can use pip:
55
48
 
56
49
  ```shell
57
- $ source env-resourcecode/bin/activate
58
- (env-resourcecode)$
50
+ $ python -m pip install resourcecode
59
51
  ```
60
52
 
61
- In this virtual environment, you can now install the library. The library is
62
- available on PyPI, and installation is straightforward, using the following
63
- command:
64
-
65
- ```
66
- (env-resourcecode)$ python -m pip install resourcecode
67
- […]
68
- ```
53
+ ### Development installation
69
54
 
70
- To test whether the install has been successful, you can run:
55
+ For development, clone the repository and install with all dependencies:
71
56
 
72
- ```bash
73
- (env-resourcecode)$ python -c "import resourcecode ; print(resourcecode.__version__)"
74
- 1.1.2
57
+ ```shell
58
+ $ git clone https://github.com/Resourcecode-project/py-resourcecode
59
+ $ cd py-resourcecode
60
+ $ uv sync --all-extras --dev
61
+ $ uv run pytest
75
62
  ```
76
63
 
77
- which should print the current locally installed version of `resourcecode`.
78
-
79
64
  ## Example of use
80
65
 
81
66
  Once the library is installed and the configuration is done, you can use the
@@ -3,6 +3,7 @@
3
3
  Visualize the database configuration: nodes, bathymetry...
4
4
  ==========================================================
5
5
  """
6
+
6
7
  import resourcecode
7
8
  import numpy as np
8
9
  import matplotlib.pyplot as plot
@@ -27,9 +28,7 @@ resourcecode.get_grid_spec()
27
28
  # the requested location (in meters).
28
29
 
29
30
  # We select the closest node from given coordinates
30
- selected_node = resourcecode.data.get_closest_point(
31
- latitude=48.3026514, longitude=-4.6861533
32
- )
31
+ selected_node = resourcecode.data.get_closest_point(latitude=48.3026514, longitude=-4.6861533)
33
32
  selected_node
34
33
 
35
34
  # %%
@@ -80,9 +79,7 @@ plot.show()
80
79
  # of code shows and example of such a map.
81
80
 
82
81
  # Importing the data for plotting
83
- tri = (
84
- resourcecode.get_triangles().to_numpy() - 1
85
- ) # The '-1' is due to the Zero-based numbering of python
82
+ tri = resourcecode.get_triangles().to_numpy() - 1 # The '-1' is due to the Zero-based numbering of python
86
83
  field_mesh = resourcecode.data.get_grid_field().to_numpy()
87
84
  triang = mtri.Triangulation(field_mesh[:, 1], field_mesh[:, 2], tri)
88
85
 
@@ -3,6 +3,7 @@
3
3
  Extract some time-series from the database and analysis
4
4
  ==========================================================
5
5
  """
6
+
6
7
  import resourcecode
7
8
  import resourcecode.spectrum
8
9
  import matplotlib.pyplot as plot
@@ -15,14 +16,10 @@ plot.rcParams["figure.dpi"] = 400
15
16
  # Below, we will look for data next to the location of interest, located in the vicinity of Brest Bay.
16
17
  # We will look at the time-series data and also some spectral data
17
18
  #
18
- selected_node = resourcecode.data.get_closest_point(
19
- latitude=48.3026514, longitude=-4.6861533
20
- )
19
+ selected_node = resourcecode.data.get_closest_point(latitude=48.3026514, longitude=-4.6861533)
21
20
  selected_node
22
21
  # %%
23
- selected_specPoint = resourcecode.data.get_closest_station(
24
- latitude=48.3026514, longitude=-4.6861533
25
- )
22
+ selected_specPoint = resourcecode.data.get_closest_station(latitude=48.3026514, longitude=-4.6861533)
26
23
  selected_specPoint
27
24
 
28
25
  # %%
@@ -77,9 +74,7 @@ plot.tight_layout()
77
74
  # corresponding to the orange dots of the web portal. This is possible thanks to the `get_2D_spectrum` and
78
75
  # `get_1D_spectrum` from the *spectrum* module. An example is shown below:
79
76
 
80
- spec = resourcecode.spectrum.get_2D_spectrum(
81
- selected_specPoint[0], years=["2010"], months=["01"]
82
- )
77
+ spec = resourcecode.spectrum.get_2D_spectrum(selected_specPoint[0], years=["2010"], months=["01"])
83
78
 
84
79
  # %%
85
80
  # And we offer function to represent the spectral data, both for 2D and 1D spectrum.
@@ -97,7 +92,5 @@ resourcecode.spectrum.plot_1D_spectrum(spec1D, 1, sea_state=False)
97
92
  # Among the functionalities of the toolbox, it is possible to compute the sea-state parameters from spectral data. Small
98
93
  # discrepancies can be found between the Hindcast sea-state parameters and the one computed with the toolbox.
99
94
 
100
- parameters_df = resourcecode.spectrum.compute_parameters_from_2D_spectrum(
101
- spec, use_depth=True
102
- )
95
+ parameters_df = resourcecode.spectrum.compute_parameters_from_2D_spectrum(spec, use_depth=True)
103
96
  parameters_df.head()
@@ -3,6 +3,7 @@
3
3
  Modelling multivariate extremes
4
4
  ===============================
5
5
  """
6
+
6
7
  # %%
7
8
  # Extreme value modelling is a central topic in the design of offshore structures.
8
9
  #
@@ -3,6 +3,7 @@
3
3
  Use-case example of the Operational Planning module
4
4
  ===================================================
5
5
  """
6
+
6
7
  # %%
7
8
  #
8
9
  # In this page, we will present some of the functionalities offered by the toolbox
@@ -34,9 +35,7 @@ MONTH_NAMES = list(calendar.month_name)
34
35
  #
35
36
  # We have selected a location next to Ushant island, node number `36855`
36
37
 
37
- data = client.get_dataframe_from_url(
38
- "https://resourcecode.ifremer.fr/explore?pointId=136855", parameters=("hs", "tp")
39
- )
38
+ data = client.get_dataframe_from_url("https://resourcecode.ifremer.fr/explore?pointId=136855", parameters=("hs", "tp"))
40
39
 
41
40
  # %%
42
41
  # Weather windows
@@ -69,12 +68,7 @@ data_matching_criteria = data.query(criteria)
69
68
 
70
69
  windetect = ww_calc(data_matching_criteria, winlen=winlen, concurrent_windows=False)
71
70
  results = wwmonstats(windetect)
72
- stats = (
73
- results.describe(percentiles=percentiles)
74
- .drop(["count", "std"])
75
- .transpose()
76
- .sort_index()
77
- )
71
+ stats = results.describe(percentiles=percentiles).drop(["count", "std"]).transpose().sort_index()
78
72
 
79
73
  # %%
80
74
  # Plotting the monthly statistics
@@ -142,12 +136,7 @@ critical_operation = False
142
136
 
143
137
  oplendetect = oplen_calc(data_matching_criteria, oplen, critical_operation)
144
138
  results = olmonstats(oplendetect)
145
- stats = (
146
- results.describe(percentiles=percentiles)
147
- .drop(["count", "std"])
148
- .transpose()
149
- .sort_index()
150
- )
139
+ stats = results.describe(percentiles=percentiles).drop(["count", "std"]).transpose().sort_index()
151
140
 
152
141
  # %%
153
142
  # And finally produce visual exploration of the durations.
@@ -7,6 +7,7 @@ In this example, we will estimate WEC energy production using the ResourceCode h
7
7
  data as an input and capture width data of a standard WEC to simulate the behaviour and estimate
8
8
  energy that can be harvested with this device from the slected location.
9
9
  """
10
+
10
11
  # %%
11
12
  # .. seealso::
12
13
  # In addition, a demonstration tool based on this module can be accessed on
@@ -57,9 +58,7 @@ plt.show()
57
58
  # For this example, we used the data from the SEMREVO location.
58
59
  # We only need the frequency spectrum in this case, so we convert it to a pandas DataFrame.
59
60
 
60
- spec1D = resourcecode.spectrum.download_data.get_1D_spectrum(
61
- "SEMREVO", ["2014"], ["02"]
62
- )
61
+ spec1D = resourcecode.spectrum.download_data.get_1D_spectrum("SEMREVO", ["2014"], ["02"])
63
62
  spec = spec1D.ef.to_pandas()
64
63
 
65
64
  # The frequency has been truncated, so here we reconcile both
@@ -172,9 +171,7 @@ pto_damp_kn.plot.hist(
172
171
  ax=ax2,
173
172
  bins=len(pto.capture_width.columns),
174
173
  legend=False,
175
- weights=np.ones_like(pto_damp_kn[pto_damp_kn.columns[0]])
176
- * 100.0
177
- / len(pto_damp_kn),
174
+ weights=np.ones_like(pto_damp_kn[pto_damp_kn.columns[0]]) * 100.0 / len(pto_damp_kn),
178
175
  )
179
176
  ax2.grid()
180
177
  ax2.set_xlabel("PTO damping (kN.s/m)")
@@ -214,9 +211,7 @@ pto_damp_kn.plot.hist(
214
211
  ax=ax4,
215
212
  bins=len(pto.capture_width.columns),
216
213
  legend=False,
217
- weights=np.ones_like(pto_damp_kn[pto_damp_kn.columns[0]])
218
- * 100.0
219
- / len(pto_damp_kn),
214
+ weights=np.ones_like(pto_damp_kn[pto_damp_kn.columns[0]]) * 100.0 / len(pto_damp_kn),
220
215
  )
221
216
  ax4.grid()
222
217
  ax4.set_xlabel("PTO damping (kN.s/m) - JONWSAP")
@@ -0,0 +1,109 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "resourcecode"
7
+ dynamic = ["version"]
8
+ description = "The ResourceCODE Marine Data Toolbox is a python package to facilitate the access to recent hindcast database of sea-state, along with a set of state-of-the-art methods for data analysis."
9
+ readme = "README.md"
10
+ license = {text = "GPL-3.0-or-later"}
11
+ requires-python = ">=3.11, <3.14"
12
+ authors = [
13
+ {name = "Nicolas Raillard", email = "nicolas.raillard@ifremer.fr"}
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Intended Audience :: Science/Research",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3 :: Only",
24
+ "Operating System :: OS Independent",
25
+ "Topic :: Scientific/Engineering",
26
+ "Topic :: Scientific/Engineering :: Mathematics",
27
+ "Topic :: Scientific/Engineering :: Physics",
28
+ ]
29
+ keywords = [
30
+ "statistics",
31
+ "extreme",
32
+ "extreme value analysis",
33
+ "eva",
34
+ "coastal",
35
+ "ocean",
36
+ "marine",
37
+ "environmental",
38
+ "engineering",
39
+ "renewable",
40
+ "MRE",
41
+ "offshore",
42
+ "data",
43
+ "hindcast",
44
+ ]
45
+
46
+ # Minimal version of dependencies are chosen to be compatible with marimo-wasm 0.23 compatible (cf
47
+ # https://wasm.marimo.app/pyodide-lock.json?v=0.23.7)
48
+ dependencies = [
49
+ "pandas>=2.2,<3",
50
+ "requests>=2.31.0,<3",
51
+ "numpy>=2.0,<3",
52
+ "scipy>=1.14.1,<2",
53
+ "pyextremes>=2.5.0,<3",
54
+ "pyarrow>=18.1.0,<19",
55
+ "plotly>=6,<7",
56
+ "xarray>=2024.11.0",
57
+ "netCDF4>=1.7.0,<2",
58
+ ]
59
+
60
+ [project.urls]
61
+ Homepage = "https://resourcecode-project.github.io/py-resourcecode/"
62
+ GitHub = "https://github.com/Resourcecode-project/py-resourcecode"
63
+ "Web Portal" = "https://resourcecode.ifremer.fr"
64
+ PyPI = "https://pypi.org/project/resourcecode"
65
+
66
+ [project.optional-dependencies]
67
+ dev = [
68
+ "flake8>=3.6",
69
+ "black>=19.10b0",
70
+ "mypy",
71
+ "nbqa",
72
+ "check-manifest",
73
+ "tox",
74
+ "tox-uv",
75
+ ]
76
+ doc = [
77
+ "sphinx>=4.5",
78
+ "sphinx-book-theme",
79
+ "sphinx_gallery",
80
+ "plotly",
81
+ ]
82
+
83
+ [tool.setuptools.dynamic]
84
+ version = {attr = "resourcecode.__version__.__version__"}
85
+
86
+ [tool.setuptools.packages.find]
87
+ include = ["resourcecode*"]
88
+
89
+ [dependency-groups]
90
+ dev = [
91
+ "flake8>=3.6",
92
+ "black>=19.10b0",
93
+ "mypy",
94
+ "nbqa",
95
+ "check-manifest",
96
+ "tox",
97
+ "tox-uv",
98
+ "pytest>=9.0.3",
99
+ ]
100
+
101
+ [tool.black]
102
+ line-length = 120
103
+ target-version = ["py311", "py312", "py313"]
104
+
105
+ [tool.mypy]
106
+ python_version = "3.11"
107
+ warn_return_any = true
108
+ warn_unused_configs = true
109
+ ignore_missing_imports = true
@@ -17,5 +17,5 @@
17
17
  # You should have received a copy of the GNU General Public License along
18
18
  # with Resourcecode. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
- numversion = (1, 1, 3)
20
+ numversion = (2, 0, 0)
21
21
  __version__ = ".".join(str(num) for num in numversion)
@@ -114,9 +114,7 @@ class Client:
114
114
 
115
115
  return self.get_dataframe_from_criteria(criteria)
116
116
 
117
- def get_dataframe_from_url(
118
- self, selection_url: str, parameters: Iterable[str] = ("hs",)
119
- ) -> pd.DataFrame:
117
+ def get_dataframe_from_url(self, selection_url: str, parameters: Iterable[str] = ("hs",)) -> pd.DataFrame:
120
118
  """Get the pandas dataframe of the data described by the url
121
119
 
122
120
  Parameters
@@ -214,15 +212,10 @@ class Client:
214
212
  try:
215
213
  node_id = int(parsed_criteria["node"])
216
214
  except ValueError: # failed to convert node to an integer
217
- raise BadPointIdError(
218
- "Point Id must be an integer, can not be "
219
- f"{parsed_criteria['node']!r}"
220
- )
215
+ raise BadPointIdError("Point Id must be an integer, can not be " f"{parsed_criteria['node']!r}")
221
216
  else:
222
217
  if node_id not in self.possible_points_id:
223
- raise BadPointIdError(
224
- f"{parsed_criteria['node']} is an unknown pointId."
225
- )
218
+ raise BadPointIdError(f"{parsed_criteria['node']} is an unknown pointId.")
226
219
 
227
220
  # Cassandra database start indexing at 1, so decrement node
228
221
  parsed_criteria["node"] = parsed_criteria["node"] - 1
@@ -305,7 +298,4 @@ class Client:
305
298
  if response.ok:
306
299
  return response.json()
307
300
 
308
- raise ValueError(
309
- "Unable to get a response from the database"
310
- "(status code = {})".format(response.status_code)
311
- )
301
+ raise ValueError("Unable to get a response from the database" "(status code = {})".format(response.status_code))
@@ -0,0 +1,4 @@
1
+ [default]
2
+
3
+ cassandra-base-url = https://resourcecode-datacharts.ifremer.fr/
4
+ min-start-date = 1994-01-01T00:00:00