-
Notifications
You must be signed in to change notification settings - Fork 92
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
[ENH] Added ASSET class initialization parameter to define the binning rounding error tolerance #585
[ENH] Added ASSET class initialization parameter to define the binning rounding error tolerance #585
Conversation
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.
Thanks for this nice enhancement of ASSET @kohlerca 🎉
Thanks for the review, @Moritz-Alexander-Kern. I made the requested changes and also modified the unit tests slightly so that the binning of each of the two input lists is checked (same spiketrains, but reverse order). |
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.
Thanks implementing the requested changes so promptly @kohlerca .
Approved from my side. ✔️
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.
Looks all good to me, unit tests are also understandable.
Currently, the
ASSET
class performs the binning of the spiketrains using the default behavior of theBinnedSpikeTrain
class inconversion
.Therefore, when spike times are closer to the right bin edge than a defined tolerance value, the
BinnedSpikeTrain
class shifts the spike to the next bin. This behavior can be controlled by thetolerance
parameter ofBinnedSpikeTrain
.This PR adds the new parameter
bin_tolerance
to theASSET
class, in order to allow the user to define the desired tolerance (and henceBinnedSpikeTrain
behavior).The parameter can take a string
'default'
to use the default behavior ofBinnedSpikeTrain
(and which corresponds to the current status ofASSET
before this PR), or a float value or None. In the latter two cases, these values are forwarded to the binning class, and will result in either shifting or not shifting the spikes, respectively.