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

Remove 'model_' from ML doc field names #924

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

tsmathis
Copy link
Collaborator

@tsmathis tsmathis commented Jan 16, 2024

The fields model_name and model_version in the MLDoc clash with the protected namespace model_ that exists in Pydantic 2. See here, where the warning arises to prevent collisions with BaseModels methods.

Proposed fix is to change model_name and model_version to just name and model

@tsmathis tsmathis requested review from janosh and munrojm and removed request for janosh January 16, 2024 22:27
@tsmathis
Copy link
Collaborator Author

@munrojm, per our discussion

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fdbd3a4) 90.54% compared to head (8b77f16) 88.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #924      +/-   ##
==========================================
- Coverage   90.54%   88.87%   -1.68%     
==========================================
  Files         139      109      -30     
  Lines       13203    10048    -3155     
==========================================
- Hits        11955     8930    -3025     
+ Misses       1248     1118     -130     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tsmathis tsmathis marked this pull request as draft January 16, 2024 22:39
@tsmathis tsmathis marked this pull request as ready for review January 16, 2024 23:05
@@ -55,8 +55,8 @@ def __init__(
model_name = {"chgnetcalculator": "chgnet"}.get(model_name, model_name)
pkg_name = {"m3gnet": "matgl"}.get(model_name, model_name)
self.provenance = dict(
model_name=model_name,
model_version=version(pkg_name),
name=model_name,
Copy link
Member

Choose a reason for hiding this comment

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

is just model ok? clearer what it refers to than name imo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense to me! Changing to model also doesn't result in any runtime warnings, so should be all good.

@janosh janosh merged commit 8bfc343 into main Jan 17, 2024
10 checks passed
@janosh janosh deleted the ml-doc-pydantic-schema-compliance branch January 17, 2024 17:29
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.

None yet

3 participants