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: Only allow YAML save/load when YAML available #347

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

gselzer
Copy link
Contributor

@gselzer gselzer commented Jul 18, 2024

This PR avoids exceptions arising from the attempt to save/load MDA settings from YAML files, when pyyaml is not installed.

Notably, I made the decision to prevent the selection of a YAML file within the QFileDialog. We could have alternatively shown it, but prevented the exception (through a try/except or other means) instead. I prefer this method as it leaves no room for unexpected behavior (namely a user trying to save into a YAML file and then save not being completed).

Closes #333

Copy link
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

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

very nice

@tlambert03 tlambert03 merged commit e1fc7cd into pymmcore-plus:main Jul 18, 2024
15 of 17 checks passed
@gselzer gselzer deleted the mda-conditional-yaml branch July 18, 2024 18:40
@tlambert03 tlambert03 added the bug Something isn't working label Oct 4, 2024
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.59%. Comparing base (7ec66e5) to head (eaaf226).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/pymmcore_widgets/useq_widgets/_mda_sequence.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #347      +/-   ##
==========================================
- Coverage   90.59%   90.59%   -0.01%     
==========================================
  Files          74       74              
  Lines        8379     8385       +6     
==========================================
+ Hits         7591     7596       +5     
- Misses        788      789       +1     

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

@gselzer
Copy link
Contributor Author

gselzer commented Oct 4, 2024

Thanks codecov!

@tlambert03
Copy link
Member

lol

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.

Saving MDASequence as YAML crashes if PyYAML not installed
2 participants