resourcecode 1.3.1__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.
- {resourcecode-1.3.1 → resourcecode-2.0.0}/MANIFEST.in +6 -2
- {resourcecode-1.3.1 → resourcecode-2.0.0}/PKG-INFO +52 -71
- {resourcecode-1.3.1 → resourcecode-2.0.0}/README.md +23 -38
- {resourcecode-1.3.1 → resourcecode-2.0.0}/examples/plot_0_Database_exploration.py +3 -6
- {resourcecode-1.3.1 → resourcecode-2.0.0}/examples/plot_1_data_extraction.py +5 -12
- {resourcecode-1.3.1 → resourcecode-2.0.0}/examples/plot_2_Multivariate_Extremes.py +1 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/examples/plot_3_Operation_Planning.py +4 -15
- {resourcecode-1.3.1 → resourcecode-2.0.0}/examples/plot_4_Producible.py +4 -9
- {resourcecode-1.3.1 → resourcecode-2.0.0}/fp_hs.png +0 -0
- resourcecode-2.0.0/pyproject.toml +109 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/__version__.py +1 -1
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/client.py +4 -14
- resourcecode-2.0.0/resourcecode/config/config.ini +4 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/eva/censgaussfit.py +17 -12
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/eva/huseby.py +5 -18
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/eva/simulation.py +2 -2
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/io.py +2 -6
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/opsplanning/__init__.py +10 -29
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/producible_assessment/main.py +10 -24
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/resassess/__init__.py +4 -11
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/compute_parameters.py +18 -18
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/convert2D1D.py +2 -4
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/download_data.py +16 -38
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/jonswap.py +10 -21
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/plots.py +1 -1
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/utils.py +1 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/weatherwindow/__init__.py +0 -1
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/weatherwindow/weatherwindow.py +1 -1
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode.egg-info/PKG-INFO +52 -71
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode.egg-info/SOURCES.txt +4 -3
- resourcecode-2.0.0/resourcecode.egg-info/requires.txt +24 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode.egg-info/top_level.txt +0 -1
- resourcecode-2.0.0/tests/conftest.py +27 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_client.py +3 -9
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_resassess.py +11 -11
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_spectrum.py +16 -13
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_weather_window.py +3 -9
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tox.ini +15 -8
- resourcecode-2.0.0/uv.lock +1917 -0
- resourcecode-1.3.1/dev_requirements.txt +0 -1
- resourcecode-1.3.1/resourcecode.egg-info/not-zip-safe +0 -1
- resourcecode-1.3.1/resourcecode.egg-info/requires.txt +0 -11
- resourcecode-1.3.1/setup.py +0 -109
- {resourcecode-1.3.1 → resourcecode-2.0.0}/CHANGELOG.md +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/CITATION.cff +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/CLA/RESOURCECODE-Entity.pdf +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/CLA/RESOURCECODE-Individual.pdf +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/COPYING +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/LICENSE +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/config/config.ini +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/examples/README.rst +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/mypy.ini +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/__init__.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/__init__.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/coastline.feather +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/grid_FIELD.feather +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/grid_SPEC.feather +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/islands.feather +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/netcdf_description.json +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/triangles.feather +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/data/variables.feather +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/eva/__init__.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/eva/extrema.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/exceptions.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/plotly_theme.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/Frequencies.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/HsTptimeseries.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/PTO_values.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/producible_assessment/Inputs/capture_width.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/producible_assessment/__init__.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/__init__.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode/spectrum/dispersion.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/resourcecode.egg-info/dependency_links.txt +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/setup.cfg +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/__init__.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/censgaussfit/input_0.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/censgaussfit/output_0.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/huseby/input_0.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/huseby/output_0.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/huseby/output_1.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/opsplanning/input.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/df_average_energy.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/df_number_occurence.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/df_percentage_occurence.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/df_standard_deviation_energy.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/input.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/monthly_stat.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/resassess/yearly_stat.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/Etfh.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/RSCD_WW3-RSCD-UG-W001933N55743_201605_freq.nc +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/W001933N55743_201605.nc +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/depth.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/dir.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/freq.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/parameters_1D.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/parameters_2D.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/spectrum/spec.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/timeseries_fp.json +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/timeseries_hs.json +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/timeseries_uust.json +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/data/weather_window/hs.csv +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/output/empty.out +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_data.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_eva.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_netfcd.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_opsplanning.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_producible_assessment.py +0 -0
- {resourcecode-1.3.1 → resourcecode-2.0.0}/tests/test_utils.py +0 -0
|
@@ -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
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: resourcecode
|
|
3
|
-
Version:
|
|
4
|
-
Summary: The ResourceCODE Marine Data Toolbox is a python package to facilitate the access to recent hindcast database of sea-state
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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,51 +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:
|
|
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
|
|
32
|
-
Requires-Dist: requests
|
|
33
|
-
Requires-Dist: numpy<2.0
|
|
34
|
-
Requires-Dist: scipy<1.14.
|
|
35
|
-
Requires-Dist: pyextremes
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
|
|
41
|
-
Requires-Dist:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
50
|
Dynamic: license-file
|
|
51
|
-
Dynamic: project-url
|
|
52
|
-
Dynamic: requires-dist
|
|
53
|
-
Dynamic: requires-python
|
|
54
|
-
Dynamic: summary
|
|
55
51
|
|
|
56
52
|
# Resourcecode library
|
|
57
53
|
|
|
58
54
|
[](https://github.com/Resourcecode-project/py-resourcecode/actions/workflows/check.yml)
|
|
59
55
|
[](https://badge.fury.io/py/resourcecode)
|
|
60
56
|
[](https://joss.theoj.org/papers/e43574f4a0b6782ee6a112180912dae0)
|
|
61
|
-
[](https://pypistats.org/packages/
|
|
57
|
+
[](https://pypistats.org/packages/resourcecode)
|
|
62
58
|
[](https://github.com/psf/black)
|
|
63
59
|
|
|
64
60
|
## Description
|
|
@@ -79,58 +75,43 @@ in expected environmental conditions,and de-risk investment in future technology
|
|
|
79
75
|
|
|
80
76
|
## Installation
|
|
81
77
|
|
|
82
|
-
###
|
|
78
|
+
### Requirements
|
|
83
79
|
|
|
84
|
-
|
|
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)
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
- pandas (>= 1.0.0)
|
|
88
|
-
- requests (>= 2.23.0)
|
|
89
|
-
- numpy (>= 1.20.1, < 2.0.0)
|
|
90
|
-
- scipy (>= 1.6.1)
|
|
91
|
-
- pyextremes (>= 2.0.0)
|
|
92
|
-
- pytest (>7.0.0)
|
|
93
|
-
- pyarrow (>= 6.0.0)
|
|
94
|
-
- plotly (>= 4.12.0)
|
|
95
|
-
- numexpr (>= 2.7.0)
|
|
96
|
-
- xarray (>= 0.19.0)
|
|
88
|
+
### Using uv (recommended)
|
|
97
89
|
|
|
98
|
-
|
|
99
|
-
### Using an environment
|
|
100
|
-
|
|
101
|
-
Maybe the easiest way to install the toolbox is to create a dedicated virtual
|
|
102
|
-
environment:
|
|
90
|
+
The recommended way to install the toolbox is to use [`uv`](https://docs.astral.sh/uv/), a fast Python package installer:
|
|
103
91
|
|
|
104
92
|
```shell
|
|
105
|
-
$
|
|
106
|
-
$ python3 -m venv env-resourcecode
|
|
93
|
+
$ uv pip install resourcecode
|
|
107
94
|
```
|
|
108
95
|
|
|
109
|
-
|
|
96
|
+
### Using pip
|
|
97
|
+
|
|
98
|
+
Alternatively, you can use pip:
|
|
110
99
|
|
|
111
100
|
```shell
|
|
112
|
-
$
|
|
113
|
-
(env-resourcecode)$
|
|
101
|
+
$ python -m pip install resourcecode
|
|
114
102
|
```
|
|
115
103
|
|
|
116
|
-
|
|
117
|
-
available on PyPI, and installation is straightforward, using the following
|
|
118
|
-
command:
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
(env-resourcecode)$ python -m pip install resourcecode
|
|
122
|
-
[…]
|
|
123
|
-
```
|
|
104
|
+
### Development installation
|
|
124
105
|
|
|
125
|
-
|
|
106
|
+
For development, clone the repository and install with all dependencies:
|
|
126
107
|
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
|
|
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
|
|
130
113
|
```
|
|
131
114
|
|
|
132
|
-
which should print the current locally installed version of `resourcecode`.
|
|
133
|
-
|
|
134
115
|
## Example of use
|
|
135
116
|
|
|
136
117
|
Once the library is installed and the configuration is done, you can use the
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/Resourcecode-project/py-resourcecode/actions/workflows/check.yml)
|
|
4
4
|
[](https://badge.fury.io/py/resourcecode)
|
|
5
5
|
[](https://joss.theoj.org/papers/e43574f4a0b6782ee6a112180912dae0)
|
|
6
|
-
[](https://pypistats.org/packages/
|
|
6
|
+
[](https://pypistats.org/packages/resourcecode)
|
|
7
7
|
[](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
|
-
###
|
|
27
|
+
### Requirements
|
|
28
28
|
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
- pandas (>= 1.0.0)
|
|
33
|
-
- requests (>= 2.23.0)
|
|
34
|
-
- numpy (>= 1.20.1, < 2.0.0)
|
|
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
|
-
$
|
|
51
|
-
$ python3 -m venv env-resourcecode
|
|
42
|
+
$ uv pip install resourcecode
|
|
52
43
|
```
|
|
53
44
|
|
|
54
|
-
|
|
45
|
+
### Using pip
|
|
46
|
+
|
|
47
|
+
Alternatively, you can use pip:
|
|
55
48
|
|
|
56
49
|
```shell
|
|
57
|
-
$
|
|
58
|
-
(env-resourcecode)$
|
|
50
|
+
$ python -m pip install resourcecode
|
|
59
51
|
```
|
|
60
52
|
|
|
61
|
-
|
|
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
|
-
|
|
55
|
+
For development, clone the repository and install with all dependencies:
|
|
71
56
|
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
|
|
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
|
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")
|
|
Binary file
|
|
@@ -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
|
|
@@ -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))
|