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
[FEM] Elmer: refactor writer #8362
[FEM] Elmer: refactor writer #8362
Conversation
donovaly
commented
Feb 5, 2023
- the writer.py is to large to keep the overview, thus sort out the handling of the different equations (also since more equations will be added)
- This PR sorts out the electrostatic equation handling is the test balloon if this works well (local tests are all OK)
There will be a short delay before I can look at this, I spend tomorrow on airplanes. I will look when I am able, but if other reviewers approve don't wait for me :) . |
No problem. If you could tell me if I did it right with the underscore naming of the defs this PR should be an easy merge since no code is actually changed, just moved around and the CI tests assure that everything works. |
Here is an electrostatics test file to check the PR: |
@chennes , I wish you a good flight back home. Many thanks for all your great work for FreeCAD! I hope we once meet in person (my plan is since a while to organize a full FC conference - one weekend just for FC) |
da13170
to
b7a02f0
Compare
JFYI, Some trailing whitespace introduced in this PR: https://github.com/FreeCAD/FreeCAD/actions/runs/4098361865/jobs/7067414783 |
Where do you see this? I only got one reported. This is now fixed together with other things noted by Pylint. |
00f4e9c
to
fe8f573
Compare
- the writer.py is to large to keep the overview, thus sort out the handling of the different equations (also since more equations will be added) - This PR sorts out the electrostatic equation handling as first step (more equations will follow once this is merged)
- output only a reasonable number of digits for vacuum permittivity - output the FC label of potential constraints as comment (helps a lot when having several constraints)
fe8f573
to
76695aa
Compare
Side note: we should have a discussion, maybe in a GitHub issue, about the Pylint config file. If you and I are both using it, and the CI runs it, I feel like it could use some fine-tuning so it does not actually encourage worse code. That said, one way of checking that you have the correct functions underscored or not is to underscore all of them, and then run pylint and see which calls it yells at you about: it should complain about any non-self-prefixed calls to underscored methods. That's useful when refactoring big code where you don't know exactly what needs to be public. |
This is what I already did - I checked the Pylint output of the CI and apply fixed accordingly. I think I caught all underscores now. In General, since I am no Pythionist, call myself "just a user" ;-), I cannot state about how Pylint is configured. |
OK, I think this PR is a safe code refactoring. I used it a lot the last day and since no code was actually changed, I need to merge it in order to get other PRs ready. I will continue the sortout in further PRs. |