Skip to content

Commit

Permalink
linting with new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
renecotyfanboy committed Aug 16, 2024
1 parent 3f4c7a1 commit 75685a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- --unsafe
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
rev: v0.6.0
hooks:
- id: ruff
args: ["--fix", "--no-unsafe-fixes"]
Expand Down
12 changes: 4 additions & 8 deletions src/chainconsumer/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,8 @@ def _get_parameter_extents(
min_prop = point.coordinate[column]
max_prop = min_prop

if min_prop < min_val:
min_val = min_prop
if max_prop > max_val:
max_val = max_prop
min_val = min(min_prop, min_val)
max_val = max(max_prop, max_val)

return min_val, max_val

Expand Down Expand Up @@ -952,10 +950,8 @@ def _plot_bars(
lower = fit_values.lower
upper = fit_values.upper
if lower is not None and upper is not None:
if lower < xs.min():
lower = xs.min()
if upper > xs.max():
upper = xs.max()
lower = max(lower, xs.min())
upper = min(upper, xs.max())
x = np.linspace(lower, upper, 1000) # type: ignore
if flip:
ax.fill_betweenx(
Expand Down

0 comments on commit 75685a1

Please sign in to comment.