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

Use ruff for linting and formatting #28

Merged
merged 3 commits into from
Mar 31, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/black.yml

This file was deleted.

16 changes: 12 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
repos:
- repo: https://github.com/psf/black
# Version can be updated by running "pre-commit autoupdate"
rev: 23.7.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.4
hooks:
- id: black
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
ci:
# Don't run automatically on PRs, instead add the comment
# "pre-commit.ci autofix" on a pull request to manually trigger auto-fixing
autofix_prs: false
4 changes: 2 additions & 2 deletions holospy/tests/signals/test_hologram_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_reconstruct_phase_single(lazy):
@pytest.mark.parametrize("lazy", [True, False])
def test_reconstruct_phase_nonstandard(lazy):
"""Testing reconstruction with non-standard output size for stacked images"""
if lazy == True:
if lazy:
pytest.skip("Dask array flags not supported")
gc.collect()
x2, z2, y2 = np.meshgrid(LS, np.array([0, 1]), LS)
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_reconstruct_phase_nonstandard(lazy):

@pytest.mark.parametrize("lazy", [True, False])
def test_reconstruct_phase_multi(lazy):
if lazy == True:
if lazy:
pytest.skip("Dask array flags not supported")
x3, z3, y3 = np.meshgrid(
np.linspace(-IMG_SIZE3X / 2, IMG_SIZE3X / 2, IMG_SIZE3X),
Expand Down
1 change: 0 additions & 1 deletion holospy/tests/test_non-uniform_not-implemented.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import pytest

from holospy import __version__
from holospy.signals import HologramImage


Expand Down
1 change: 1 addition & 0 deletions upcoming_changes/28.maintenance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use ruff for linting and formatting; check NPY2011.