metamorph-mda-parser 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/.github/workflows/publish.yml +1 -1
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/.github/workflows/test.yml +1 -1
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/PKG-INFO +1 -1
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/nd.py +10 -2
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/test_nd.py +6 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/.gitattributes +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/.github/dependabot.yml +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/.gitignore +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/LICENSE.txt +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/README.md +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/hk.pkl +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/pixi.lock +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/pyproject.toml +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/__init__.py +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/lark.py +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/nd_grammar.lark +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/xarray.py +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z.nd +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z_w1Conf640_s1.tif +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z_w1Conf640_s2.tif +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z_w2Conf561_s1.stk +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z_w2Conf561_s2.stk +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z_w3Conf488_s1.stk +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/data/sample_3ch_2pos_mixed-z_w3Conf488_s2.stk +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/decimal_comma_zstepsize.nd +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/sample_2ch_75pos_361t.nd +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/sample_4ch_1pos_1z.nd +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/sample_4ch_4pos.nd +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/test_xarray.py +0 -0
- {metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/test_xarray_conditional.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: metamorph-mda-parser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Light-weight parsing of Metamorph/VisiView .nd files.
|
|
5
5
|
Project-URL: Documentation, https://github.com/fmi-faim/metamorph-mda-parser#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/fmi-faim/metamorph-mda-parser/issues
|
|
@@ -44,12 +44,20 @@ class NdInfo(BaseModel):
|
|
|
44
44
|
wave_in_file_name: bool
|
|
45
45
|
|
|
46
46
|
@staticmethod
|
|
47
|
-
def from_path(
|
|
47
|
+
def from_path(
|
|
48
|
+
path: Path,
|
|
49
|
+
fix_decimal_comma: bool = False,
|
|
50
|
+
remove_suffix: str | None = None,
|
|
51
|
+
):
|
|
48
52
|
with open(path) as f:
|
|
49
53
|
content = f.read()
|
|
50
54
|
result = parse(content, fix_decimal_comma=fix_decimal_comma)
|
|
51
55
|
result["Path"] = path
|
|
52
|
-
result["Name"] =
|
|
56
|
+
result["Name"] = (
|
|
57
|
+
path.stem
|
|
58
|
+
if remove_suffix is None
|
|
59
|
+
else path.name.removesuffix(remove_suffix)
|
|
60
|
+
)
|
|
53
61
|
result["Version"] = "1.0" # HACK
|
|
54
62
|
return NdInfo(**result)
|
|
55
63
|
|
|
@@ -134,3 +134,9 @@ def test_fix_decimal_comma(nd_with_decimal_comma_zstepsize):
|
|
|
134
134
|
assert nd_info.do_z_series
|
|
135
135
|
assert nd_info.n_z_steps == 25
|
|
136
136
|
assert nd_info.z_step_size == 2.0
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_remove_suffix(sample_4ch_4pos):
|
|
140
|
+
nd_info = NdInfo.from_path(sample_4ch_4pos, remove_suffix=".nd")
|
|
141
|
+
|
|
142
|
+
assert nd_info.name == sample_4ch_4pos.stem
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/nd_grammar.lark
RENAMED
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/src/metamorph_mda_parser/xarray.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/decimal_comma_zstepsize.nd
RENAMED
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/sample_2ch_75pos_361t.nd
RENAMED
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/sample_4ch_1pos_1z.nd
RENAMED
|
File without changes
|
{metamorph_mda_parser-0.3.0 → metamorph_mda_parser-0.4.0}/tests/resources/sample_4ch_4pos.nd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|