Skip to content

Commit 0ad64dc

Browse files
authored
Merge pull request #89 from ocefpaf/preparing4release
Preparing for new release
2 parents 71a7e90 + 0aa97ce commit 0ad64dc

File tree

7 files changed

+34
-13
lines changed

7 files changed

+34
-13
lines changed

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Install build tools
2828
run: |
29-
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
29+
python -m pip install --upgrade pip build twine
3030
3131
shell: bash
3232

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ repos:
2828
- id: blackdoc
2929

3030
- repo: https://github.com/charliermarsh/ruff-pre-commit
31-
rev: v0.0.254
31+
rev: v0.0.269
3232
hooks:
3333
- id: ruff
3434

3535
- repo: https://github.com/psf/black
36-
rev: 23.1.0
36+
rev: 23.3.0
3737
hooks:
3838
- id: black
3939
language_version: python3
@@ -51,6 +51,6 @@ repos:
5151
- id: add-trailing-comma
5252

5353
- repo: https://github.com/tox-dev/pyproject-fmt
54-
rev: "0.9.2"
54+
rev: "0.11.2"
5555
hooks:
5656
- id: pyproject-fmt

oceans/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def _woa_url(variable, time_period, resolution):
3636
warnings.warn(
3737
f'The variable "{variable}" is only available at 1 degree resolution, '
3838
f'annual time period, and "{pref}".',
39+
stacklevel=2,
3940
)
4041
return f"{base}/" f"{pref}/" f"{variable}_annual_1deg.nc"
4142
else:

oceans/filters.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,10 @@ def medfilt1(x, L=3):
415415
>>> L = 103
416416
>>> xout = medfilt1(x=x, L=L)
417417
>>> ax = plt.subplot(212)
418-
>>> (l1, l2,) = ax.plot(
418+
>>> (
419+
... l1,
420+
... l2,
421+
... ) = ax.plot(
419422
... x
420423
... ), ax.plot(xout)
421424
>>> ax.grid(True)
@@ -461,7 +464,7 @@ def medfilt1(x, L=3):
461464
Lwing = (L - 1) // 2
462465

463466
# NOTE: Use np.ndenumerate in case I expand to +1D case
464-
for i, xi in enumerate(xin):
467+
for i, _xi in enumerate(xin):
465468
if i < Lwing: # Left boundary.
466469
xout[i] = np.median(xin[0 : i + Lwing + 1]) # (0 to i + Lwing)
467470
elif i >= N - Lwing: # Right boundary.

oceans/ocfis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ def get_profile(x, y, f, xi, yi, mode="nearest", order=3):
768768
)
769769

770770
if conditions.any():
771-
warnings.warn("Warning! Extrapolation!!")
771+
warnings.warn("Warning! Extrapolation!!", stacklevel=2)
772772

773773
dx = x[0, 1] - x[0, 0]
774774
dy = y[1, 0] - y[0, 0]

oceans/plotting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def key_press_callback(self, event):
366366
print("Insert point") # noqa
367367
xs = self.points.get_xdata()
368368
ex, ey = event.xdata, event.ydata
369-
for i in range(len(xs) - 1):
369+
for _i in range(len(xs) - 1):
370370
self.points.set_xdata(np.r_[self.points.get_xdata(), ex])
371371
self.points.set_ydata(np.r_[self.points.get_ydata(), ey])
372372
self.line.set_data(self.points.get_data())

pyproject.toml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@ name = "oceans"
1111
description = "Misc functions for oceanographic data analysis"
1212
readme = "README.md"
1313
license = {file = "LICENSE.txt"}
14-
authors = [
15-
{name = "André Palóczy, Arnaldo Russo, Filipe Fernandes"},
14+
maintainers = [
15+
{name = "André Palóczy"},
16+
{name = "Arnaldo Russo"},
17+
{name = "Filipe Fernandes"},
1618
]
1719
requires-python = ">=3.8"
20+
classifiers = [
21+
"Programming Language :: Python :: 3 :: Only",
22+
"Programming Language :: Python :: 3.8",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
]
1827
dynamic = [
1928
"version",
2029
]
@@ -58,15 +67,23 @@ markers = [
5867

5968
[tool.ruff]
6069
select = [
70+
"A", # flake8-builtins
71+
"B", # flake8-bugbear
72+
"C4", # flake8-comprehensions
6173
"F", # flakes
6274
"I", # import sorting
63-
"U", # upgrade
75+
"T20", # flake8-print
76+
"UP", # upgrade
6477
]
6578
target-version = "py311"
6679
line-length = 79
80+
ignore = [
81+
"B905", # zip ztrict arg, enable only for py310
82+
]
6783

6884
[tool.ruff.per-file-ignores]
69-
"docs/conf.py" = ["E402"]
85+
"docs/source/conf.py" = ["E402", "A001"]
86+
"oceans/plotting.py" = ["T201"] # `print` found
7087

7188
[tool.interrogate]
7289
ignore-init-method = true
@@ -76,7 +93,7 @@ ignore-semiprivate = false
7693
ignore-private = false
7794
ignore-module = false
7895
fail-under = 95
79-
exclude = ["setup.py", "docs", "tests"]
96+
exclude = ["docs", "tests"]
8097
verbose = 1
8198
quiet = false
8299
color = true

0 commit comments

Comments
 (0)