-
Notifications
You must be signed in to change notification settings - Fork 54
Vasily/refinement_region_clean #2398
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs unit tests which checks that new classes can be successfully instantiated and that they also fail when expected
@@ -126,6 +216,12 @@ class DistanceUnstructuredGrid(UnstructuredGrid): | |||
"``dl_bulk`` is used instead.", | |||
) | |||
|
|||
mesh_refinements: Tuple[Union[GridRefinementRegion, GridRefinementLine], ...] = pd.Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this cause any sporadic error messages? We typically need to add annotate_type
in such situations like here https://github.com/flexcompute/tidy3d/blob/develop/tidy3d/components/simulation.py#L2289, otherwise pydantic would loop through all allowed classes when initializing this field and some of which fail and show an error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can create a special type for Union[GridRefinementRegion, GridRefinementLine]
like it is done in other places, if it is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for that, just meant to wrap Union[GridRefinementRegion, GridRefinementLine]
into annotate_type(Union[GridRefinementRegion, GridRefinementLine])
Clean implementation of the mesh refinement structures