Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _get_matching_filenames(zip_ref: zipfile.ZipFile, pattern: str) -> list[str]
]


def decode_data(input_path: str) -> dict[str, Any]:
def decode_data(input_bytes: IO[bytes]) -> dict[str, Any]:
"""
decoded the files in input folder path and returns a structured data
:param input_path: input folder path
Expand All @@ -284,7 +284,7 @@ def decode_data(input_path: str) -> dict[str, Any]:
total_injection_chromatogram_details: list[dict[str, Any]] = []
total_peak_details: list[dict[str, Any]] = []

with zipfile.ZipFile(input_path, "r") as zip_ref:
with zipfile.ZipFile(input_bytes) as zip_ref:
acaml_path = next(iter(_get_matching_filenames(zip_ref, ".*acaml")))
with zip_ref.open(acaml_path) as acaml_file_data:
acaml_file_content = acaml_file_data.read().decode("utf-8-sig")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AgilentOpenLabCDSParser(VendorParser[Data, Model]):
SCHEMA_MAPPER = Mapper

def create_data(self, named_file_contents: NamedFileContents) -> Data:
structured_data = decode_data(named_file_contents.original_file_path)
structured_data = decode_data(named_file_contents.get_bytes_stream())
return Data(
metadata=create_metadata(structured_data, named_file_contents),
measurement_groups=[create_measurement_groups(structured_data)],
Expand Down
Loading