jupyterlab-contrib / jupyterlab-variableInspector

Variable Inspector extension for Jupyterlab
BSD 3-Clause "New" or "Revised" License
1.11k stars 96 forks source link

Crashed after performing a slicing operation on an AnnData variable #294

Open alahenell opened 9 months ago

alahenell commented 9 months ago

Describe the bug After performing a slicing operation on an AnnData variable(single cell data, h5ad file read using Scanpy), the program crashed. Neither new variable can be detected, nor operations on existing variables can be recognized: the 'type-size-shape-content' of the displayed dataframe or int number do not change. However, if I view the contents of the dataframe using "View contents," I can see the changed data.

To Reproduce Steps to reproduce the behavior:

import scanpy as sc
import pandas as pd

num = 6  # OK
df = pd.DataFrame({'A':[1,2,3], 'B':[4,5,6]})  # OK
adata = sc.datasets.blobs()  # This is a small built-in dataset for reproduce. OK

adata1 = adata[0:10, ]  # Crash happen, doesn't appear in variable inspector

num = 7  # doesn't change in 'type size shape content'
df = df['A']  # doesn't change in 'type size shape content', but change in 'view contents'

Screenshots before crash: 屏幕截图 2024-01-03 205231 屏幕截图 2024-01-03 205318

after crash: 屏幕截图 2024-01-03 205237 屏幕截图 2024-01-03 205248

Your Environment(please complete the following information):

Additional context Looking forward to your reply. Thanks.

alahenell commented 9 months ago

I also reproduce the code in another two environment kernels, the results are the same.