forked from nickdelgrosso/XCaliburMethodReader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXCaliburMethodReader.py
More file actions
37 lines (28 loc) · 1.06 KB
/
Copy pathXCaliburMethodReader.py
File metadata and controls
37 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
"""Backward-compatible module for the historical import path."""
from xcalibur_method_reader import XCaliburMethod, extract_gradients, list_streams, plot_gradient, read_method
from xcalibur_method_reader.cli import main
from xcalibur_method_reader.gradient import extract_gradients as get_lc_gradient
def load_lc_data(filename):
"""Return parsed XML data for the first XML-readable stream in ``filename``."""
method = read_method(filename)
readable = method.readable_xml_streams()
if not readable:
raise ValueError(f"No XML-readable streams found in {filename}")
return method.read_dict(readable[0])
def get_lc_settings(_lc_data):
"""Compatibility placeholder for the old API."""
raise NotImplementedError("LC settings extraction is not implemented in the new read-only API.")
__all__ = [
"XCaliburMethod",
"extract_gradients",
"get_lc_gradient",
"get_lc_settings",
"list_streams",
"load_lc_data",
"main",
"plot_gradient",
"read_method",
]
if __name__ == "__main__":
main()