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

Fix medw loading as b'NoneType' instead of None #1353

Merged
merged 2 commits into from
May 16, 2024

Conversation

ethanbb
Copy link
Contributor

@ethanbb ethanbb commented May 16, 2024

Description

I encountered a bug when running a CNMF refit after loading the CNMF object from HDF5. This was caused by params.spatial['medw'] being b'NoneType' rather than None.

None parameters are currently converted to the string 'NoneType' during saving, which is read back into Python as b'NoneType', and this should be converted back to None, but due to the way the conditionals are structured, parameters which should be converted to tuples if not None are not converted if they equal b'NoneType'. (They are converted if they are the regular string 'NoneType'.) I fixed it so that both NoneType cases are handled first, and otherwise simplified the conditional structure (but that should be the only change in behavior).

Partially addresses #1264.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Has your PR been tested?

Yes, caimanmanager test and caimanmanager demotest pass.

@pgunn pgunn merged commit 1624347 into flatironinstitute:dev May 16, 2024
3 checks passed
@pgunn
Copy link
Member

pgunn commented May 16, 2024

Looks good, thanks!

@ethanbb ethanbb deleted the none-load-fix branch May 16, 2024 17:41
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.

None yet

2 participants