choderalab / modelforge

Infrastructure to implement and train NNPs
https://modelforge.readthedocs.io/en/latest/
MIT License
11 stars 4 forks source link

Missing keys in Pydantic BaseModel #233

Closed wiederm closed 1 month ago

wiederm commented 2 months ago

I've noticed that if we have operations defined in the TOML files that don't have a corresponding key in the Pydantic BaseModel, these keywords will be silently ignored. This behavior is unexpected in my opinion. I would have expected it to throw an error. I think we should change this current behavior so that it throws an error if operations aren't parsed.

chrisiacovella commented 2 months ago

This is a simple fix: we'll just want to set extra="forbid" in the ConfigDict (e.g., in the ParamBase class)

wiederm commented 2 months ago

Ah, that is easy enough! I will open a PR!