Skip to content

Commit f9ae229

Browse files
authored
Merge pull request #47 from OceanParcels/v/api-ref
API reference
2 parents d4ed9ae + 7e419d3 commit f9ae229

23 files changed

Lines changed: 399 additions & 357 deletions

.flake8

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/linting.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ input_data/
33
**.DS_store**
44
**.pyc**
55
**.zarr
6+
*.egg-info
7+
build
68
docs/_build/*
7-
docs/_downloads
9+
.vscode
10+
_version_setup.py
11+

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: trailing-whitespace
6+
# - id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-json
9+
types: [text]
10+
files: \.(json|ipynb)$
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.5.6
13+
hooks:
14+
- id: ruff
15+
args: [ --fix ]
16+
# - id: ruff-format

.readthedocs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ build:
33
os: ubuntu-22.04
44
tools:
55
python: mambaforge-22.9
6-
# jobs: # TODO: uncomment when we have a test suite
7-
# pre_build:
8-
# - sphinx-build -b linkcheck docs/ _build/linkcheck
6+
jobs:
7+
pre_build:
8+
- pip install . # Need access to version information
99

1010
sphinx:
1111
configuration: docs/conf.py

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ The tool is based on the [`Parcels`](https://oceanparcels.org/) computational La
1313
conda install conda-forge::plasticparcels
1414
```
1515

16+
### Community contributions and support
17+
#### Contributing code
18+
We welcome contributions to `plasticparcels`, especially example workbooks and analyses for our [public examples page](https://plastic.oceanparcels.org/en/latest/examples.html). To contribute to the project, please submit a [pull request](https://github.com/OceanParcels/plasticparcels/pulls).
19+
20+
#### Requesting features and reporting issues/bugs
21+
If you want to request a new feature, or if you find an issue or bug in the code, please open an issue in the [`plasticparcels` issue tracker](https://github.com/OceanParcels/plasticparcels/issues).
22+
23+
#### Seeking support?
24+
If you would like support using `plasticparcels`, or are have any questions about your `plasticparcels` simulations, please start a discussion in the [`plasticparcels` discussion page](https://github.com/OceanParcels/plasticparcels/discussions).
25+
26+
27+
28+
1629
### Further information
1730
For more information and documentation, see the [plasticparcels documentation](https://plastic.oceanparcels.org/).
1831

docs/conf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
import sys
1313
import warnings
1414

15+
sys.path.insert(0, os.path.abspath('..')) # Allow to find `plasticparcels` package
16+
17+
import plasticparcels
18+
1519
project = 'plasticparcels'
1620
copyright = f'{datetime.datetime.now().year}, The OceanParcels Team'
1721
author = 'The OceanParcels Team'
1822

1923
# -- General configuration ---------------------------------------------------
2024
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2125

22-
extensions = []
2326

2427
templates_path = ['_templates']
2528
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
@@ -78,6 +81,7 @@
7881
"myst_parser",
7982
"nbsphinx",
8083
"numpydoc",
84+
'sphinx.ext.autosummary',
8185
]
8286

8387
myst_enable_extensions = ["dollarmath", "amsmath"]
@@ -130,12 +134,12 @@ def linkcode_resolve(domain, info):
130134
else:
131135
linespec = ""
132136

133-
fn = os.path.relpath(fn, start=os.path.dirname(parcels.__file__))
137+
fn = os.path.relpath(fn, start=os.path.dirname(plasticparcels.__file__))
134138

135-
if "-" in parcels.__version__:
136-
return f"https://github.com/OceanParcels/plasticparcels/blob/master/parcels/{fn}{linespec}"
139+
if "-" in plasticparcels.__version__:
140+
return f"https://github.com/OceanParcels/plasticparcels/blob/master/plasticparcels/{fn}{linespec}"
137141
else:
138142
return (
139143
f"https://github.com/OceanParcels/plasticparcels/blob/"
140-
f"{parcels.__version__}/parcels/{fn}{linespec}"
144+
f"{plasticparcels.__version__}/plasticparcels/{fn}{linespec}"
141145
)

docs/environment_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
- numpydoc
2828
- nbsphinx
2929
- sphinx<6
30-
- pandoc>1.12.1,<3
30+
- pandoc>3,<4
3131
- pydata-sphinx-theme
3232
- sphinx-autobuild
3333
- myst-parser

docs/index.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ Required Data
3131

3232
* Hydrodynamic model data: `MOI GLO12 (psy4v3r1) <https://www.mercator-ocean.eu/en/solutions-expertise/accessing-digital-data/product-details/?offer=4217979b-2662-329a-907c-602fdc69c3a3&system=d35404e4-40d3-59d6-3608-581c9495d86a>`_
3333
* Biogeochemical model data: `MOI BIO4 (biomer4v2r1) <https://www.mercator-ocean.eu/en/solutions-expertise/accessing-digital-data/product-details/?offer=8d0c01f3-81c7-0a59-0d06-602fdf63c5b6&system=dc40b324-7de7-0732-880b-5d9dcf7d344a>`_
34-
* Wave data: `ECMWF ERA5 Wave <https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels>`_ (specifically, the variables ``mean_wave_period``, ``peak_wave_period``, ``u_component_stokes_drift``, and ``v_component_stokes_drift``.)
35-
* Wind data: `ECMWF ERA5 Wind <https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels>`_ (specifically, the variables ``10m_u_component_of_wind`` and ``10m_v_component_of_wind``)
34+
* Wave data: `ECMWF ERA5 Wave <https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels>`_ (specifically, the variables ``mean_wave_period``, ``peak_wave_period``, ``u_component_stokes_drift``, and ``v_component_stokes_drift``.)
35+
* Wind data: `ECMWF ERA5 Wind <https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels>`_ (specifically, the variables ``10m_u_component_of_wind`` and ``10m_v_component_of_wind``)
3636

3737
For the wind and wave data, we recommend using the `CDS API <https://cds.climate.copernicus.eu/api-how-to>`_.
3838

3939
To run the examples, you will need to update the data directories in settings ``.json`` files.
4040

41-
Just like the ``parcels`` framework, ``plasticparcels`` can be adapted to use other hydrodynamic, biogeochemical, wave, and atmospheric models. If you require assistance, please contact us through the [Discussions page on GitHub](https://github.com/OceanParcels/plasticparcels/discussions).
41+
Just like the ``parcels`` framework, ``plasticparcels`` can be adapted to use other hydrodynamic, biogeochemical, wave, and atmospheric models. If you require assistance, please contact us through the `Discussions page on GitHub <https://github.com/OceanParcels/plasticparcels/discussions>`_.
42+
43+
Community Guidelines
44+
^^^^^^^^^^^^^^^^^^^^
45+
46+
We welcome contributions to ``plasticparcels``, especially example workbooks and analyses for our `public examples page <https://plastic.oceanparcels.org/en/latest/examples.html>`_. To contribute to the project, please submit a `pull request <https://github.com/OceanParcels/plasticparcels/pulls>`_.
47+
If you want to request a new feature, or if you find an issue or bug in the code, please open an issue in the `plasticparcels issue tracker <https://github.com/OceanParcels/plasticparcels/issues>`_.
48+
If you would like support using ``plasticparcels``, or are have any questions about your ``plasticparcels`` simulations, please start a discussion in the `plasticparcels discussion page <https://github.com/OceanParcels/plasticparcels/discussions>`_.
4249

4350
.. toctree::
4451
:maxdepth: 2
@@ -48,4 +55,5 @@ Just like the ``parcels`` framework, ``plasticparcels`` can be adapted to use ot
4855
Examples <examples>
4956
Physics kernels <physicskernels>
5057
Plastic initialisation maps <initialisationmaps>
58+
API reference <reference/index>
5159
OceanParcels website <https://oceanparcels.org/>

docs/reference/constructors.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
plasticparcels.constructors
2+
---------------------------
3+
4+
.. automodule:: plasticparcels.constructors
5+
:members:
6+
:show-inheritance: yes

0 commit comments

Comments
 (0)