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

Improve splitting of datasets #147

Merged
merged 7 commits into from
Sep 14, 2020
Merged

Conversation

gemeinl
Copy link
Collaborator

@gemeinl gemeinl commented Jul 24, 2020

split() now has a single argument by which ca be a string, a list of integers, or a list of list of integers.
splitting now always returns a dictionary with string keys.

@gemeinl gemeinl linked an issue Jul 24, 2020 that may be closed by this pull request
@agramfort
Copy link
Collaborator

would you ming add some test @gemeinl ? can this be illustrated in some documentation / example?

@gemeinl
Copy link
Collaborator Author

gemeinl commented Jul 27, 2020

would you ming add some test @gemeinl ? can this be illustrated in some documentation / example?

Not at all. I added an example as well as some tests.

@@ -109,34 +109,37 @@ def __init__(self, list_of_ds):
super().__init__(list_of_ds)
self.description = pd.DataFrame([ds.description for ds in list_of_ds])

def split(self, some_property=None, split_ids=None):
"""Split the dataset based on some property listed in its description
def split(self, by):
Copy link
Collaborator

Choose a reason for hiding this comment

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

technically you are breaking public API here again. Maybe we want to reach a proper version
before stabilizing API. I feel there are still many moving parts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My bad, I am not yet used to deprecating and not breaking the API. And yes, a lot of stuff is moving.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@gemeinl if you care about the design of the API it's great. Don't worry for now about breaking API as long as it's for the best.

#
# License: BSD (3-clause)

from IPython.display import display
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do you need this?
adding a dependency on ipython to do a print seems an overkill to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just copied it from examples.plot_dataset_example.py, so the dependency was already there. Could of course remove it everywhere.

@agramfort
Copy link
Collaborator

agramfort commented Jul 27, 2020 via email

@robintibor robintibor merged commit 371f1f1 into braindecode:master Sep 14, 2020
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.

Simplify split() function
3 participants