Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ repos:
rev: v0.7.4
hooks:
- id: ruff
name: ruff lint (.py)
args: [--fix, --show-fixes]
types_or: [python]
- id: ruff
name: ruff (isort jupyter)
name: ruff isort (.ipynb)
args: [--select, I, --fix]
types_or: [jupyter]
- id: ruff-format
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/documentation_indexing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
"from glob import glob\n",
"from os import path\n",
"import warnings\n",
"\n",
"import numpy as np\n",
"\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_brownian.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_dask_chunk_OCMs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

import dask
import numpy as np
import parcels
import pytest

import parcels
from parcels.tools.statuscodes import DaskChunkingError

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_decaying_moving_eddy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}

# Define some constants.
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_globcurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from glob import glob

import numpy as np
import parcels
import pytest
import xarray as xr

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_mitgcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from typing import Literal

import numpy as np
import parcels
import xarray as xr

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_moving_eddies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
method = {
"RK4": parcels.AdvectionRK4,
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_nemo_curvilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from glob import glob

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
advection = {"RK4": parcels.AdvectionRK4, "AA": parcels.AdvectionAnalytical}

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_ofam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest
import xarray as xr

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_peninsula.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
method = {
"RK4": parcels.AdvectionRK4,
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_radial_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/example_stommel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from datetime import timedelta

import numpy as np
import parcels
import pytest

import parcels

ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
method = {
"RK4": parcels.AdvectionRK4,
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/tutorial_croco_3D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
"outputs": [],
"source": [
"import os\n",
"import parcels\n",
"import numpy as np\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"import parcels\n",
"\n",
"example_dataset_folder = parcels.download_example_dataset(\"CROCOidealized_data\")\n",
"file = os.path.join(example_dataset_folder, \"CROCO_idealized.nc\")"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/tutorial_nemo_3D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
}
],
"source": [
"import warnings\n",
"from datetime import timedelta\n",
"from glob import glob\n",
"import warnings\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import xarray as xr\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/tutorial_timestamps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"metadata": {},
"outputs": [],
"source": [
"from glob import glob\n",
"import warnings\n",
"from glob import glob\n",
"\n",
"import numpy as np\n",
"\n",
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ filterwarnings = [
line-length = 120

[tool.ruff.lint]
exclude = ["*.ipynb"]

select = [
"D", # pydocstyle
"E", # Error
Expand Down Expand Up @@ -132,6 +130,9 @@ ignore = [
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.isort]
known-first-party = ["parcels"]

[tool.mypy]
files = [
"parcels/compilation/codegenerator.py",
Expand Down
Loading