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

Empty info #177

Merged
merged 3 commits into from Mar 16, 2016
Merged

Empty info #177

merged 3 commits into from Mar 16, 2016

Conversation

d-lamb
Copy link
Member

@d-lamb d-lamb commented Mar 13, 2016

This branch clarifies the status of empty piddles by PDL::info (and thus 'help vars' in the shell). Previously empty piddles were listed as PDL->null, which is incorrect. Now they are listed as their correct type and dimensions (at least one of which is 0). Since which & whichND are used to generate various kinds of empties, I also made sure that whichND returns piddles of the correct type (indx).

When using the $piddle->info command or 'help vars' or '? vars'
from the perldl shell, both null piddles and empty piddles were
printed as 'PDL->null'. But empties and nulls are not the same:
empties have a type, and a dim list (at least 1 dim is size 0).

This change allows empties to show up in the variable listing as
such, and I added some tests.
This was already the case for which and which_both, so now whichND
returns indx piddles as well.  Added 5 tests to t/primitive.t to
deal with (most of?) the edge cases.
@wchristian wchristian merged commit c560ccd into master Mar 16, 2016
@wchristian wchristian deleted the empty_info branch March 16, 2016 21:35
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.

None yet

2 participants