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

Flatten #253

Merged
merged 8 commits into from
Jun 29, 2015
Merged

Flatten #253

merged 8 commits into from
Jun 29, 2015

Conversation

sn6uv
Copy link
Member

@sn6uv sn6uv commented Jun 12, 2015

Implementation of the Flatten algorithm.

@sn6uv
Copy link
Member Author

sn6uv commented Jun 13, 2015

Might not have a chance to finish this till next week. It works currently if the send argument is a list of length one lists of ints e.g. {{2}, {1}} but I still need to figure out how to e.g. length > 1 sublists e.g. {{1, 2}, {3}} and the other special cases with rules e.g. {2} -> ?

@wolfv if you feel like having a go feel free to submit a PR against this branch sn6uv/Flatten, or alternately you can make your own seperate PR entirely

@wolfv
Copy link
Member

wolfv commented Jun 13, 2015

Thats great to hear! Time is not an issue for me 👍

@sn6uv
Copy link
Member Author

sn6uv commented Jun 18, 2015

Length > 1 sublists are done. I still need to do some error handling (e.g. check that the list arg matches the correct format) and a minor cleanup.

@wolfv I'd appreciate your feedback on this. Would you mind testing it with what you have in #252?

@wolfv
Copy link
Member

wolfv commented Jun 18, 2015

Hi! So far looks great.

One smallish issue I found is this one:

Flatten[a, {2, 1}]

where it crashes int object not iterable. I guess it expects a list, maybe a fix would be to just wrap it?

PS: Flatten[a, {{2, 1}}] == Flatten[a, {2,1}]

@sn6uv
Copy link
Member Author

sn6uv commented Jun 20, 2015

@wolfv I've applied that fix, thanks.

@sn6uv
Copy link
Member Author

sn6uv commented Jun 27, 2015

I'm planning to merge this soon. @wolfv are there any more issues you can think of?

sn6uv added a commit that referenced this pull request Jun 29, 2015
@sn6uv sn6uv merged commit 9d2ef97 into mathics:master Jun 29, 2015
@wolfv
Copy link
Member

wolfv commented Jun 29, 2015

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants