-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Mesh into a dataclass #400
Conversation
a686130
to
83183c9
Compare
df928ae
to
12a8c99
Compare
36ef3d4
to
19286d4
Compare
@inducer I think all of my initial questions are solved now, so this is ready for a proper review.
I'm thinking of leaving this for a followup PR, since this is sufficiently big? |
11cc84f
to
7aa1897
Compare
7aa1897
to
2597d82
Compare
2597d82
to
be847ea
Compare
Pushed a commit that ports the internal uses of |
b294d8b
to
8293f58
Compare
I guess I sort of understand why you might have changed the |
d39c715
to
232e0a8
Compare
That's fair enough. It definitely makes the porting easier 😁 Thanks for helping with that and fixing all the issues! |
Thanks for getting this most of the way! |
This starts making
Mesh
into a dataclass. Right now it's mostly just porting away frompytools.Record
, since it's hard to make it a clean dataclass while being backwards compatible.The main additions are:
make_mesh
factory function that does all the work of the Mesh constructor.check_mesh_consistency
function that does all the checking. This seemed useful to make public, since the dataclass version won't do any checking onreplace(mesh, ...)
and it may still be wanted sometimes?get_nodal_adjacency
andget_facial_adjacency_groups
to replace the property versions.The nodal / facial adjacency attributes were very annoying. Currently it overwrites__getattribute__
to make it behave a bit like before. Let me know if you have some better ideas on how to make that work..This is still a WIP, but I had it lying around for a while, so might as well. Things still to do: