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 _merge_repr for numeric data types #786

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Jan 22, 2024

No description provided.

@edeno edeno merged commit 4d2fcbb into LorenFrankLab:decoding-pipeline Jan 22, 2024
1 check passed
CBroz1 added a commit that referenced this pull request Jan 25, 2024
* Add non-local detector and remove replay_trajectory_classification

* Reorganize

* Fix formatting and imports

* Update .gitignore

* Remove because of circular import

* Fix name of parameter

* Handle case where ther is only one interval

* Fix settings

* Handle single interval

* from_unit_dict does not exist in 0.98.2 of spike interface

* Simplify call

* Update for SpikeSorting merge table and add spyglass mixin

* Fix dependencies

* Fix merge conflict

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Remove unused imports and format

* Add saving of waveform features

* Don't store electrodes, full waveforms, waveform mean

* Fix spike times and add convenience method

* Add spike location and some formatting

* Remove circular import

* Fix dict expansion

* Initial working clusterless pipeline

* Add position group

* Rename classifier to decoding

* Handle encoding and decoding intervals

* Put old files under v0, try/except for old decoding package

* Rename visualization and remove from v0

v0 visualization is redundant with visualization

* Place parameters and position group in core.py

* Add sorted spikes decoding

* Add objects to init for convenience

* Remove unused imports

* Fix fetching of spike times

* Insert into merge table

* Update CHANGELOG.md

* Function for removing decoding outputs not in DecodingOutput

* Fix name

* Add draft of tutorials and rearrange notebooks

* Fix config loading

* Add 1D decoding and some notes on estimate_parameters kwarg

* Update 43_Decoding_SortedSpikes.ipynb

* Remove old decoding notebook

* Save initial conditions and discrete transitions

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Be more specific with import error

* Remove unneeded comments

* Remove incorrect dimension name

* Project merge_id from SpikeSortingOutput for clarity

* Update src/spyglass/decoding/v0/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v0/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v0/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix linting

* Update notebooks

* Ignore .pem

* Add session as a primary key for Groups

* Add some helper methods

* Update notebooks

* Update README.md

* Update pyscripts

* Update 42_Decoding_Clusterless.ipynb

* Update CHANGELOG.md

* Add fetch and insert

* Simplify class conversion

* Do the dictionary conversion of class for the user

* Update CHANGELOG.md

* Update .gitignore

* Use methods in populate

* Avoid fetching interval range if not needed

* Generalize finding class from modules

* Use args/kwargs

* Simplify tuple unpacking

* Make decoding kwargs nullable

* Add function for get_recording and get_sorting to the spikesorting merge table

* make decoding waveform features agnostic to spikesorting source

* Fix spelling

* Use fetch1_dataframe for position

* Use self instead of class

* Update src/spyglass/decoding/v1/sorted_spikes.py

Co-authored-by: Samuel Bray <[email protected]>

* Be more careful about populating select keys

* Make more readable/remove unused imports

* Save classifier

* Clean up saved model paths

* add function load_linear_position_info

* Update src/spyglass/decoding/v1/sorted_spikes.py

Co-authored-by: Samuel Bray <[email protected]>

* Update 41_Extracting_Clusterless_Waveform_Features.py

* Update docstring

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix linting

* Fix syntax

* Rename variable to avoid confusion

* Restrict UnitWaveformFeaturesGroup and SortedSpikesGroup

* Concatenate linear position and position dataframes

* Static methods don't require instantiating class

* Avoid merge restrict

* Add version to defaults

* Remove unused import

* Fix classifier path

* Add dry run

* Remove non-default

* Handle permissions and file not found

* Keep position info within encoding/decoding interval

* Add methods to get the spike_times, spike_indicators, firing rate

* Fix docstring to match default

* Implement function rather than import

* Remove unused broken imports

* Add decoding cleanup

* Fix import

* Put old vis code back

* Fix import

* Add draft helper functions

* Limit options on input

* Fix logic

* Fix where the key is passed

* Update notebooks

* Host main visualizations in non_local_detector repo

* Update notebooks/py_scripts/41_Extracting_Clusterless_Waveform_Features.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/spikesorting/merge.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/decoding_merge.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Revert "Limit options on input"

This reverts commit 386714c.

* Use f-string for version

* Add useful imports to the top level

This would have to change a bit if there were multiple versions of the pipeline.

* Make source class a hidden attribute

* Update CHANGELOG.md

* Centralize get_class logic in Merge (#749)

* get_class logic -> dj_merge

* blackify

---------

Co-authored-by: Eric Denovellis <[email protected]>

* Add _nwb_table for fetch_nwb

* Method is static method

* Add merge insert

* string split is brittle, use defaults if it didn't work

* WIP: Mixin resolves _nwb_table attr for Merge (#783)

* Change import

* Handle single position 3D case

* Fix getting source from key

* Use merge_restrict_class for fetch_nwb on merge tables

* Move this back

* Remove for now

* Temp patch for tests

* Revert "Temp patch for tests"

This reverts commit 281bf36.

* Temp patch for tests

* Handle None decoding kwargs

* fetch_nwb is a method not a class method now

* Fix _merge_repr for numeric data types (#786)

* Easily calculate firing rate

* Add sorting spike times by place field and ahead behind distance

* Account for differently named position variables

* Handle orientation name and fix linear position fetch

* Fix 2D ahead/behind

* Add `UnitSelection` table (#788)

* Add UnitSelection

* Rename table

* Addressing #789, failing tests (#795)

* Addressing #789. See details.

- Edit settings.py to permit fail to load config on startup
- Simplify instructions to use func to generate config, negating need
  for config.py script
- Edit notebook 00 and installation doc to point to save-config func
- Expand example config to demonstrate all possible values
- Lint dj_merge_table.py to remove unused import and `var is True`

* #794

* Fix failing tests

* Update Changelog

* Typo: chared -> shared

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix formatting

* Update src/spyglass/common/common_behav.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/settings.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix syntax

* Update merge.py

---------

Co-authored-by: Chris Brozdowski <[email protected]>
Co-authored-by: Sam Bray <[email protected]>
Co-authored-by: Kyu Hyun Lee <[email protected]>
edeno added a commit that referenced this pull request Feb 3, 2024
* Remove old decoding notebook

* Save initial conditions and discrete transitions

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Be more specific with import error

* Remove unneeded comments

* Remove incorrect dimension name

* Project merge_id from SpikeSortingOutput for clarity

* Update src/spyglass/decoding/v0/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v0/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v0/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix linting

* Update notebooks

* Ignore .pem

* Add session as a primary key for Groups

* Add some helper methods

* Update notebooks

* Update README.md

* Update pyscripts

* Update 42_Decoding_Clusterless.ipynb

* Update CHANGELOG.md

* Add fetch and insert

* Simplify class conversion

* Do the dictionary conversion of class for the user

* Update CHANGELOG.md

* Update .gitignore

* Use methods in populate

* Avoid fetching interval range if not needed

* Generalize finding class from modules

* Use args/kwargs

* Simplify tuple unpacking

* Make decoding kwargs nullable

* Add function for get_recording and get_sorting to the spikesorting merge table

* make decoding waveform features agnostic to spikesorting source

* Fix spelling

* Use fetch1_dataframe for position

* Use self instead of class

* Update src/spyglass/decoding/v1/sorted_spikes.py

Co-authored-by: Samuel Bray <[email protected]>

* Be more careful about populating select keys

* Make more readable/remove unused imports

* Save classifier

* Clean up saved model paths

* add function load_linear_position_info

* Update src/spyglass/decoding/v1/sorted_spikes.py

Co-authored-by: Samuel Bray <[email protected]>

* Update 41_Extracting_Clusterless_Waveform_Features.py

* Update docstring

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/v1/clusterless.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix linting

* Fix syntax

* Rename variable to avoid confusion

* Restrict UnitWaveformFeaturesGroup and SortedSpikesGroup

* Concatenate linear position and position dataframes

* Static methods don't require instantiating class

* Avoid merge restrict

* Add version to defaults

* Remove unused import

* Fix classifier path

* Add dry run

* Remove non-default

* Handle permissions and file not found

* Keep position info within encoding/decoding interval

* Add methods to get the spike_times, spike_indicators, firing rate

* Fix docstring to match default

* Implement function rather than import

* Remove unused broken imports

* Add decoding cleanup

* Fix import

* Put old vis code back

* Fix import

* Add draft helper functions

* Limit options on input

* Fix logic

* Fix where the key is passed

* Update notebooks

* Host main visualizations in non_local_detector repo

* Update notebooks/py_scripts/41_Extracting_Clusterless_Waveform_Features.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/spikesorting/merge.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/decoding/decoding_merge.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Revert "Limit options on input"

This reverts commit 386714c.

* Use f-string for version

* Add useful imports to the top level

This would have to change a bit if there were multiple versions of the pipeline.

* Make source class a hidden attribute

* Update CHANGELOG.md

* Centralize get_class logic in Merge (#749)

* get_class logic -> dj_merge

* blackify

---------

Co-authored-by: Eric Denovellis <[email protected]>

* Add _nwb_table for fetch_nwb

* Method is static method

* Add merge insert

* string split is brittle, use defaults if it didn't work

* WIP: Mixin resolves _nwb_table attr for Merge (#783)

* Change import

* Handle single position 3D case

* Fix getting source from key

* Use merge_restrict_class for fetch_nwb on merge tables

* Move this back

* Remove for now

* Temp patch for tests

* Revert "Temp patch for tests"

This reverts commit 281bf36.

* Temp patch for tests

* Handle None decoding kwargs

* fetch_nwb is a method not a class method now

* Fix _merge_repr for numeric data types (#786)

* Easily calculate firing rate

* Add sorting spike times by place field and ahead behind distance

* Account for differently named position variables

* Handle orientation name and fix linear position fetch

* Fix 2D ahead/behind

* Add `UnitSelection` table (#788)

* Add UnitSelection

* Rename table

* Addressing #789, failing tests (#795)

* Addressing #789. See details.

- Edit settings.py to permit fail to load config on startup
- Simplify instructions to use func to generate config, negating need
  for config.py script
- Edit notebook 00 and installation doc to point to save-config func
- Expand example config to demonstrate all possible values
- Lint dj_merge_table.py to remove unused import and `var is True`

* #794

* Fix failing tests

* Update Changelog

* Typo: chared -> shared

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix formatting

* Update src/spyglass/common/common_behav.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Update src/spyglass/settings.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Fix syntax

* Update merge.py

* Revert "Update merge.py"

This reverts commit 4e5e5dc.

* Change load_results to fetch_results for consistency

* More load -> fetch

* load -> fetch

* Use merge table methods

* load -> fetch

* Rename SortedSpikesGroup.SortGroup to SortedSpikesGroup.Units

* Move old spike sorting pipeline to v0 for organizational purposes

* Specify full import path

* Rename merge module for consistency with other pipelines

* Fix import

* Fix notebook v0/v1 imports

* Fix import

* Fix import

* Fix import

* Fix names

* Formatting imports

* Remove visualization folder

* Move figurl views

* Fix formatting for black==24.*.*

* Use full import path

* Fix method name

* Add UnitInclusion merge table

* Update 43_Decoding_SortedSpikes.py

* Update pyscripts

* Remove unneeded sections

* Move import inside function

* Fix versioning

* Fix versioning

* Be more uniform about explicit imports

* Update CHANGELOG.md

* Fix import

* Fix #752

* Make imports more explicit

* Only import cv2 when needed because it sometimes causes issues

* Remove position tools as dependency

The functions are relatively simple so copying them over doesn't cause much burden

* Fix import  name

* Rename to linearization_merge for consistency with other modules

* Reduce cv2 dependency

* Remove unused import

* Remove defaults channel to avoid issues

* Remove position tools dependency

* Add opencv dependency

position tools had this as a dependency but since this is removed

* Revert "Remove position tools as dependency"

This reverts commit 35cd5ed.

* Revert "Remove position tools dependency"

This reverts commit 451e058.

* Revert "Add opencv dependency"

This reverts commit 996be9b.

* Update dependencies to match environment.yml

* Update environment_position.yml

* Add figure 1 image and pypi version badge

* Update citation

* Update to add all authors

* Add features to readme

* Create CODE_OF_CONDUCT.md

* Create .mailmap

* Update .mailmap

* Fix linting

* Remove unused tables

* Fix imports

* Don't make time relative

* Move sorted spikes group to spikesorting

* Add MUA detection

* Update CHANGELOG.md

* Handle discrete states and squeeze to avoid intervals if possible

* Fix table name

* Add intervallist to exclude artifacts

* Remove .mailmap

* Revert "Add intervallist to exclude artifacts"

This reverts commit 205874a.

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* Revert "Revert "Add intervallist to exclude artifacts""

This reverts commit e102646.

* remove interval list

* Fix linting

* Fix linting

* Add missing authors

* Update CHANGELOG.md

* Fix schema name

* Remove unused imports

* Revert back

* Use quotes

* Fix name

* Move mua because of dependency on position

* Fix prefix

* Fix schema prefix

* Fix name

* Add mua

* Update 51_MUA_Detection.ipynb

* Update src/spyglass/spikesorting/v1/unit_inclusion.py

Co-authored-by: Chris Brozdowski <[email protected]>

* Imported spikes annotation

* Fix name of annotated keys and add documentation

* Enable SortedSpikesGroup to filter directly on the SpikeSortingOutput nwb file

* improve filter_units execution

* Apply suggestions from code review

Co-authored-by: Chris Brozdowski <[email protected]>

* style cleanup

* remove UnitInclusion tables

* fix fetch_spike_data for case where no units in merge id

* Update src/spyglass/decoding/v1/sorted_spikes.py

Co-authored-by: Samuel Bray <[email protected]>

* rename UnitSelectionParams

* updated sorted decoding notebook

* fix linting

* fix linting

* Fix spelling

* Fix import order

* Squeeze posterior

* Make spike indicator 2D

* insert class contents

---------

Co-authored-by: Chris Brozdowski <[email protected]>
Co-authored-by: Sam Bray <[email protected]>
Co-authored-by: Kyu Hyun Lee <[email protected]>
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.

2 participants