diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0dae082..e647810 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,20 +20,20 @@ repos: types: [python, yaml, markdown] - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.18.0 + rev: v0.18.1 hooks: - id: markdownlint-cli2 args: [] - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.20.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.10 + rev: v0.11.13 hooks: - id: ruff args: [ --fix, --exit-non-zero-on-fix ] @@ -58,7 +58,7 @@ repos: - id: numpydoc-validation - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.16.0 hooks: - id: mypy args: [--ignore-missing-imports] # default but useful to be explicit diff --git a/README.md b/README.md index 941d1d5..c574127 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,18 @@ for use with [TopoStats](https://github.com/AFM-SPM/TopoStats). Supported file formats -| File format | Description | -|-------------|----------------| -| `.asd` | High-speed AFM | -| `.ibw` | [WaveMetrics](https://www.wavemetrics.com/) | -| `.spm` | [Bruker's Format](https://www.bruker.com/) | -| `.jpk` | [Bruker](https://www.bruker.com/) | -| `.h5-jpk` | [Bruker](https://www.bruker.com/) | -| `.topostats`| [TopoStats](https://github.com/AFM-SPM/TopoStats) | -| `.gwy` | [Gwydion]() | -| `.stp` | [WSXM AFM software files](http://www.wsxm.eu) | -| `.top` | `.stp` variant | +| File format | Description | +|-----------------|---------------------------------------------------| +| `.asd` | High-speed AFM | +| `.gwy` | [Gwydion]() | +| `.h5-jpk` | [Bruker](https://www.bruker.com/) | +| `.ibw` | [WaveMetrics](https://www.wavemetrics.com/) | +| `.jpk-qi-image` | [Bruker](https://www.bruker.com/) | +| `.jpk` | [Bruker](https://www.bruker.com/) | +| `.spm` | [Bruker's Format](https://www.bruker.com/) | +| `.stp` | [WSXM AFM software files](http://www.wsxm.eu) | +| `.top` | `.stp` variant | +| `.topostats` | [TopoStats](https://github.com/AFM-SPM/TopoStats) | Support for the following additional formats is planned. Some of these are already supported in TopoStats and are awaiting refactoring to move their functionality into AFMReader these are denoted in bold below. diff --git a/docs/usage.md b/docs/usage.md index 0a2583b..555344c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -11,14 +11,18 @@ integrate it into your workflow. ## Supported file formats -| File format | Description | -|--------------|---------------------------------------------------| -| `.asd` | High-speed AFM | -| `.ibw` | [WaveMetrics](https://www.wavemetrics.com/) | -| `.spm` | [Bruker's Format](https://www.bruker.com/) | -| `.jpk` | [Bruker](https://www.bruker.com/) | -| `.topostats` | [TopoStats](https://github.com/AFM-SPM/TopoStats) | -| `.gwy` | [Gwydion]() | +| File format | Description | +|-----------------|---------------------------------------------------| +| `.asd` | High-speed AFM | +| `.gwy` | [Gwydion]() | +| `.h5-jpk` | [Bruker](https://www.bruker.com/) | +| `.ibw` | [WaveMetrics](https://www.wavemetrics.com/) | +| `.jpk-qi-image` | [Bruker](https://www.bruker.com/) | +| `.jpk` | [Bruker](https://www.bruker.com/) | +| `.spm` | [Bruker's Format](https://www.bruker.com/) | +| `.stp` | [WSXM AFM software files](http://www.wsxm.eu) | +| `.top` | `.stp` variant | +| `.topostats` | [TopoStats](https://github.com/AFM-SPM/TopoStats) | Support for the following additional formats is planned. Some of these are already supported in TopoStats and are awaiting refactoring to move their functionality into AFMReader these are denoted in bold below. diff --git a/tests/test_h5jpk.py b/tests/test_h5jpk.py index 52dbefd..b0336b2 100644 --- a/tests/test_h5jpk.py +++ b/tests/test_h5jpk.py @@ -5,11 +5,14 @@ import numpy as np import pytest -from AFMReader import h5_jpk +from AFMReader import h5_jpk # pylint: disable=no-name-in-module BASE_DIR = Path.cwd() RESOURCES = BASE_DIR / "tests" / "resources" +# pylint: disable=too-many-arguments +# pylint: disable=too-many-positional-arguments + @pytest.mark.parametrize( ( @@ -128,15 +131,15 @@ def test_load_h5jpk( RESOURCES / file_name, channel, flip_image ) - assert result_pixel_to_nm_scaling == pixel_to_nm_scaling + assert result_pixel_to_nm_scaling == pytest.approx(pixel_to_nm_scaling) assert isinstance(result_image, np.ndarray) assert result_image.shape == image_shape assert result_image.dtype == np.dtype(image_dtype) assert isinstance(results_timestamps, timestamps_dtype) - assert result_image.sum() == image_sum + assert result_image.sum() == pytest.approx(image_sum) assert len(results_timestamps) == result_image.shape[0] assert all( - results_timestamps[f"frame {i}"] < results_timestamps[f"frame {i+1}"] + results_timestamps[f"frame {i}"] < results_timestamps[f"frame {i + 1}"] for i in range(len(results_timestamps) - 1) )