Skip to content

Conversation

wulfdewolf
Copy link
Collaborator

@wulfdewolf wulfdewolf commented Jul 10, 2025

This combines:

  • decode_1d
  • decode_2d

into a generalised n-dimensional decode_bayes, which takes as input an xarray.DataArray (the new output of compute_tuning_curves).

Since occupancy is now an attribute of the tuning curves, decode_bayes uses that directly, if a new argument use_occupancy is set to True, it is False by default.

(this builds on the generalised tuning curves PR)

The old functions (and tests) are still available but they throw a DeprecationWarning.

note as to why I changed some original tests:
the old compute_2d_tuning_curves_continuous used np.digitize, which does
not include the last edge
the new implementation does, so I had to reflect that in the expected
values
Copy link
Collaborator

@sjvenditto sjvenditto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR so far! I've added some suggestions for a first round of review

@wulfdewolf wulfdewolf requested a review from sjvenditto July 22, 2025 20:24
Copy link
Collaborator

@sjvenditto sjvenditto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noted a few minor fixes. Also I'm realizing now that the way the code is structured assumes that a dictionary of Tsd objects is spike times - this is probably fine, but see the comment for more detail/discussion!

@wulfdewolf wulfdewolf requested a review from sjvenditto July 29, 2025 15:23
Copy link
Collaborator

@sjvenditto sjvenditto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me!

@gviejo gviejo merged commit 1c440bc into dev Jul 30, 2025
16 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.

Generalising decode_1d and decode_2d to decode

3 participants