-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update schema references to point to nmdc_materialized_patterns
variant
#887
base: main
Are you sure you want to change the base?
Update schema references to point to nmdc_materialized_patterns
variant
#887
Conversation
Hi @dwinston, you can add commits directly to this PR branch, in case you want to make changes related to "occurrence 1" without creating a separate PR. |
@@ -32,9 +36,13 @@ def validate_json(data_path, schema_path, log_file): | |||
|
|||
def test_gold_study_json( | |||
data_path="output/nmdc_etl/gold_study.json", | |||
schema_path="../../../schema/nmdc.schema.json", | |||
schema_path="/path/to/nmdc_materialized_patterns.schema.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we not doing this using the python package or linkml. @sierra-moxon please weigh in here but we can't just have a dummy path here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't just have a dummy path here
Thanks—I agree. This was a mistake on my part.
Communicating which schema variant we expect, to the caller
The previous default value here would not work because this repository no longer contains a file at ../../../schema/nmdc.schema.json
.
My intention by replacing the default value was to give a hint to the user about which variant of the schema we expect them to provide; i.e. the nmdc_materialized_patterns.schema.json
variant, not the nmdc.schema.json
variant. The code still won't work, though (neither file exists at the path specified).
I'll add a note to the (otherwise empty) docstring, saying that we expect the user to provide the path to the nmdc_materialized_patterns.schema.json
variant of the schema when they invoke the function.
The default value
The Runtime repo no longer contains a schema file whose path we could use as the default value.
Invocations of this function
The only invocation of this function I see (in the repo) is the one right below the function's definition; i.e. this one:
if __name__ == "__main__":
print("study test", test_gold_study_json())
That invocation relies on the function's default values.
The future of this script
Given that this script was already broken (due to the path being nonexistent) before this PR was created...
Do you have a sense for whether anyone uses this script anymore?
It was last updated in 2022 (before I updated the parameter's default value in this PR). I'm guessing someone wrote it to demonstrate something way back when.
Given that it lacked any documentation, maybe they did not expect it to be used by other people (or their future self) or maintained over time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the latest commit (i.e. 2042c09), I removed all the obsolete, hard-coded file paths and replaced them with references to CLI arguments. This way, it is the user's responsibility to tell the script where it can find these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still like to remove this file from the repo if it's obsolete. That way, we and our successors don't spend time trying to salvage it as the rest of the code base evolves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @turbomam what should we be using instead of the nmdc_materialized_patterns.schema.json
On this branch, I updated some references to variants of the NMDC Schema other than the
nmdc_materialized_patterns
variant, so that they point to thenmdc_materialized_patterns
variant.Details
None.
Related issue(s)
Partially fixes #552
Related subsystem(s)
docs
directory)Testing
I will delegate the testing task to GitHub Actions.
Documentation
docs
directory)Maintainability
study_id: str
)# TODO
or# FIXME
black
to format all the Python files I created/modified