Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 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
3fc9141
type hints
valeriupredoi Jan 13, 2026
1d50823
type hints
valeriupredoi Jan 13, 2026
cf2f848
more type hinting
valeriupredoi Jan 13, 2026
862936f
add a missing type return
valeriupredoi Jan 13, 2026
eef6526
remove import of dataobjects, that creates a circular import issue
valeriupredoi Jan 13, 2026
20fe4a2
keep generic {} but type the var
valeriupredoi Jan 13, 2026
7bad27e
Update pyfive/high_level.py
valeriupredoi Jan 14, 2026
07eee47
Update pyfive/high_level.py
valeriupredoi Jan 14, 2026
603ca10
Update pyfive/high_level.py
valeriupredoi Jan 14, 2026
4ae10b1
add str type
valeriupredoi Jan 14, 2026
5486e7f
add return and ignore type missing return - inconsistent returns in f…
valeriupredoi Jan 14, 2026
b2186ba
add inline comment
valeriupredoi Jan 14, 2026
dbbb925
turn on mypy section
valeriupredoi Jan 14, 2026
117888a
turn off flake8
valeriupredoi Jan 14, 2026
1e05eb9
remove dependency on flake8
valeriupredoi Jan 14, 2026
032a54e
pin netcdf4
valeriupredoi Jan 14, 2026
732cb57
use legacy import for Python 3.10-compat
valeriupredoi Jan 14, 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
16 changes: 11 additions & 5 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,18 @@ jobs:
pip install -e .[test]
- name: Run pip check
run: pip check
- name: Lint with flake8
- name: Run pre-commit with mypy
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pre-commit install
pre-commit run -a
# we run pre-commit with ruff and mypy, so this is now redundant
# keeping it commented out for now, in case we ever need to come back using it
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check environment contents
run: |
conda list
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
17 changes: 14 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ channels:
- nodefaults

dependencies:
# core dependencies
- numpy >=2
- python >=3.10
# testing
# testing dependencies
- dask
- flask
- flask-cors
- h5netcdf
- h5py # link to same hdf5 lib with netcdf4
- netcdf4 # has history of broken packages on PyPI
- moto
- netcdf4 !=1.7.4 # github.com/Unidata/netcdf4-python/issues/1464
- pre-commit # with ruff and mypy
- 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