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

JSON -> YAML for CLI #436

Merged
merged 19 commits into from
Dec 3, 2024
Merged

JSON -> YAML for CLI #436

merged 19 commits into from
Dec 3, 2024

Conversation

skothenhill-nv
Copy link
Collaborator

Replaces JSON usage with YAML for the pydantic based CLI.

To do this, we had to add a few custom serializers for types not natively supported by YAML:

  • pathlib.Path dumps directory contents in YAML, so we go to/from string at serialization/validator time
  • Enums arent handled right, so simiarly we do the same thing by just making them strings/enums on serialization/validation.

Copy link
Collaborator

@malcolmgreaves malcolmgreaves left a comment

Choose a reason for hiding this comment

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

LGTM. Minor non-blocking suggestions.

Copy link
Collaborator

@dorotat-nv dorotat-nv left a comment

Choose a reason for hiding this comment

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

thanks @skothenhill-nv ! I left some comments and spot a few places with the reference to json

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
sub-packages/bionemo-esm2/src/bionemo/esm2/run/recipes.py Outdated Show resolved Hide resolved
@skothenhill-nv
Copy link
Collaborator Author

/build-ci

@dorotat-nv
Copy link
Collaborator

@skothenhill-nv , are there any unit tests that test those changes? Otherwise, spotted one typo in docs

@skothenhill-nv
Copy link
Collaborator Author

@skothenhill-nv , are there any unit tests that test those changes? Otherwise, spotted one typo in docs

Yes, sub-packages/bionemo-esm2/tests/bionemo/esm2/scripts/test_pydantic_train.py for esm2, and a similar test for geneformer.

@skothenhill-nv
Copy link
Collaborator Author

/build-ci

@skothenhill-nv skothenhill-nv enabled auto-merge (squash) December 2, 2024 23:18
@skothenhill-nv skothenhill-nv merged commit 793f407 into main Dec 3, 2024
4 checks passed
@skothenhill-nv skothenhill-nv deleted the hillst/yaml-parsing branch December 3, 2024 12:35
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.

5 participants