Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTS Manifest parsing #210

Merged
merged 10 commits into from
Dec 17, 2024
Merged

DTS Manifest parsing #210

merged 10 commits into from
Dec 17, 2024

Conversation

briehl
Copy link
Member

@briehl briehl commented Dec 4, 2024

This does the work of parsing the DTS manifest and returning results.
It relies pretty heavily on the jsonschema to do the validation work, so the parser has relatively minimal checking.

Also a minor schema tweak to make sure that parameters are always primitive types.

This is on the big side, but the vast majority is either test data or tests that follow a pretty set pattern.

@briehl briehl marked this pull request as ready for review December 13, 2024 17:34
@briehl briehl requested a review from MrCreosote December 13, 2024 17:34
@briehl briehl changed the title DTS Manifest parsing, schema tweak DTS Manifest parsing Dec 13, 2024
instructions = manifest[_DTS_INSTRUCTIONS_KEY]
for resource_obj in instructions[_DTS_INSTRUCTIONS_OBJECTS_KEY]:
datatype = resource_obj[_DTS_INSTRUCTIONS_DATATYPE_KEY]
parameters = frozendict(resource_obj[_DTS_INSTRUCTIONS_PARAMETERS_KEY])
Copy link
Member

@MrCreosote MrCreosote Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the DTS has to know the app parameter names for each datatype it processes? IOW the DTS is coupled to the apps?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also assume the file names / locations in the staging area are in the parameters? They can't be anywhere else...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to both. We talked about doing some references from the parameters to file paths, but if we do that'll be in a later version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that seems less than ideal, but if you've agreed that that's how it'll work so be it

results[datatype].append(parameters)
# Re-package results as a dict of {datatype: ParseResult}
results = {
source: ParseResult(spcsrc, tuple(parsed)) for source, parsed in results.items()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source: ParseResult(spcsrc, tuple(parsed)) for source, parsed in results.items()
datatype: ParseResult(spcsrc, tuple(paramlist)) for datatype, paramlist in results.items()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't like the paramlist name? That matched up better with the prior var names to me

Copy link
Member Author

@briehl briehl Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Meant to change that and got distracted. Changed.

Comment on lines 803 to 804
for parsed in res.results["gff_metagenome"].result:
assert parsed == {"param1": "value1", "param2": "value2"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you decide to make all the parameters the same?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was mostly meant as a smoke test / structure test, with more complicated ones elsewhere.
Doesn't matter, though, I updated with more complexity.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@briehl briehl merged commit b5f6790 into dts-manifest-schema Dec 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants