-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[FEATURE] [needs-docs] Classify symmetric #6120
Conversation
All checks have passed ?? Alleluiaaaaa :-) |
@Gustry Would you like to take a look ? |
I will try your PR later. But I can't review C++ yet ;-) You will need to update your |
Can you also update your branch? Some of your issues with QgsdoubleSpinBox might be fixed. Better to try your PR with a fresh master branch. Thanks |
So I did: change "since 3.0" to "since 3.2", git commit
git branch --vv gives : " 15 behind master, 1265 ahead" Thank you |
Yes you should |
If you use the rebase command, yes you have to force push your branch. With rebase, you "re-played" the history of your commits, that you got the error "non-fast-forward". |
2f58592
to
7505668
Compare
Thank you for your replies. A complementary question :
the files are changed and after that, the compilation lasts 2h. That's why I would like to avoid checkout (maybe it will not change anything?). Is it possible to update master without checkout ? Something like :
|
As soon as you update the branch with master, it will take time to re-compile. It depends how old your branch was and files that have been updated in master. |
Yes, it is already installed.
I have only 1 build directory but I never try to compile master. |
As soon as you rebase on master, the build will be longer, because it needs to recompile the branch. Can you include some description and new screenshots in the PR? I know it was in the previous PR, but it will be easier for reviewers to see the UI from this PR. I gave it it a try today, it was working fine. |
Thank you Etienne, I put the description in my first post |
This is awesome(!) but I see some problems which I will detail later today. One that is easy to explain is the width the Styling Panel gets with this. Hit F7 to show it and you will see. I guess the elements should refloat to a vertical layout if needed. |
Hello, |
This small conflict can be resolved online, but for the moment, I don't dare to click on the "commit merge" button because it messed up my things last time. |
Hi @pierreloicq |
bc5a430
to
1cb26a8
Compare
Thank you @DelazJ, it worked fine. |
I just gave a quick look on the files. You need to remove the file ending by Do you mean that all issues from @kannes are fixed? |
Yes, all issues form @kannes are fixed. |
Another SIP issue due to #6986 |
1d0bda0
to
8761ad6
Compare
Done ! |
4d7816f
to
04c097d
Compare
Now I have a qgsgraduatedsymbolrenderer.sip generated during the compilation but none in my source. And the compilator says : |
Looks like a problem that sipify doesn't understand list initialization.
|
Thank you Matthias, it works. |
Yes |
Good ! I try to test my function _makeBreaksSymmetric but this is not a class function and it does not seem to be taken into account during the test. I pushed so that you can take a look. Thanks |
@@ -31,6 +35,7 @@ class TestQgsGraduatedSymbolRenderer: public QObject | |||
void cleanup();// will be called after every testfunction. | |||
void rangesOverlap(); | |||
void rangesHaveGaps(); | |||
void _makeBreaksSymmetric(QList<double> &breaks, double symmetryPoint, bool astride); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you call _makeBreaksSymmetric
without arguments?
This is a list of function that the test will call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no the 3 functions are linked, if I want to call it line 152, arguments are needed (compilator complains)
|
||
QVERIFY( breaks.contains( symmetryPoint) ); | ||
// /!\ breaks contain the maximum of the distrib but not the minimum ? | ||
QVERIFY( breaks.count() % 2 == 0 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using ==
use QCOMPARE
breaks = unchanged_breaks; | ||
symmetryPoint = 12.0; | ||
astride = false; | ||
_makeBreaksSymmetric( breaks, symmetryPoint, astride ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit puzzled by this call. Will this not create an infinite recursion on this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how I am supposed to apply my function then.
I tried lot of things, its the only version that compiles.
Am I supposed to declare my parameters in init() ? Maybe with a pointer so that I can access them after without parameters ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you want a test function (without parameters) that calls this function with appropriate parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. Something that works will be enough.
Maybe I am obliged to make _makeBreaksSymmetric() a class function ?
@kannes you asked me
I can do that by using the valueChanged signal instead of editingFinished, but then I cannot type the number with keyboard, it's always erased by the initial value, and I didn't find a way to bypass this so I put back the editingFinished. |
Here are the tests. They are not successful if the values to classify are below something like 1E-6. Is it expected that, using doubles, 2.6E-06 - 2E-06 = 0 ? |
Nice work about your unittest. It seems you could manage it. |
I could try the PR. Looks good! No crash. @kannes did a review already. |
Both are more future-proof
These are advanced settings which we don't want to show up front, at risk of hurting UI simplicity
@pierreloicq I just pushed a couple of last minute fixes/tweaks. Just some minor code conventions (use of switch statements when comparing enums, and hiding some private api from the python bindings -- we don't want single use methods exposed as they become subject to the stable API contract, and we may want to tweak the ui in future and need to modify these methods). I've also reworked the UI so that it works nicely in the docked widget mode (everything needs to be nice and narrow for that to work). Let's see what Travis says... if this passes, I'll merge for 3.4! Thanks for all your hard work here 🎉 |
...and in for 3.4! Thanks again @pierreloicq ! |
Thank you guys, I'm so happy :-) :-) |
Better send in a follow up PR, adding yourself to the contributors map! ;) |
Hello,
The goal of this PR is to have symmetric colors and hence classes around a value. It works for equal interval, s.d. method and pretty breaks.
For equal interval and s.d. methods, there is box for the user to put the pivot value. For this, I do not manage to remove the clear button of QgsdoubleSpinBox although ShowClearButton returns false.
For pretty breaks, the pivot value is one of the pretty breaks.