Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

vasilyzabelin
Copy link
Contributor

Clean implementation of the mesh refinement structures

Copy link
Contributor

@dbochkov-flexcompute dbochkov-flexcompute left a 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(
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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])

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants