haesleinhuepf / napari-workflows

BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

adding remove viewers function to workflows #19

Closed Cryaaa closed 2 years ago

Cryaaa commented 2 years ago

Hey Robert @haesleinhuepf, I have added this function to the workflow object because loading a workflow seems to add the Viewer instance to the items of the ._tasks dictionary. The viewer then causes errors when saving the workflow. Since the original workflow does not contain the viewer objects they don't seem to be important for saving and loading so they can be removed with this function.

codecov-commenter commented 2 years ago

Codecov Report

Merging #19 (b08fba2) into main (7d19302) will decrease coverage by 0.70%. The diff coverage is 40.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   89.68%   88.97%   -0.71%     
==========================================
  Files           4        4              
  Lines         378      381       +3     
==========================================
  Hits          339      339              
- Misses         39       42       +3     
Impacted Files Coverage Δ
src/napari_workflows/_workflow.py 84.58% <25.00%> (-0.97%) :arrow_down:
src/napari_workflows/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e100770...b08fba2. Read the comment docs.

Cryaaa commented 2 years ago

@haesleinhuepf, that is a good point and I’ve noticed you do it at other points when creating Workflows. Maybe I’ll just add the function when losing Workflows instead