Attempt at refactoring the pydantic base classes so we go back to hav…#104
Open
davisadam10 wants to merge 1 commit intodevfrom
Open
Attempt at refactoring the pydantic base classes so we go back to hav…#104davisadam10 wants to merge 1 commit intodevfrom
davisadam10 wants to merge 1 commit intodevfrom
Conversation
…ing a single base class
DevTGHa
reviewed
Jan 14, 2026
| def from_json( | ||
| cls, | ||
| json_file: str, | ||
| led_wall_class: Type[LedWallSettings] = LedWallSettings |
Collaborator
There was a problem hiding this comment.
looking through the code, I think we can remove led_wall_class and use LedWallSettings as it is?
Collaborator
Author
There was a problem hiding this comment.
No we cant, because this gets overloaded by the pyside class. Other wise we load the LedWallSettings not the class needed by pyside which has all the signals etc
Collaborator
There was a problem hiding this comment.
Ah, found the call site of it. Thanks!
DevTGHa
reviewed
Jan 14, 2026
| ) | ||
|
|
||
| # ===== Serialized Fields (from former ProjectSettingsBaseModel) ===== | ||
| openvp_cal_version: str = Field(default=open_vp_cal.__version__) |
Collaborator
There was a problem hiding this comment.
what's the plan for openvp_cal_version?
For example, currently we don't update the openvp_cal_version.
It keeps the loaded version as is; however, I think we should update the version on @model_validator(mode='before') as we upgrade all other fields data.
Collaborator
Author
|
Agree, we should migrate this forwards
…On Wed, 14 Jan 2026 at 11:43, Taegyun Ha ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/open_vp_cal/src/open_vp_cal/project_settings.py
<#104 (comment)>:
> from open_vp_cal.core.resource_loader import ResourceLoader
-class ProjectSettingsBaseModel(BaseModel):
- """Base model for LedWallSettings with typing."""
+class ProjectSettings(BaseModel):
+ """A pydantic model class to handle project settings with serialization and business logic."""
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ validate_assignment=True,
+ )
+
+ # ===== Serialized Fields (from former ProjectSettingsBaseModel) =====
+ openvp_cal_version: str = Field(default=open_vp_cal.__version__)
what's the plan for openvp_cal_version?
For example, currently we don't update the openvp_cal_version.
It keeps the loaded version as is; however, I think we should update the
version on @model_validator(mode='before') as we upgrade all other fields
data.
—
Reply to this email directly, view it on GitHub
<#104 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASZ32GDV3MSHVA25CEGVLL4GYTWBAVCNFSM6AAAAACRNFZ3N2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTMNRQGMYTQOJZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pydantic SIngle Base class