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

feat: add cat vrs pydantic models #4

Merged
merged 15 commits into from
Oct 31, 2024
Merged

Conversation

korikuzma
Copy link
Collaborator

@korikuzma korikuzma commented Jun 26, 2024

close #2

@korikuzma korikuzma added the enhancement New feature or request label Jun 26, 2024
@korikuzma korikuzma self-assigned this Jun 26, 2024
@korikuzma
Copy link
Collaborator Author

Note for myself. This is up-to-date with current submodules. Just want to test in MetaKB first.

@korikuzma korikuzma marked this pull request as ready for review October 31, 2024 14:52
@korikuzma
Copy link
Collaborator Author

@DanielPuthawala it would be nice once things are more stable to create a test suite of valid and invalid catvars.

@DanielPuthawala
Copy link
Contributor

DanielPuthawala commented Oct 31, 2024

@korikuzma , are you intending to include the maturity status (draft, trial-use, normalized, deprecated) in these models?

CopyChange(v.code.root)
except ValueError as e:
err_msg = f"copyChange, {v.code.root}, not one of {[cc.value for cc in CopyChange]}"
raise ValueError(err_msg) from e
Copy link
Contributor

@DanielPuthawala DanielPuthawala Oct 31, 2024

Choose a reason for hiding this comment

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

@korikuzma Do you represent the EFO codes enum anywhere? I may be missing it, but I don't see it in here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

from pydantic import BaseModel, Field, field_validator


class CatVrsType(str, Enum):
Copy link
Contributor

@DanielPuthawala DanielPuthawala Oct 31, 2024

Choose a reason for hiding this comment

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

So this is less of a problem and more of a thin got keep in mind for later, there are an astronomically large number of possible CatVar types. What we represent in recipes is only a very small subset of that, and do not constitute limits on valid CatVars, they just serve to define common useful CatVar classes of particular interest to the implementors.

@korikuzma
Copy link
Collaborator Author

@korikuzma , are you intending to include the maturity status (draft, trial-use, normalized, deprecated) in these models?

@DanielPuthawala Since VRS-Python does not currently, I was not going to. However, in my Pydantic --> JSON Schema / RST I did include this. Can we do this in a separate issue?

@korikuzma korikuzma merged commit 6b35c8e into ga4gh:main Oct 31, 2024
4 checks passed
@korikuzma korikuzma deleted the issue-2 branch October 31, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create pydantic models
2 participants