Skip to content

Commit 5b0298e

Browse files
chore: Add manifests property to Vendor (#1115)
1 parent 91c9998 commit 5b0298e

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/allotropy/parser_factory.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,17 @@ def supported_extensions(self) -> list[str]:
201201
for ext in self.get_parser().SUPPORTED_EXTENSIONS.split(",")
202202
]
203203

204+
@property
205+
def manifests(self) -> list[str]:
206+
# NOTE: this is a list because eventually parsers will support multiple schemas as they are upgraded.
207+
return [self.get_parser()._get_mapper().MANIFEST]
208+
204209
@property
205210
def asm_versions(self) -> list[str]:
206-
# NOTE: this is a list because soon parsers will support multiple schemas as they are upgraded.
207-
manifests = [
208-
Path(manifest) for manifest in [self.get_parser()._get_mapper().MANIFEST]
211+
return [
212+
"/".join(Path(manifest).parts[-4:-1]).split(".")[0]
213+
for manifest in self.manifests
209214
]
210-
return ["/".join(manifest.parts[-4:-1]).split(".")[0] for manifest in manifests]
211215

212216
@property
213217
def technique(self) -> str:

tests/parser_factory_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def test_get_parser() -> None:
1818

1919

2020
def test_supported_schemas() -> None:
21+
assert Vendor.AGILENT_GEN5.manifests == [
22+
"http://purl.allotrope.org/manifests/plate-reader/REC/2025/03/plate-reader.manifest"
23+
]
2124
assert Vendor.AGILENT_GEN5.asm_versions == ["REC/2025/03"]
2225
assert Vendor.AGILENT_GEN5.technique == "Plate Reader"
2326
assert Vendor.APPBIO_ABSOLUTE_Q.technique == "dPCR"

0 commit comments

Comments
 (0)