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

Start kernel client channels when reusing already running in-process kernel #39

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

dalthviz
Copy link
Member

@dalthviz dalthviz commented Dec 5, 2024

Closes napari/napari#7413

This PR allows multiple napari viewers in the same session to each have a console, with the consoles having linked histories and kernel (active variables).

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.51%. Comparing base (c15d804) to head (b526f24).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   90.38%   94.51%   +4.12%     
==========================================
  Files           4        4              
  Lines         156      164       +8     
==========================================
+ Hits          141      155      +14     
+ Misses         15        9       -6     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jni jni merged commit 2e9ca54 into napari:main Dec 6, 2024
9 checks passed
@psobolewskiPhD
Copy link
Member

I pulled this down and I can do, in either console:

import numpy as np
data = np.random.random([5, 5])

Then, in either console:

viewer.title     # returns correct title of the viewer with the console
viewer.add_image(data)      #  data is shown in the viewer with the console

But v1 and v2 give NameError: name 'v2' is not defined

this is with this script:

import napari

v1 = napari.Viewer(title="v1")
v2 = napari.Viewer(title="v2")
napari.run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to open console in second viewer when opening two viewers
4 participants