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

Update ruff settings #7

Merged
merged 3 commits into from
Mar 18, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ History

X.Y.Z (YYYY-MM-DD)
------------------
* Update ruff settings (:pr:`7`)
* Update Github Actions Deployment (:pr:`6`)
* Modernise xarray-fits (:pr:`5`)

Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ tbump = "^6.9.0"
pre-commit = "^2.20.0"
ruff = "^0.1.3"

[tool.ruff]
line-length = 88
target-version = "py310"

select = [
# flake8-builtins
"A",
# flake8-bugbear
"B",
# isort
"I001",
"I002",
# tidy imports
"TID"
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
16 changes: 14 additions & 2 deletions xarrayfits/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ def generate_slice_gets(fits_filename, fits_key, fits_graph, hdu, shape, dtype,


def _xarray_from_fits_hdu(
fits_filename, fits_key, fits_graph, name_prefix, hdu_list, hdu_index, chunks
fits_filename,
fits_key,
fits_graph,
name_prefix,
hdu_list,
hdu_index,
chunks,
):
"""
Parameters
Expand Down Expand Up @@ -195,7 +201,13 @@ def _xarray_from_fits_hdu(
flat_chunks = tuple(reversed(flat_chunks))

array = generate_slice_gets(
fits_filename, fits_key, fits_graph, hdu_index, shape, dtype, flat_chunks
fits_filename,
fits_key,
fits_graph,
hdu_index,
shape,
dtype,
flat_chunks,
)

dims = tuple(f"{name_prefix}{hdu_index}-{i}" for i in range(0, naxis))
Expand Down
Loading