Skip to content

Commit f3115d4

Browse files
committed
Fix issue 213 (#214)
1 parent 2d31ea3 commit f3115d4

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/yadg/extractors/fusion/json.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,30 @@ def chromdata(jsdata: dict, uts: float) -> Dataset:
9191
else:
9292
species.add(peak["label"])
9393
if "height" in peak:
94+
if peak["height"] is None:
95+
continue
9496
raw["height"][peak["label"]] = (float(peak["height"]), 1.0)
9597
if "area" in peak:
98+
if peak["area"] is None:
99+
continue
96100
raw["area"][peak["label"]] = (float(peak["area"]), 0.01)
97101
if "concentration" in peak:
102+
if peak["concentration"] is None:
103+
continue
98104
raw["concentration"][peak["label"]] = (
99105
float(peak["concentration"]),
100106
float(peak["concentration"]) * 1e-3,
101107
)
102108
if "normalizedConcentration" in peak:
109+
if peak["normalizedConcentration"] is None:
110+
continue
103111
raw["xout"][peak["label"]] = (
104112
float(peak["normalizedConcentration"]),
105113
float(peak["normalizedConcentration"]) * 1e-3,
106114
)
107115
if "top" in peak:
116+
if peak["top"] is None:
117+
continue
108118
raw["retention time"][peak["label"]] = (float(peak["top"]), 0.01)
109119

110120
valve = jsdata.get("annotations", {}).get("valcoPosition", None)

tests/test_x_fusion_json.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"AgPTFE28_100mA_NaS_01 - Aug 13 2021, 17;56.fusion-data",
1515
"AgPTFE28_100mA_NaS_01 - Aug 13 2021, 18;18.fusion-data",
1616
"issue_198.fusion-data",
17+
"issue_213.fusion-data",
1718
],
1819
)
1920
def test_fusion_json(infile, datadir):

tests/test_x_fusion_json/issue_213.fusion-data

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
410 KB
Binary file not shown.

0 commit comments

Comments
 (0)