Repository navigation
Pydantic for CNMFParams #1566
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
Open
ethanbb
wants to merge
56
commits into
flatironinstitute:dev
Choose a base branch
from
proektlab:improve-params-serialization
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Pydantic for CNMFParams #1566
Changes from 38 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
b3132a7
First draft of CNMFParams serialization overhaul
ethanbb dc9e6a7
Fix equality checking; verify reconstruction when serializing; use ty…
ethanbb a4cd600
Add first test in test_params
ethanbb a047a59
Switch to pydantic; checkpoint before making dataclasses frozen
ethanbb dee597a
Make all GroupParams and CNMFParams frozen to prevent direct assignment
ethanbb 126ca57
Add change_params test
ethanbb 663bbe5
Add warn=False or remove existing uses of params.set
ethanbb aa9af7b
Simplify CNMF constructor, fix skip_refinement, fix CNFMParams docstring
ethanbb 2d6db27
More direct params setting fixes
ethanbb a6ac888
Set spatial.se based on corr_pnr which was previously done only durin…
ethanbb cde7098
Provide params object to initialize_components and make copying a Gro…
ethanbb 31bb7db
Fix circular imports
ethanbb 6e235a3
Finish test_params, fix constructor logic so tests pass
ethanbb c8ec239
Fix, test and clearly document behavior when initialization methods a…
ethanbb e1e1288
Fix HDF5 roundtrip (dealing with b'None'); improve some validators us…
ethanbb d60fe31
Switch to processing flat params in before model validator & ditch bi…
ethanbb ab15040
Enforce ssub, ssub_B, tsub are ints to match usage in downscale
ethanbb 084c421
Use computed fields to keep track of which fields should continue to …
ethanbb e8caad3
Fix dims not being set in estimates; remove old unused use_init logic
ethanbb 080ed0f
Fix remaining tests - robust check for b'NoneType' and fix splitting …
ethanbb 6a6fefc
Fix demos for windows (multiprocessing), remove blocking plt.show()
ethanbb 6acf131
Merge branch 'demos-fixes' into improve-params-serialization
ethanbb 0be49a7
Fix some residual params issues appearing in demos and use object syn…
ethanbb d4e8a72
Add a few more tests & minor cleanup
ethanbb f6767ba
Add polyfill for ValidateAs
ethanbb 01785af
Make copy and deepcopy null the _full_params back-reference
ethanbb 6ba3702
Use PlainValidator for ValidateAs
ethanbb b08de59
Fix missing setattr of _full_params in set
ethanbb 8741607
Avoid using staticmethod in unsupported way
ethanbb 90cd324
Whoops, use real name for the cached property being deleted
ethanbb 4747751
Make requested changes, including undoing import changes in initializ…
ethanbb 3a3d5a7
Oops, fix one import I forgot
ethanbb 54e358d
Use input_params rather than params in update_nested_params to avoid …
ethanbb 07caa6c
Remove redundancy in p and n_pixels_per_process & generally avoid cha…
ethanbb e7be503
Factor out estimate_n_pixels_per_process
ethanbb 5d9f35b
Remove p_ssub and p_tsub, which are unused anywhere in the code
ethanbb f470a15
Add rename for 'merge_thresh' I missed
ethanbb 032ade2
Log a better warning when trying to set a deprecated (removed) param
ethanbb 7085fed
Restore original binary closing behavior for CNMFE
ethanbb 253d41a
Update test_params to reflect restored se behavior
ethanbb 40233c2
Resolve minor typing error in params
ethanbb c901c14
Numeric type fix for rf2stride
ethanbb c1fef6a
Correct type for gSig_range
ethanbb 63a1809
Add __setstate__ method for unpickling backward-compatibility
ethanbb 27cefb4
Add another validator to deal with slices encoded as bytes
ethanbb 6bab658
Fix loading old CNMF object with skip_refinement and remove_very_bad_…
ethanbb f4006fc
Undo overly optimistic removal of conversion from HDF5 load function …
ethanbb fb712e1
Use alias when reporting differing params
ethanbb 57739e2
Merge branch 'dev' into improve-params-serialization
ethanbb 1cffd3c
Fix copy method to properly use computed fields; add to_dict_roundtrip
ethanbb 01e1fa1
Add wrapper serializer for numpy scalars
ethanbb c0f10e2
Avoid cycles when checking for numpy scalars
ethanbb 4ed3f53
Fix constructing slice incorrectly in numpy scalar helper
ethanbb 9a681e1
Fix inf and nan serialization to JSON
ethanbb 3424b68
Revert adding global field serializer - causes more issues than it fi…
ethanbb cae7b7e
Make JSON schema for IntSlice more precise
ethanbb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To catch more specifically and log a useful warning when checking data params