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

Add split_element to convert one element into a few other elements #26

Closed
iliiliiliili opened this issue Apr 7, 2020 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@iliiliiliili
Copy link
Collaborator

Currently, to create new elements from another we can use dataset.transform(lambda x: (x[0], make_P(x[1]), make_R(x[1]), x[2])). This approach breaks dataset names, so we have to call .named(...) after it.
Implementing split_element method that takes name of the (element, function, that returns List with created elements, List[str] of names of new elements) allows us to process the data without the need to touch other data, so less chances for user to make an error.

@iliiliiliili iliiliiliili added the enhancement New feature or request label Apr 7, 2020
@LukasHedegaard
Copy link
Owner

I'm on the verge on this... This functionality may be too specific, and I fear it may just produce unnecessary clutter.

What is your take, @clegaard ?
We recently had a discussion that we might want to split elements across multiple items (not within an item, like here). If we can come up with an intuitive naming scheme and API for the two functionalities, it might be worth pursuing.

@clegaard
Copy link
Collaborator

I have implemented this as a an operation subsample, which uses a user-defined function to split each sample.

@LukasHedegaard
Copy link
Owner

LukasHedegaard commented Apr 15, 2020

I don't think the thing you have @clegaard implemented is what @iliiliiliili was looking for. You split a sample into multiple samples. @iliiliiliili asked for a method which splits an element in a single sample into multiple elements, e.g. (a,b) -> (a1, a2, b).

@clegaard
Copy link
Collaborator

I guess a transform is a right way to go then, only issue is the naming.
I am also on the too specific side on this one, since a transform + named can achieve the same

@LukasHedegaard
Copy link
Owner

Closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants