Skip to content
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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](<http://gwyddion.net>) |
| `.stp` | [WSXM AFM software files](http://www.wsxm.eu) |
| `.top` | `.stp` variant |
| File format | Description |
|-----------------|---------------------------------------------------|
| `.asd` | High-speed AFM |
| `.gwy` | [Gwydion](<http://gwyddion.net>) |
| `.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.
Expand Down
20 changes: 12 additions & 8 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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](<http://gwyddion.net>) |
| File format | Description |
|-----------------|---------------------------------------------------|
| `.asd` | High-speed AFM |
| `.gwy` | [Gwydion](<http://gwyddion.net>) |
| `.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.
Expand Down
11 changes: 7 additions & 4 deletions tests/test_h5jpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
(
Expand Down Expand Up @@ -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)
)

Expand Down