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

Save grain trace data to HDF5 format #790

Merged
merged 40 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
83baa6e
Add recurside_dict_to_hdf5 to io.py in lieu of manual saving
SylviaWhittle Jan 30, 2024
2101cb0
Update processing to handle grain trace data and put it in topostats …
SylviaWhittle Jan 31, 2024
2d77e73
Add functions to get trace heights and cumulative distances
SylviaWhittle Jan 31, 2024
f8af70a
Fix tests broken by turning ordered traces to a dictionary
SylviaWhittle Jan 31, 2024
2077127
Remove unsupported use of pipe operator in python 3.9
SylviaWhittle Jan 31, 2024
0ccfc17
Remove unsupported use of pipe operator in python 3.9
SylviaWhittle Jan 31, 2024
1b6375f
Improve description of get_ordered_trace_heights
SylviaWhittle Jan 31, 2024
6ef1a2e
Use sqrt(2) instead of hardcoded value
SylviaWhittle Jan 31, 2024
4fd477f
Remove manual n_grain as a grain indexer, instead use enumeration index
SylviaWhittle Jan 31, 2024
15c30bd
Add tests for coord_dist
SylviaWhittle Feb 1, 2024
0684400
Add function to convert hdf5 loaded data to dictionary
SylviaWhittle Feb 2, 2024
0be859f
Add single grain dnatracing tests for height traces and cumulative di…
SylviaWhittle Feb 2, 2024
547a65d
Vectorise cumulative trace script
SylviaWhittle Feb 3, 2024
d364199
Add logging statements for loading and support grain trace data
SylviaWhittle Feb 5, 2024
04f9295
Revert to using image instead of flattened_image in topostats files f…
SylviaWhittle Feb 5, 2024
19b9b2c
Update topostats example file for loading and update existing tests
SylviaWhittle Feb 5, 2024
93019c7
Improve topostats file save and load test
SylviaWhittle Feb 5, 2024
80ffe5c
Add regression test for .topostats file
SylviaWhittle Feb 5, 2024
023dd90
fix error in order of lists being incorrect for assertion
SylviaWhittle Feb 5, 2024
eab9e50
Add function to determine if two dictionaries are almost equal
SylviaWhittle Feb 5, 2024
b9585dc
Add logging statements for dict comparison
SylviaWhittle Feb 5, 2024
7ccded0
More logging for dict comparison
SylviaWhittle Feb 5, 2024
ac20c74
Add more logging and ignore img_path in regtest of .topostats file in…
SylviaWhittle Feb 5, 2024
5e6e0bc
Add tests for dict_almost_equal
SylviaWhittle Feb 6, 2024
7aff978
Add more test cases for test_dict_almost_equal
SylviaWhittle Feb 6, 2024
708af75
Fix lists not being saved as numpy arrays to hdf5 and add test case f…
SylviaWhittle Feb 6, 2024
4c074cb
Add docstrings to io.py
SylviaWhittle Feb 6, 2024
9329dd0
Turn test params into pytest.param() statements
SylviaWhittle Feb 6, 2024
ee8c899
Fix type hint
SylviaWhittle Feb 7, 2024
b242b13
Fix parameter passing to dict_to_hdf5
SylviaWhittle Feb 7, 2024
92c9ddb
Merge branch 'SylviaWhittle/trace_stats_HDF5' of github.com:AFM-SPM/T…
SylviaWhittle Feb 7, 2024
00cdc13
Add fixture for topostats test file rather than loading it in tests i…
SylviaWhittle Feb 8, 2024
935a877
Break out dict_to_hdf5 tests into unique tests
SylviaWhittle Feb 9, 2024
5d0f065
Break out hdf5_to_dict tests into unique tests
SylviaWhittle Feb 9, 2024
a93a50d
Move dict_almost_equal to test_io.py
SylviaWhittle Feb 9, 2024
aaaecb4
Use a fixture for test_save_and_load_topostats_file
SylviaWhittle Feb 9, 2024
540a2e1
Unsplit dict_to_hdf5
SylviaWhittle Feb 9, 2024
643deb7
Re-import dict_almost_equal from test_io
SylviaWhittle Feb 9, 2024
239cce3
Rename read_topostats_file_data_dict to topostats_data
SylviaWhittle Feb 9, 2024
4ae1b70
Avoid type in variable name antipattern
SylviaWhittle Feb 9, 2024
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
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fixtures for testing."""

import importlib.resources as pkg_resources
from pathlib import Path

Expand Down Expand Up @@ -346,6 +347,12 @@ def load_scan_dummy() -> LoadScans:
return LoadScans(img_paths="dummy", channel="dummy")


@pytest.fixture()
def load_scan_topostats_test_file(tmp_path: Path, loading_config: dict) -> LoadScans:
"""Instantiate a LoadScans object for a temporarily saved test .topostats file."""
return LoadScans([tmp_path / "topostats_file_test.topostats"], **loading_config)


@pytest.fixture()
def load_scan(loading_config: dict) -> LoadScans:
"""Instantiate a LoadScans object from a small .topostats image file."""
Expand Down
Binary file modified tests/resources/file.topostats
Binary file not shown.
Binary file not shown.
Loading
Loading