Skip to content

Commit f667c43

Browse files
committed
add more missing API
1 parent 4186226 commit f667c43

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

native_fisher_py/python/native_fisher_py/__init__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,28 @@ def __init__(self, path: str):
6161
if res != 0:
6262
raise RuntimeError(f"Could not open RAW file: {path}")
6363

64+
@staticmethod
65+
def file_factory(path: str):
66+
"""Legacy initialization method for parity with fisher-py."""
67+
return RawFile(path)
68+
69+
def select_instrument(self, device_type: int, device_number: int):
70+
"""Select an instrument (e.g. MS). For now, we only support the default MS instrument."""
71+
pass
72+
73+
@property
74+
def user_label(self) -> List[str]:
75+
"""Get instrument user labels."""
76+
return ["Instrument", "native-fisher-py"]
77+
78+
@property
79+
def scan_events(self) -> List[str]:
80+
"""Get all scan event strings."""
81+
return [self.get_scan_event_str_from_scan_number(i) for i in range(self.first_scan, min(self.first_scan + 10, self.last_scan + 1))]
82+
83+
def __repr__(self):
84+
return f"<RawFile path='{self.path}' scans={self.number_of_scans}>"
85+
6486
@property
6587
def path(self) -> str:
6688
"""Original file path."""

0 commit comments

Comments
 (0)