-
-
Notifications
You must be signed in to change notification settings - Fork 415
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 dask settings to preferences #5490
Conversation
Co-authored-by: Pam Wadhwa <pepainter@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #5490 +/- ##
==========================================
- Coverage 89.40% 89.40% -0.01%
==========================================
Files 609 609
Lines 51146 51178 +32
==========================================
+ Hits 45729 45755 +26
- Misses 5417 5423 +6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Hi @Czaki ! Thanks for working on this. It makes sense to me and seems straightforward.
I tried it out and it worked mostly well, except that the dask cache values were not updating properly. I added in a few suggestions to make this work, plus a name change on the update function.
I decided to workaround in another way. Could you check it now? |
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.
It looks and works great!
As I bring here your ideas. Did you have idea how to test it properly? |
I will take a look on Monday morning! |
@ppwadhwa any update? |
@Czaki sorry for the delay. I have gotten caught up in other work. I am looking at this now. Thanks for the ping! |
@Czaki Since there are no tests for the json schema builder, what do you think about adding in a test in the napari/_tests folder with a dummy schema. See if that builds the widget? And include a test for a subschema? I can start working on this, but just wondering if you like this idea? |
Another option would be to add a test to the preferences dialog. |
I like the second option better. If you add in the dask field to the dummy settings there, I think its covering the new lines you added in the widget schema builder. Like this:
|
and maybe add a test to make sure it used the HorizontalObjectSchemaWidget?
|
I do not understand why changes in fixture but this test looks enough for me. |
@Czaki you're right -- the fixture isn't needed. |
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.
@Czaki and I had a live discussion on this — thanks @Czaki for walking me through both PRs! Some of the points of discussion:
- @jni: "ok so you are changing a vendored module, which is not so great, has it been changed already?" @Czaki: "yes, and this is only a minor addition that could be considered a bug fix (min/max for spinboxes)." We discussed that we should pay a bit more attention to how we maintain vendored modules (for example, noting the commit hash of the vendored version and keeping a plaintest set of
.patch
es that we applied to that commit). But this should come in later PRs, clearly, and should not be a prerequisite for these improvements. - @jni: "not sure about the side by side layout, and we should prefer code simplicity to fancy UI." @Czaki: "the design was discussed long ago and I am trying to preserve the design to avoid longer discussions." This is fair enough, and anyway ties into the discussion above about improving vendoring. We should fix in later PRs.
- @jni: "does using qt_json_builder further tie us into Qt in the future? Because we want to eventually have models that are completely separate from Qt and potentially different front-ends, including e.g. a web front end." @Czaki: "No, there are other frontends for json-schema so this approach is actually quite portable."
So I'm happy with where this has landed. Thank you @ppwadhwa for all the initial work here and iteration which led us to this point, 🙏 and thanks @Czaki for picking it up and pushing it over the finish line! 🙏 (And for the live walk-through.)
Note: I would like to add that the code vendored is not an actual package, just a repo created by the user. I also talked to him about maintaining it and making it an actual package. This is on my to do list, so that we would not have to vendor it but just install it and extend it. Also as @Czaki this method of using the json schemas is what other tools like Jupyterlab currently use to handle settings and autogenerate the UI from it -> see reference PR jupyterlab/jupyterlab#11079 |
Co-authored-by: Pam Wadhwa <pepainter@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Pam Wadhwa <pepainter@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Pam Wadhwa <pepainter@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Pam Wadhwa <pepainter@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Pam Wadhwa <pepainter@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Description
This is the alternative implementation for #4436 PR with using core
qt_json_builder
features instead of magicgui.The main advantage of this PR is that it introduces a general mechanism for easily add similar fields in future
Same as in the original PR there are no tests.
Type of change
References
How has this been tested?
as there are small differences between the two Qt bindings.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.