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

checking h5py key to open binaries before data_path #1042

Merged

Conversation

arielleleon
Copy link
Contributor

@arielleleon arielleleon commented Oct 12, 2023

Hello, In the default_ops, it states that if a h5py contains elements to process that data_path will not be checked. To fix this, I re-ordered the logic in the io.utils.find_files_open_binaries so that the h5py is checked first and bypasses the data_path search. This PR is linked to an issue I opened just now. Thanks!

#1041

@carsen-stringer
Copy link
Member

Hi @chriski777 could you please test this pull request and issue next time you have time?

Thanks,

Carsen

@arielleleon
Copy link
Contributor Author

@carsen-stringer Please let me know if you have any questions about this PR. There is a separate issue here where I logged more information on the issue.

#1041

Thanks for looking into this!

@carsen-stringer
Copy link
Member

Is there any way to make this fix backwards compatible?

@chriski777 chriski777 self-assigned this Nov 7, 2023
@arielleleon
Copy link
Contributor Author

@carsen-stringer - I took another look at the code and the solution might be something different and I would like to get your thoughts as I'm still new to this library. The comments in the default_ops.py file on L22 states "take h5py as input (deactivates data_path)". But then here on L265 of the utils.py the code checks the data_path which was set here L458 of run_s2p.py. My assumption was that if you are checking a directory structure for h5's, you would not set the h5 key in the first place. Which is why I swapped the data_path check in the find_files_open_binaries in utils.py (my original solution). But maybe the solution is to not set the data_path in the first place here. Let me know what you think and I would be happy to update the PR.

@arielleleon
Copy link
Contributor Author

Also - to answer your question via Kayvon - My solution does fix our problem but I haven't checked if it breaks how others are using it.

@carsen-stringer
Copy link
Member

thanks for all the info, I think it makes sense what you did (it makes things more consistent across data types) -- but we'll need to update the tests. I'll get back to you after SfN with a solution. in the meantime please instruct people (like Kayvon :)) to install your fork

@arielleleon
Copy link
Contributor Author

Thanks!

@chriski777 chriski777 assigned chriski777 and unassigned chriski777 Nov 14, 2023
@carsen-stringer
Copy link
Member

okay cool most of the tests are passing, I see one tiny bug to sort out with the previous way of running things, will fix tomorrow

@arielleleon
Copy link
Contributor Author

Thank you @carsen-stringer

@carsen-stringer carsen-stringer merged commit afc9bff into MouseLand:main Nov 30, 2023
1 of 7 checks passed
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.

3 participants