Skip to content

Commit

Permalink
Attempt to get the new values
Browse files Browse the repository at this point in the history
  • Loading branch information
kratman committed Dec 20, 2024
1 parent d20183d commit d9ad3ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bpx/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,13 @@ def __init__(self, **data: dict) -> None:
data[k] = InterpolatedTable(**v)
super().__init__(**data)

@property
def extra_fields(self) -> set[str]:
return set(self.__dict__) - set(self.model_fields)

@model_validator(mode="before")
@classmethod
def validate_extra_fields(cls, values: dict) -> dict:
print(values)
for k, v in values.items():
if not isinstance(v, get_args(FloatFunctionTable)):
error_msg = f"{k} must be of type 'FloatFunctionTable'"
Expand Down

0 comments on commit d9ad3ae

Please sign in to comment.