Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
19bd58e
enable mypy in pyproject toml
valeriupredoi Jan 7, 2026
4c9757b
add pre commit config
valeriupredoi Jan 7, 2026
282ebe3
harmonize dependencies
valeriupredoi Jan 7, 2026
fbc9401
harmonize dependencies
valeriupredoi Jan 7, 2026
367c5e9
Merge branch 'harmonize_deps' into add_typehints
valeriupredoi Jan 8, 2026
ebf3464
add pre-commit test dependency
valeriupredoi Jan 8, 2026
e00bd39
run pre-commit in GHA CI
valeriupredoi Jan 8, 2026
6c65d03
add inline comment
valeriupredoi Jan 8, 2026
7e660d2
add test file to gitignore
valeriupredoi Jan 8, 2026
ea101f2
add ruff rulesets in pyrpoject toml
valeriupredoi Jan 8, 2026
f2b3e10
add to gitignore
valeriupredoi Jan 8, 2026
dd26eb3
set rules
valeriupredoi Jan 8, 2026
8ee4356
add rule
valeriupredoi Jan 8, 2026
7bc1a04
restrict checks only to pyfive for now
valeriupredoi Jan 8, 2026
6ac2cdf
add to rulesets
valeriupredoi Jan 8, 2026
dd6106d
format
valeriupredoi Jan 8, 2026
d03caa9
format
valeriupredoi Jan 8, 2026
6e09843
add rule
valeriupredoi Jan 8, 2026
de65c74
turn off mypy temporarily
valeriupredoi Jan 8, 2026
97f8dea
turn off mypy temporarily
valeriupredoi Jan 8, 2026
16a570a
format
valeriupredoi Jan 8, 2026
9c9eaef
move to a more restrictive ruff linting
valeriupredoi Jan 9, 2026
8aa112f
add line length and set to 100
valeriupredoi Jan 9, 2026
ff833e6
add ignored dir for precommit
valeriupredoi Jan 9, 2026
d73cc14
readd tests to analysis
valeriupredoi Jan 9, 2026
036c645
correct line length setter
valeriupredoi Jan 9, 2026
c303330
ignore F401
valeriupredoi Jan 9, 2026
874146e
turn off codespell for now
valeriupredoi Jan 9, 2026
c7e50e9
add more rules to ignore
valeriupredoi Jan 9, 2026
20eb526
ruff formatting
valeriupredoi Jan 9, 2026
20a2adb
ruff formatting
valeriupredoi Jan 9, 2026
8f79cea
turn mypy back on
valeriupredoi Jan 9, 2026
17a9cb6
ignore name-defined for mypy
valeriupredoi Jan 9, 2026
ca71d9c
turn off some mypy typing bits
valeriupredoi Jan 9, 2026
7d11443
started added type hints
valeriupredoi Jan 9, 2026
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
5 changes: 5 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
pip install -e .[test]
- name: Run pip check
run: pip check
- name: Run pre-commit with mypy
run: |
pre-commit install
pre-commit run -a
# this will be removed when fully Ruff-ed
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ __pycache__/
test-reports/
<_io.Bytes*>
pyfive/__pycache__/
tests/btreev2-generated.hdf5
tests/__pycache__
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
ci:
autofix_prs: false

exclude: |
(?x)
.readthedocs.yaml|
codecov.yml|
^.github/|
^doc/

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-merge-conflict
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/adrienverge/yamllint
rev: 'v1.37.1'
hooks:
- id: yamllint
# codespell is always iffy; we can turn it on if we want to
# - repo: https://github.com/codespell-project/codespell
# rev: 'v2.4.1'
# hooks:
# - id: codespell
# additional_dependencies: [tomli] # required for Python 3.10
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.14.9"
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.19.1'
hooks:
- id: mypy
additional_dependencies:
- 'types-PyYAML'
- 'types-requests'
- 'numpy'
7 changes: 3 additions & 4 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Version 0.6.0

**2025-09-16**

* Enumeration Support (https://github.com/NCAS-CMS/pyfive/issues/85 by
`Bryan Lawrence <https://github.com/bnlawrence>`_,
* Enumeration Support (https://github.com/NCAS-CMS/pyfive/issues/85 by
`Bryan Lawrence <https://github.com/bnlawrence>`_,
`Kai Mühlbauer <https://github.com/kmuehlbauer>`_,
`Brian Maranville <https://github.com/bmaranville>`_))

Expand Down Expand Up @@ -208,7 +208,7 @@ Version 0.3.0
* Support for complex attribute datatypes
(https://github.com/NCAS-CMS/pyfive/pull/26 by `Jonathan Helmus
<https://github.com/jjhelmus>`_)
* Refactor attribute value retrival
* Refactor attribute value retrieval
(https://github.com/NCAS-CMS/pyfive/pull/25 by `Jonathan Helmus
<https://github.com/jjhelmus>`_)
* Dataset.ndim attribute (https://github.com/NCAS-CMS/pyfive/pull/24
Expand Down Expand Up @@ -266,4 +266,3 @@ Version 0.1.0
**2016-07-26**

* First release by `Jonathan Helmus <https://github.com/jjhelmus>`_

2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
codecov:
codecov:
token: bb6507d3-5417-42e2-9faa-6f8bc668bad0
coverage:
status:
Expand Down
16 changes: 14 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ channels:
- nodefaults

dependencies:
# core dependencies
- numpy >=2
- python >=3.10
# testing
# testing dependencies
- dask
- flake8
- flask
- flask-cors
- h5netcdf
- h5py # link to same hdf5 lib with netcdf4
- moto
- netcdf4 # has history of broken packages on PyPI
- pre-commit
- pytest
- pytest-cov
- pytest-html
- pytest-rerunfailures
# documentation
- pytest-xdist
- python-lzf
- s3fs >=2025.9.0
# documentation dependencies
- autodocsumm
- sphinx
- sphinx_rtd_theme
11 changes: 8 additions & 3 deletions pyfive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
"""

from pyfive.high_level import File, Group, Dataset
from pyfive.h5t import check_enum_dtype, check_string_dtype, check_dtype, opaque_dtype, check_opaque_dtype
from pyfive.h5t import (
check_enum_dtype,
check_string_dtype,
check_dtype,
opaque_dtype,
check_opaque_dtype,
)
from pyfive.h5py import Datatype, Empty
from importlib.metadata import version
from pyfive.inspect import p5ncdump

from importlib.metadata import PackageNotFoundError, version
from importlib.metadata import PackageNotFoundError

try:
__version__ = version("pyfive")
Expand All @@ -22,4 +28,3 @@
raise PackageNotFoundError(
msg,
) from exc

Loading
Loading