Skip to content

Commit

Permalink
- can not assume filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Aug 23, 2024
1 parent bf62d86 commit fe3d3bb
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions pyenzyme/sbml/omex.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,24 @@ def read_sbml_omex(path: Path) -> tuple[Path, Path | None]:
"""

omex = Omex.from_omex(path)
sbml_file = omex.get_path("./model.xml")
data = omex.get_path("./data.tsv")

# get first sbml entry in manifest
sbml_entry = None
for entry in omex.manifest.entries:
if '/sbml' in entry.format:
sbml_entry = entry.location
if entry.master:
break
sbml_file = omex.get_path(sbml_entry)


# we really need to get all of the data entries from the manifest
# but for now just get the first one
data_entry = None
for entry in omex.manifest.entries:
if '/csv' in entry.format or '/tsv' in entry.format:
data_entry = entry.location
break
data = omex.get_path(data_entry)

return sbml_file, data

0 comments on commit fe3d3bb

Please sign in to comment.