Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update pre-commit hooks #239

Merged
merged 2 commits into from
Jan 8, 2025
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ exclude: |

repos:
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.18.0"
rev: "1.19.1"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.9"
rev: "v0.8.6"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -72,7 +72,7 @@ repos:
args: [--prose-wrap=always]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.11.2"
rev: "v1.14.1"
hooks:
- id: mypy
files: src|tests
Expand Down Expand Up @@ -105,13 +105,13 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.20.2"
rev: "v0.23"
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.29.3"
rev: "0.30.0"
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
14 changes: 7 additions & 7 deletions src/polartoolkit/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,12 +1285,12 @@ def plot_data(
data_projection = f"X{fig_width}c/{data_height}c"

# get axes from data dict
axes = pd.Series([v["axis"] for k, v in data_dict.items()])
axes = pd.Series([v["axis"] for k, v in data_dict.items()]) # type: ignore[union-attr]

# for each axis get overall max and min values
ax0_min_max = []
ax1_min_max = []
for k, v in data_dict.items():
for k, v in data_dict.items(): # type: ignore[union-attr]
if v["axis"] == axes.unique()[0]:
ax0_min_max.append(utils.get_min_max(df_data[k]))
else:
Expand All @@ -1303,7 +1303,7 @@ def plot_data(
elif isinstance(frames, list) and isinstance(frames[0], str):
frames = [frames]

for i, (k, v) in enumerate(data_dict.items()):
for i, (k, v) in enumerate(data_dict.items()): # type: ignore[union-attr]
if v["axis"] == axes.unique()[0]:
data_min = np.min([a for (a, b) in ax0_min_max])
data_max = np.max([b for (a, b) in ax0_min_max])
Expand Down Expand Up @@ -1363,7 +1363,7 @@ def plot_data(
else:
thick = kwargs.get("data_pen_thickness", 1)
if isinstance(thick, (float, int)):
thick = [thick] * len(data_dict.items())
thick = [thick] * len(data_dict.items()) # type: ignore[union-attr]

color = kwargs.get("data_pen_color")
if isinstance(color, list):
Expand Down Expand Up @@ -1397,8 +1397,8 @@ def plot_data(
pygmt.makecpt(
cmap=kwargs.get("data_line_cmap"),
series=[
np.min([v["color"] for k, v in data_dict.items()]),
np.max([v["color"] for k, v in data_dict.items()]),
np.min([v["color"] for k, v in data_dict.items()]), # type: ignore[union-attr]
np.max([v["color"] for k, v in data_dict.items()]), # type: ignore[union-attr]
],
)

Expand All @@ -1408,7 +1408,7 @@ def plot_data(
frame=frame,
x=df_data.dist,
y=df_data[k],
pen=f"{kwargs.get('data_pen', [1]*len(data_dict.items()))[i]}p,+z",
pen=f"{kwargs.get('data_pen', [1]*len(data_dict.items()))[i]}p,+z", # type: ignore[union-attr]
label=v["name"],
cmap=True,
zvalue=v["color"],
Expand Down
Loading