STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
180 stars 59 forks source link

Error in pickle save object #241

Closed mengchengyao closed 4 months ago

mengchengyao commented 5 months ago

Hi, thank you for your great work

I have two samples for analysis with batch correction, and I want to save my object data with pickle format, it worked, but I got an error with reload this pickle file as follows:

stereo/core/result.py", line 160, in setitem if self.set_item_callback: AttributeError: 'Result' object has no attribute 'set_item_callback'

the command as follows

pickle.dump(data,open('file.pickle','wb'),protocol = 4)
data=pickle.load(open("file.pickle", 'rb'))

pip show stereopy Name: stereopy Version: 0.14.0b1 Summary: Spatial transcriptomic analysis in python. Home-page: https://github.com/STOmics/Stereopy Author: STOmics Author-email: xujunhao@genomics.cn License: Location: ......../anaconda3/envs/st/lib/python3.8/site-packages Requires: anndata, arboreto, bokeh, colorcet, dask, datashader, distinctipy, distributed, fastcluster, fbpca, gefpy, geosketch, gtfparse, h5py, harmonypy, holoviews, hotspotsc, hvplot, igraph, imageio, Jinja2, joblib, joypy, KDEpy, keras, leidenalg, loompy, louvain, lxml, matplotlib, natsort, numba, numpy, onnxruntime, opencv-python, packaging, pandas, panel, param, patsy, phenograph, pillow, plotly, POT, protobuf, pyarrow, pycirclize, pyscenic, requests, scikit-image, scikit-learn, scipy, seaborn, setuptools, shapely, slideio, spatialpandas, SQLAlchemy, squidpy, statsmodels, tables, tifffile, tqdm, typing-extensions, umap-learn, urllib3, xarray Required-by:

Do the error come with reson of diferent version Stereopy?

Best

Zhenbin24 commented 5 months ago

Can you show me the complete code?

mengchengyao commented 5 months ago

Can you show me the complete code?

I used guide with url: https://stereopy.readthedocs.io/en/latest/Tutorials%28Multi-sample%29/Batch_Effect.html

Many thanks

tanliwei-coder commented 5 months ago

What was the purpose that you saved the data as a pickle file?