Version 4 of the Erasing Elements Code#11492
Version 4 of the Erasing Elements Code#11492chennes merged 4 commits intoFreeCAD:mainfrom mac-the-bike:erase-version-4
Conversation
|
@marioalexis84 can you weigh in ? |
|
Version 4? Does this imply there have been earlier PRs or issues? The PR doesn't note a known bug or issue in the tracker. Can we get some context on what problem this is solving? |
|
@sliptonic historically there have been 2 PRs before this: Related forum thread: https://forum.freecad.org/viewtopic.php?f=18&t=70978 |
|
Note: I've fixed the headers in a separate branch luzpaz@05b3ab2 I tried pushing them to this PR without success. |
|
PR: 11492 the reason for writing this was to enable users to display parts of their mesh that were hidden by other parts. i had a look at the windows error - my knowledge of c++ is not sufficient to correct the problem, as you have already deduced. these definitions should be in: |
|
@marioalexis84 did you get a chance to review? Aside, could a merge dev please push my changes #11492 (comment) ? |
|
@adrianinsaval can you help here ? TIA |
| std::string Fem::FemSetElementNodesObject::elementsName; | ||
| std::string Fem::FemSetElementNodesObject::uniqueElementsName; |
There was a problem hiding this comment.
these lines are problematic
"C:\FC\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\FC\build\src\Mod\Fem\Gui\FemGui.vcxproj" (default target) (77) ->
(ClCompile target) ->
D:\a\FreeCAD\FreeCAD\src\Mod\Fem\Gui\Command.cpp(1192,13): error C2491: 'Fem::FemSetElementNodesObject::elementsName': definition of dllimport static data member not allowed [C:\FC\build\src\Mod\Fem\Gui\FemGui.vcxproj]
D:\a\FreeCAD\FreeCAD\src\Mod\Fem\Gui\Command.cpp(1193,13): error C2491: 'Fem::FemSetElementNodesObject::uniqueElementsName': definition of dllimport static data member not allowed [C:\FC\build\src\Mod\Fem\Gui\FemGui.vcxproj]
There was a problem hiding this comment.
these are already declared in FemSetElementNodesObject.h
I will be able to work on this in 2 weeks |
|
luzpaz
Can you give me some help? I have made changes to the code and I now want to merge them into the "erase-version-4" branch.(I have noticed that there is another branch, called origin, which seems to be a reformatting job.)
There are 5 files that have changed - I just want to update this code, all the other code in unchanged.
Previously I did this:
git checkout -b erase-version-4git remote -vgit config --listgit statusgit add .git config user.email ***@***.*** config user.name "mac-the-bike"git remotegit push origin erase-version-4git commit -m "Version 4 of the Erasing Elements Code"now create Pull Requestgit branch
When I type the first command, git replies by saying that the branch already exists - how do I update the code?
I am a bit cheeky sending you this email but I hope you can help.
Peter
On Sunday, 3 December 2023 at 14:02:28 GMT, luzpaz ***@***.***> wrote:
@adrianinsaval can you help here ? TIA
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
I am in the middle of changing the code in order to make it more robust - so for the moment no more checks. (I am sorry this is abrupt, it is not meant to be.) |
|
@mac-the-bike did you pull in my changes ? (#11492 (comment)) |
|
luzpaz: the short answer is no. I have made changes to 5 files, (FemSetElementNodesObject.h, Command.cpp, TaskCreateElementSet.cpp, TaskDlgCreateElementSet.cpp, README.md) since my latest go in November. I will incorporate your changes into these files. The other files that you have changed can be left as they are. I hope this is clear. Now for some help, how do I create a branch that is derived from your branch 05b3ab2? ( I use the github GUI.) |
|
luzpaz I have checked the stuff from what I thought was 05b... but I think I have copied the FreeCAD master. This: I have looked at: I have also noted that there are some other changes, as in Shortcuts.cfg, that I also need to include. How do I get a copy of the code in (1)? |
|
@mac-the-bike the diff for my branch is at https://github.com/luzpaz/FreeCAD/commit/05b3ab208ae0bd28a0d76b821949eeb5218f3a4d.diff (i just added So you can easily run something like this one-liner from the CLI: (make sure you're in your branch)
|
|
Wed 24 Jan 15:07:44 GMT 2024 luzpaz I have reloaded my code - this includes your latest changes together with updates that have occurred since I first downloaded the code, December 21. (The changes that affect my code.) It is in: mac-the-bike/FreeCAD, with branch: mac10 You can take this new version and use it for yourself. The name for the changes is: I hope that this is the last set of changes I am going to do(?) Thanks OS: Ubuntu 22.04.3 LTS (GNOME-Flashback:GNOME/gnome-flashback-metacity) |
|
I compiled the mac10 branch on Ubuntu 22.04.3 and tested this tool. It's really cool. Can you just consider adding those two little features ?
If it's pretty much ready, I think that you can switch it from Draft to Open. |
|
@mac-the-bike just a heads up for the upcoming feature freeze: |
|
this is the conflict: This is what I want (i.e. inclusion of CreateElementsSet). |
|
this breaks compilation on windows with conda: @wwmayer do you have an idea how this could be fixed? |
|
They are also public member variables, which is a bit of a "code smell". I can't quite figure out what's going on with them -- why is |
Will have a look later today. ATM I am busy to clean up some other messes. |
I'd like to know more. We're doing the best we can with the merge process, which is working well. IMHO, an occasional revert is expected If we're going to move fast. It's not the worst thing in the world. That said, we should learn as much as we can from every mistake and mess. Is there anything we could have done in the merge process to avoid the mistakes? |
|
Two years ago there were some discussions about improving the code quality but basically nothing is practised.
It is very frustrating to spend day after day to get the most serious issues fixed again. |
Indeed. This is good feedback but I'm not sure exactly how to proceed. The maintainers review PRs every week and there are a LOT of PRs to review. Fortunately most are small. Assuming it complies with the overall contributing policy, our procedure is to look for a reason to reject it:
If it passes those five filters, we move ahead. We're very happy to push back on code quality. When we see questionable code, we ask for code reviews from experts. We try not to request reviews for every little thing. Even so, lots of times we never get a reply from the reviewer. Then we're stuck. We either take the code as-is or the PR sits in limbo. When this happens, we assume that if the reviewer didn't answer, they must be ok with the code. We never want to ignore the CI but when CI failures happen, we are again stuck. Either all PRs sit until the issue is resolved, or we assume that the CI failure is noise. That's a bad assumption but often unavoidable. The Conda failure has been happening for months. It's purely a timeout on github and has nothing to do with the code. This particular issue is the case where we made a mistake. We assumed that the CI failure we was the same false positive that was affecting other PRs. It was, in fact, masking a real failure. |
Do reviewers checkout a PR locally, build it and test it? At the time when I mainly did the code review I almost always did it in these steps:
This is a very time-consuming way of checking a PR but also a good way to avoid serious regressions.
So, am I right that if a reviewer doesn't reply on requests but the CI pass then you will merge the PR? And how do know that the PR doesn't cause problems?
If a PR failed because of a timeout it's fine to ignore the specific CI that caused it.
Hmm, but it was already realized in December 2023 that this PR fails on Windows (see #11492 (comment)). Since then the PR was not touched to fix the failure. |
Anything that actually fixes a bug or adds a feature gets built by somebody.
This is definitely an area where we can improve. I'm not suggesting that the maintainers/reviewers should be writing the unit tests but that we should insist on more unit tests from contributors. It would help to have guidelines for when unit tests are required.
It will also help to get the rest of the application under recommit. CAM still isn't but will be soon.
You are willing to take on more personally with the PRs than most maintainers. Writing those additional unit tests, fixing linter problems, fixing small regressions is going above and beyond the call of duty. I think we should have a high (but clear) standard for acceptance and it should be the contributors responsibility to meet it.
Most of the time somebody has built the PR and tried things. Obviously it's impossible to guarantee that it won't cause some other problem. Reviewers can only do their best and unit test coverage isn't complete. If we're only going to merge code that we're 100% confident of, we're going to move much much slower. That will be frustrating to both users and contributors. A good question is: How much risk are we willing to accept?
Ok, but that's a form of risk-tolerance. The timeout failure could still be masking a deeper failure.
Right. Exactly. In retrospect, this one is pure human failure. Not any one person but collectively. We had 6 or 8 people in the meeting. We had reviewed something like 40 PRs already. There was discussion that indicated it was ready to go and a good feature. We collectively looked at it and made a mistake. The lesson I learned from this one is this heuristic: The older a PR is, the higher the level of scrutiny should be. Considering the number of PRs reviewed every week, the process works. The more people attend the merge meetings the better. Not only do we get a lot of stuff done, but we're learning from each other how to scrutinize things, how to push back on contributors, and we're improving our processes. Mistakes will still happen and we should do this kind of post-mortem every time. |
|
There are some concrete steps that we can take to address some of these failures:
|
It's basically not our task to fix warnings of 3rd party libraries. This is up to their maintainers. To handle FreeCAD related warnings I've recently added a CMake option FREECAD_WARN_ERROR (only gcc and clang) that stops with an error if a warning is raised -- but only for FreeCAD code. However, it's not recommended to make this on by default or activate it for the CI builds because for newer compilers we will get many warnings that we cannot fix (e.g. OCC code causes many deprecation warnings due to a deprecated iterator declaration).
Fully agree with you.
It's nice to have but I don't consider it an urgent issue. Failures with missing headers is something we get from time to time due to the huge amount of library versions. Usually such failures are found and fixed very quickly. In terms of clean code there is this nice little overview of one of Uncle Bob's book: |
|
thanks everybody for all your help. Problems with elementsName and uniqueElementsName These appear in both: Solution: My only excuse for this situation is that I compiled in Ubuntu 22.04 with no problems. |
|
@mac-the-bike I documented this tool on the wiki (https://wiki.freecad.org/FEM_CreateElementsSet) but I have one doubt - what is the purpose of the Copy button? How is it supposed to work and when can it be used? |
|
FEA-eng, Thanks for doing this work - I wouldn't know where to start. COPY - this is explained in the user's guide - I hope it is an explanation. I am attaching 3 files:
ALSO, |


Version 4 of the Erasing Elements Code:
this function allows the user to erase, not delete, elements in order to more easily view parts of the mesh.