-
Notifications
You must be signed in to change notification settings - Fork 15
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
ENH: Produce inplace volumes result schema #957
Conversation
class InplaceVolumesGenerateJsonSchema(GenerateJsonSchema): | ||
"""Implements a schema generator so that some additional fields may be added.""" |
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 a follow-up PR I think I want to see if I can apply a generator schema generator from SchemaBase
to use as a default
4b0d4b3
to
5df7391
Compare
@@ -24,7 +24,7 @@ jobs: | |||
- name: Check schema | |||
run: | | |||
./tools/update_schema | |||
./tools/update-schema |
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.
POSIX convention is usually hyphens for executable names
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.
OK, when I read about (asking chatgpt), it says that "Underscores are more common in internal or development scripts where they are not directly exposed to users (e.g., build_script)." Hyphen is OK with me
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 think this is a case where ChatGPT is happy to oblige. I get:
For scripts that are invoked as executables, hyphens (-) are generally more common than underscores (
_
) between words. This convention aligns with the broader Unix/Linux philosophy and naming practices, where hyphen-separated names are easier to type and visually distinct. For executable scripts, prefer hyphens (-) unless there's a compelling reason to use underscores (_
).
SCHEMAS = [ | ||
FmuResultsSchema, | ||
InplaceVolumesSchema, | ||
] |
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.
Here and in the tests we are collecting a list of all (two) the schemas to iterate over them. There should probably be a place in the code to collect them, but I think waiting for the next one to see where that should be might land it in a better spot (maybe?)
parser.add_argument( | ||
"--force", | ||
action="store_true", | ||
help="Force the script to overwrite the current schema with the new schema.", | ||
) |
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.
Until we roll out schema versioning completely we'll need to --force
overwrite schema changes.
Also TODO: is add a --release
flag that allows overwriting the $id
to the prod url, when proposing to staging
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.
LGTM
5df7391
to
f8ff804
Compare
Resolves #895
This PR gets us 80% of the way to versioned schemas as well