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

new error with store.get_extra_data() #24

Open
vcorbit opened this issue Jun 14, 2022 · 2 comments
Open

new error with store.get_extra_data() #24

vcorbit opened this issue Jun 14, 2022 · 2 comments

Comments

@vcorbit
Copy link

vcorbit commented Jun 14, 2022

Hi, I recently re-installed imgstore in a new conda environment, and I am now having issues running the get_extra_data() function. I get an error like this when I try to run it directly in Spyder, or indirectly via plot_interactive.py in a conda window:

(imgstore) C:\Users\vlcor\Desktop\imgstore\examples>python plot_interactive.py W:/Victoria/A69BLinearTrack/PuffCPA/puffcpatest_vglut6l_20220613_121106.17458173
Traceback (most recent call last):
File "plot_interactive.py", line 23, in
df = store.get_extra_data(ignore_corrupt_chunks=True)
File "C:\Users\vlcor.conda\envs\imgstore\lib\site-packages\imgstore\stores.py", line 455, in get_extra_data
dfs.append(motif_extra_data_h5_to_df(path))
File "C:\Users\vlcor.conda\envs\imgstore\lib\site-packages\imgstore\util.py", line 185, in motif_extra_data_h5_to_df
datasets = [s.strip() for s in f.attrs['datasets'].decode('ascii').split(',')]
AttributeError: 'str' object has no attribute 'decode'

I used to have no issues running this function in my previous version of imgstore, so I am pretty sure the code I'm using is okay... here's the snip I've been trying to run in Spyder:

from imgstore import new_for_filename
import imgstore
datafolder = r'W:\Victoria\A69BLinearTrack\PuffCPA\puffcpatest_vglut2_20220613_100607.17458173'
metapath = datafolder + '\metadata.yaml'
store = new_for_filename(metapath)
extradata = store.get_extra_data()

Any help would be very appreciated! Thanks!

@nzjrs
Copy link
Contributor

nzjrs commented Jun 14, 2022

I think this is a python 3/2 issue and also possibly a change in how h5py represents strings. If possible, could you put one of the h5 files here (or email me), and also tell me your python version, and the h5py version

Thanks!

@vcorbit
Copy link
Author

vcorbit commented Jun 15, 2022

Hey John,

I attached one of the h5 files.
000001.extra_data.zip

My python version is 3.6.13 and h5py is 3.1.0.

Now that you said that about the h5py version, I have some memory of this same issue occurring before, so sorry I didn't remember that! I think it ended up being a bug in h5py and I needed a different version.

I just tried pip uninstall h5py and then pip install versioned-hdf5 and ended up with h5py version 2.10.0 and now the imgstore function is working! So, problem solved thanks to you but I wanted to post a response anyway in case anyone else has the same issue.

Thanks!!

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

No branches or pull requests

2 participants