Skip to content
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

fix: Allow user to overwrite default widget opts #602

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

Czaki
Copy link
Contributor

@Czaki Czaki commented Oct 20, 2023

This PR fixes napari/napari#6354

It also renamems multiple variables starting from _ to ending with _ as it is convention to use leading underscore as an unused variable when it is a local variable in functions so make it harder for me to follow flow of code.

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2fa477d) 87.98% compared to head (628b6a8) 87.98%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #602   +/-   ##
=======================================
  Coverage   87.98%   87.98%           
=======================================
  Files          39       39           
  Lines        4609     4609           
=======================================
  Hits         4055     4055           
  Misses        554      554           
Files Coverage Δ
src/magicgui/type_map/_type_map.py 96.40% <100.00%> (ø)
src/magicgui/widgets/bases/_create_widget.py 93.75% <83.33%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Czaki
Copy link
Contributor Author

Czaki commented Oct 20, 2023

It looks like a failure of the docs is unrelated to PR.

@tlambert03
Copy link
Member

Since the pr is mostly rename now, can you point out which part specifically fixes the napari issue ?

widget_type_ = match_type(type_, value)
if widget_type_:
cls_, opts = widget_type_
return cls_, {**opts, **options}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this

widget_type_ = match_return_type(type_)
if widget_type_:
cls_, opts = widget_type_
return cls_, {**opts, **options}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here same change, but it is not the code branch reached by the original issue.

@Czaki
Copy link
Contributor Author

Czaki commented Oct 20, 2023

the change is to change {**options, **opts} to {**opts, **options}

@tlambert03
Copy link
Member

thanks!

@tlambert03 tlambert03 merged commit acc9bbb into main Oct 20, 2023
33 of 34 checks passed
@tlambert03 tlambert03 deleted the allow_overwritte_default_opts branch October 20, 2023 12:03
@tlambert03 tlambert03 changed the title fix: Allow user overwritte default widget opts fix: Allow user to overwrite default widget opts Oct 20, 2023
@tlambert03 tlambert03 added the bug Something isn't working label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in progress bar behaviour in examples/mgui_threadworker_.py
2 participants