Skip to content
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

vtk: add typing to entire module #38

Merged
merged 5 commits into from
Oct 27, 2023
Merged

vtk: add typing to entire module #38

merged 5 commits into from
Oct 27, 2023

Conversation

alexfikl
Copy link
Collaborator

In my quest to add support for that HyperTreeGrid thing, I started slowing adding typing to the vtk module as well. It should be fairly complete now, but it has some actual changes in there to make mypy happy:

  • Moved the copy from XMLElementBase to XMLElement (doesn't seem to be used anyway).
  • Made the EncodedBuffer an ABC (it looked like it wanted to be a Protocol, but this seemed easier)
  • Added a base class Visitable for DataArray, UnstructuredGrid and StructuredGrid to type "things that can generate XML".

The commits should be pretty independent, so could look at them separately. There may be some fishy things in there, but mypy --strict is happy at least!

@alexfikl alexfikl force-pushed the type-vtk branch 2 times, most recently from a925b13 to d041aed Compare October 20, 2023 18:06
@alexfikl alexfikl marked this pull request as draft October 20, 2023 18:27
@alexfikl
Copy link
Collaborator Author

alexfikl commented Oct 20, 2023

Hm, this removed a space somewhere and it fails some meshmode test. I'll look at it tomorrow :(

EDIT: Found it! Should be ok now 🚀
EDIT2: Added a little test for that in here too (just doing a filecmp with the files that were already generated).

@alexfikl alexfikl marked this pull request as ready for review October 20, 2023 20:14
@alexfikl alexfikl force-pushed the type-vtk branch 2 times, most recently from f9bb411 to a4a292a Compare October 21, 2023 16:34
@alexfikl alexfikl force-pushed the type-vtk branch 2 times, most recently from b995007 to 4d5c816 Compare October 21, 2023 17:34
@inducer
Copy link
Owner

inducer commented Oct 21, 2023

The commit message 'test: check reference output " suggest that output is being checked against a reference (which seems to have been added). I agree that that's a good idea, but I can't find the code that's doing the checking...?

@alexfikl
Copy link
Collaborator Author

The commit message 'test: check reference output " suggest that output is being checked against a reference (which seems to have been added). I agree that that's a good idea, but I can't find the code that's doing the checking...?

@inducer Oops, managed to remove that while rebasing. Should be in https://github.com/inducer/pyvisfile/compare/4d5c8163908a65f6654e8c0d8eed7bf05ea7a5d1..6592dbfa8b3221194e23848d5f3dc800895a86c6

pyvisfile/vtk/vtk_ordering.py Show resolved Hide resolved
@inducer inducer merged commit e05ab72 into main Oct 27, 2023
13 checks passed
@inducer inducer deleted the type-vtk branch October 27, 2023 16:21
@inducer
Copy link
Owner

inducer commented Oct 27, 2023

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants