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

Union of multiple interval sets #217

Open
BalzaniEdoardo opened this issue Jan 10, 2024 · 3 comments
Open

Union of multiple interval sets #217

BalzaniEdoardo opened this issue Jan 10, 2024 · 3 comments

Comments

@BalzaniEdoardo
Copy link
Collaborator

First of all, I am really enjoying learning pynapple so thanks for the package!

I would like to have a way to perform the union of an arbitrary number of interval sets. It would be great to have a classmethod for that.

Thanks

@NileshArnaiya
Copy link

Hi, is this what you are looking for @BalzaniEdoardo

i_sets = [ep1, ep2, ep3, ep4]

ep6 = nap.core.ts_group.union_intervals(i_sets)

@BalzaniEdoardo
Copy link
Collaborator Author

Hi Nilesh, thanks for your answer. Not exactly, I probably did not formulate my thoughts well enough, my bad. What I had in mind is more something like an IntervalSetGroup. Basically, a dictionary with which you could represent your experiment structure. For example

iset_group = IntervalSetGroup({"stimlus A": ep1, "stimulus B": ep2, "light phase": ep3, "dark phase":ep4})

And with that the possibility to do stuff like,

tsd.restrict( iset_group.intersect("simulus A", "stimulus B", "dark_phase"))

To get the data of the specific condition.

Which is basically a way to represent your experiment and facilitate playing around with the conditions

@BalzaniEdoardo
Copy link
Collaborator Author

you could do any such set operations, in a sense. So, instead of dealing with multiple IntervalSets having the possibility of having a single variable. One could have, similarly to TsGroup, a summary of the various conditions in the repr
for example.

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

No branches or pull requests

2 participants