-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add 'storage_type' property describing the type of data stored …
…in a dataset
- Loading branch information
1 parent
853c103
commit a680f5b
Showing
12 changed files
with
113 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
0.1.4 | ||
- add hologram file formats: HyperSpy and tif-based | ||
- use hologram keyword arguments to generate dataset identifer | ||
- feat: add "storage_type" property describing which type of data | ||
is stored originally in a dataset | ||
- feat: add hologram file formats: HyperSpy and tif-based | ||
- fix: use hologram keyword arguments to generate dataset identifer | ||
0.1.3 | ||
- format series and single hdf5: override raw meta data | ||
- include background data in determination of data set identifiers | ||
- save memory by hard-linking background image data in QPSeries | ||
- feat: save memory by hard-linking background image data in QPSeries | ||
- fix: format series and single hdf5: override raw meta data | ||
- fix: include background data in determination of data set identifiers | ||
0.1.2 | ||
- implement SeriesData.saveh5 (export as qpimage.QPSeries) (#2) | ||
- add unique part of file name to SeriesFolder image identifiers (#2) | ||
- change API for SingleData ("idx=0" for user convenience) | ||
- extract identifiers from hdf5 files | ||
- feat: change API for SingleData ("idx=0" for user convenience) | ||
- feat: implement SeriesData.saveh5 (export as qpimage.QPSeries) (#2) | ||
- feat: add unique part of file name to SeriesFolder image identifiers (#2) | ||
- feat: extract identifiers from hdf5 files | ||
0.1.1 | ||
- support pathlib on high level | ||
- add SeriesData.identifier | ||
- feat: support pathlib | ||
- feat: add SeriesData.identifier | ||
0.1.0 | ||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from ._version import version as __version__ # noqa: F401 | ||
from .core import load_data # noqa: F401 | ||
from . import file_formats # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import pathlib | ||
import tempfile | ||
import shutil | ||
|
||
import qpformat | ||
|
||
|
||
def test_phasics(): | ||
path = pathlib.Path(__file__).parent / "data" / "single_phasics.tif" | ||
ds = qpformat.load_data(path) | ||
assert ds.storage_type == "phase,intensity" | ||
|
||
|
||
def test_phasics_zip(): | ||
path = pathlib.Path(__file__).parent / "data" / "series_phasics.zip" | ||
ds = qpformat.load_data(path) | ||
assert ds.storage_type == "phase,intensity" | ||
|
||
|
||
def test_qpimage(): | ||
path = pathlib.Path(__file__).parent / "data" / "single_qpimage.h5" | ||
ds = qpformat.load_data(path) | ||
assert ds.storage_type == "phase,amplitude" | ||
|
||
|
||
def test_bad_folder(): | ||
path = pathlib.Path(__file__).parent / "data" | ||
try: | ||
qpformat.load_data(path) | ||
except qpformat.file_formats.MultipleFormatsNotSupportedError: | ||
pass | ||
else: | ||
raise ValueError("Multiple formats not supported") | ||
|
||
|
||
def test_good_folder(): | ||
path = pathlib.Path(__file__).parent / "data" | ||
dpath = pathlib.Path(tempfile.mkdtemp(prefix="qpformat_test_")) | ||
shutil.copy(str(path / "single_qpimage.h5"), str(dpath / "1.h5")) | ||
shutil.copy(str(path / "single_qpimage.h5"), str(dpath / "2.h5")) | ||
ds = qpformat.load_data(dpath) | ||
assert ds.storage_type == "phase,amplitude" | ||
|
||
|
||
if __name__ == "__main__": | ||
# Run all tests | ||
loc = locals() | ||
for key in list(loc.keys()): | ||
if key.startswith("test_") and hasattr(loc[key], "__call__"): | ||
loc[key]() |