-
Notifications
You must be signed in to change notification settings - Fork 0
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
add generic solver #1
Comments
I have no own fork of FreeCAD. I just could fork from your's. But I am rather unexperienced with branching. Could you shortly outline a typical workflow, if I only want to work on your generical solver proposal branch? (My other project is only a python workbench, so there's no interference with the FreeCAD repo necessary.) Uh, nevermind. Maybe I should have read http://www.freecadweb.org/wiki/index.php?title=Source_code_management :-) |
Good article. How far did you come? I would do like this:
I could also add you as a contributer to this repository, but I think it's not possible to give access only to one branch. So I think it's better to take the pullrequest approach. This is maybe a bit more difficult for you, but it's the way how developers at freecad work, so maybe it's a good idea to learn it anyway. And once you have worked a bit with git, it's not difficult anymore... |
Thank you for the introduction. I didn't understand the reset branch step at 5.b.2. Could you please explain that part shortly? I have no problem with the pullrequest approach. I think the contributor approach is only useful for a small project. And you're right: I have to learn it anyway sometime. My first pull request will only contribute to your proposal document anyway so I cannot mess up the code ;-) |
Somehow I have messed with the lists... if you have created a branch you can simple reset the branch by the state of another branch. "git checkout -b new_branch" creates a new branch which is identical to the previously active branch. |
OK, I had your branch and created my own with git checkout -b 'genericsolver_joha'. afterwards i renamed the file due to a typo in the filename and did git commit -a -m 'file renamed'. then i did git push and he told me that everything is up to date, although i changed the file. what did I do wrong? |
what was the message at git commit -a -m ? normally you have to add a new (renamed) file with "git add file_name" |
git commit -a -m 'msg' adds all changed files to a commit and puts msg on that commit. now with the push i did git push --all -u now there are two branches on my fork: genericsolver_joha and genericSolver. is this correct? |
now i will delete my branch here at github. if i want to have the newest changes to your branch i have to do: git fetch loooo/genericSolver? then git checkout -b mynewestchanges and git commit -a -m, git push --all -u. then at some point pullrequest, commit commit commit, and after merge delete the branch mynewestchanges again. same game again and again? |
hmm, never used that command. "git push --all -u" most likely will add all your local branches to github. I don't think this is what you wanted. But it's no problem to delete a branch on github... "git branch -D branch_name" I have merged your commit. There were actually 2 commits. The one you have made and one merge-commit. Next time I will try to avoid this. I think there is also an option to use re-basing as merge-strategy..., which will lead to a cleaner history |
you do not have to delete your branch. after fetching you can do this: this will add all my commits to your current branch. (but at the moment the branches are the same. so nothin will happen) |
hm I still don't understood it. too much new things to learn :D could you please show me an appropriate workflow loop (from update from your branch to pull request and to be ready for the next workflow loop)? my git behaves also strange or somehow different than yours :-( sorry that i ask these dumb questions, but i only contributed to a small project where pull requests only without branching are sufficient :-( |
ok I have now rebased on freecad/master. So you can try to update your branch:
now you add things, change stuff ...
and then do a pull-request... thats all. |
oh oh, somehow the last file rename has been vanished. ok, i'll try your loop and see if it works. thanks btw. for writing all this stuff down :D |
ok now you can see my second pull request: but there are conflicts. i don't understand why. |
Somehow your first commit is not there anymore. Maybe you rebase your local branch on my branch again. |
just the rebase command or do i also have to perform the command with push origin +genericsolver_joha? |
I have merged your pull request manually. What I have done is the following:
That would be the way how you could have done it. Yesterday I wanted to compile freecad, but I have big troubles with that at the moment. Especially as we need the netgen/occt7 package for fem... And there are so many other new things... I will try to get anaconda builds updated first and then go on with this branch. |
I am also messing around a bit :-) I have renamed your commit, because there was the "rename file" twice. Hopefully this is ok. You can edit commits with "git rebase -i HEAD~2" where 2 is the number of commits you want to go back to make changes. With this you can edit commit messages and join commits. But this all is a bit dangerous when there is some bigger work involved. So trying it out first on a temp_branch makes always sense. |
Thanks for repairing my mess :-). My main problem is, that i don't understand most of the commands really. And reading in the git help doesn't help because there are too much information and no simple examples (it's getting to difficult for an unexperienced user). Anyway i also set up a new freecad clone within my docker image with fenics and have to finish compiling, therefore there is no hurry necessary :-) but i certainly will ask a few questions about the workflow: e.g. is our workflow to only have two (genericSolver and genericsolver_joha) branches and do pull-requests from one to another or do i have to create a new branch for every changeset i'll intend to do? |
Now on my docker I merged my local genericsolver_joha branch from your looooo/genericSolver branch and got 38 commits from files which are in other parts of FreeCAD. is that correct? did you a merge from the FreeCAD master?
i think this works because we are only two developers. as far as i understood performing rebase in my branch from your branch is ok, but the other way around is not ok. is this correct? |
Ah now I see: Your branch is 41 commits behind FreeCAD/master and i forked from FreeCAD/master. Therefore the large difference. |
hmm i have rebased on freecad/master yesterday. So there shouldn't be that much commits between these branches. regarding merge vs rebase: Doesn't git merge add a merge commit message? I have rebased again. i think this works because we are only two developers. as far as i understood performing rebase in my branch from your branch is ok, but the other way around is not ok. is this correct? The pull-request on github has the option to merge with a rebase. That is was I wanted for your first pull request. But I have choosen merge, and then there was this merge commit, which is not really necessary. So I think rebasing my branch on yours if you are some commit in front of my branch isn't a problem. |
yes, but i didn't push yet. i wanted to know your opinion for that first. |
Ah ok, now we are equal. The pull request clearly shows. And this is how it should be. |
I am wondering what your last pull-request was all about. All commits are already in the commit history of my branch. rebase is better, beause there is no merge commit. |
The last pullrequest was only a test. I wanted to make sure that we are at the same starting point. Sorry for that i am learning the git basics in our forks :-( :-) |
No problem. But there is something wrong with your branch. Maybe you simply reset it with my branch: 'git reset looooo/genericSolver' then these two branches are definetly equal without additional merge commits. It could be my fault that the branches diverged that much.... But if you have a clean commit history (no unnecessary merge commits) I could simply accept the pullrequest via github, and we wouldn't have any problems. Maybe this was the problem. |
ok. i performed the the git reset status, but my git informed me that my branch is 17 commits behind origin/genericsolver_joha. it asked me to perform a git pull to be up-to-date. is this correct? |
I had not that much luck. My graphics driver seems to segfault when I start FreeCAD within the docker image. I have to further investigate this issue. Meanwhile I will have a look at your code ;-). |
OK now it works also for me. Time to go to bed ;-). Would it make sense to open a Wiki here at your fork again (at least for persistent information)? I would like to share my information about setting up a docker image. Maybe it would also be useful for others if you would share your setup information for the anaconda repo. |
nice to hear you have figured out the problem. Would it make sense to open a Wiki |
another issue with isatty: |
Perhaps FreeCAD and fenics expect different boolean values from isatty. Could you show me a picture of this issue? |
Strange! Where does the change of the workbench "Wechsel von Arbeitsbereich" take place in the source? I grepped through the source and found some VC9 comments about isatty. But nothing which fits into our problem. |
I think the traceback is partially reported to this window. Tested the workaround, and it also isn't working. Placing this in the file gives the same error:
In the freecad-console sys.stdout has no autocompletion for isatty. So there is maybe something wrong with the implementation I have made. |
Can you please give me a link to your correction? |
Looks correct. Maybe there is some other registering instance? Maybe wernerh could help us in the forum? |
ahh, the console report errors in the console. So this works. But the file in the fem-wb is sending the messages to the reportview. Docs of OutputStdout
so the isatty function must implemented for these classes too. |
Sorry, I don't get it. For which classes you also have to implement the isatty() method? |
Did it work? :-) |
My workflow with conda is a bit time intensive. At the moment there is no way for me to build only changed files for freecad. So I have to compile the full source all the time something changed in c++. As I forgot some things (like adding files to CMakeList.txt) I had to build several times. This is a bit frustrating. So I had no chance to try the fix yet, but I am pretty sure the additional isatty function will solve the issue. |
Yeah sounds frustrating! The docker workflow is also rather complicated I think. This is because you only have this sandbox and you have to mess around with access permission a lot. At the moment the description is more or less "hingerotzt", so maybe it is not that useful. But If you have problems from this description, we could still improve it. Now I have the git problem again: So maybe I will as a first step just clone your source and try to compile it. :-) |
instead of cloning:
Btw. There is another error with the added files. |
Path: Fix `ZigZag` pattern; Remove some comments
Path: Extend fix to `updateVisibility()`
Fixes Coverity issue: CID 316539 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) uninit_member: Non-static class member lastHasPartialRedundancies is not initialized in this constructor nor in any functions that it calls.
Coverity warnings fixed: CID 316517 (#1 of 1): Uninitialized scalar variable (UNINIT) 13. uninit_use_in_call: Using uninitialized value t. Field t.err is uninitialized when calling push_back CID 316519 (#1 of 1): Uninitialized scalar variable (UNINIT) 3. uninit_use_in_call: Using uninitialized value v. Field v.tstart is uninitialized when calling push_back CID 316547 (#1 of 1): Uninitialized scalar variable (UNINIT) 13. uninit_use_in_call: Using uninitialized value t. Field t.err is uninitialized when calling push_back CID 316556 (#1 of 1): Uninitialized scalar variable (UNINIT) 3. uninit_use_in_call: Using uninitialized value v. Field v.tstart is uninitialized when calling push_back
Coverity warnings fixed: CID 316550 (#1 of 1): Uninitialized scalar variable (UNINIT) 13. uninit_use_in_call: Using uninitialized value sel. Field sel.pResolvedObject is uninitialized when calling push_back
Coverity warnings fixed: CID 316559 (#1 of 1): Uninitialized scalar variable (UNINIT) 3. uninit_use_in_call: Using uninitialized value we. Field we.idx is uninitialized when calling push_back CID 316549 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 4. uninit_member: Non-static class member pageheight is not initialized in this constructor nor in any functions that it calls. CID 186161 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR) 2. uninit_member: Non-static class member parent is not initialized in this constructor nor in any functions that it calls. CID 305170 (#1 of 1): Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking this->m_baseFeat suggests that it may be null, but it has already been dereferenced on all paths leading to the check. CID 186152 (#2 of 2): Uninitialized pointer field (UNINIT_CTOR) 3. uninit_member: Non-static class member m_mdi is not initialized in this constructor nor in any functions that it calls. CID 192588 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT) pointless_expression
Coverity warnings fixed: CID 305123 (#1 of 1): Logically dead code (DEADCODE) dead_error_line: Execution cannot reach the expression this->linked inside this statement: if (role == Qt::TextColorRole && linked)
Coverity warnings fixed: CID 129530 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 2. uninit_member: Non-static class member pixelScalingFactor is not initialized in this constructor nor in any functions that it calls.
Prevent matplotlib selecting the PyQt API instead of PySide2
TODO
proposal
The text was updated successfully, but these errors were encountered: