Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ed .
In fact, I was wrong! It was bugs in both Text::Balanced and Filter::Simple. Workarounds have been added to PDL::NiceSlice, and the pull-request on T:B has been enhanced. Also the tests for NiceSlice are now much better set up to capture problems like this in the future, so please keep reporting

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ed .
Hi Ingo, You can get exactly the old behaviour if you were to use “max(which($pos($c_loc)>-1))->at”, since that’s the bit that was removed from the Ufunc code. Best regards, Ed From: Ingo Schmid Sent: 24 February 2022 19:08 To: Ed .; David Mert

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ingo Schmid
Ed & David, I stumbled across the problem because of this behaviour: pdl> p max pdl[] BAD which does not expand to 0 as would an undef perl scalar.  Here's the function. The isbad() line was necessary to catch the case where which returns an empty list. sub openBox {     my $filename=shif

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ed .
It appears (using this even more cut-down version, note the useful BEGIN bit which tells you what NiceSlice gets fed by Text::Balanced): use PDL; BEGIN { $PDL::NiceSlice::debug_filter = 1 } use PDL::NiceSlice; use strict; use warnings; my $p = {y=>0}; { my $r=zeroes((3) x 10); #ndarray my

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ed .
Hi Ingo, I believe you didn’t run your code before emailing it, because $p isn’t defined. Also, I hope the real code doesn’t have an isempty followed by a Boolean check on ->nelem, because isempty is literally implemented as nelem == 0. When I adjust and experiment, the difference between a sy

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ed .
Hi David, Can you show a complete (small) example of using the return value of `max` in Boolean context that fails with the current code? I am unable to reproduce this, and it ought to work correctly. The change was made in Aug 2021, with version 2.056. Those functions were never documented as

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread David Mertens
To follow-up on max/min being piddles, this broke some of my tests in PDL::Parallel::threads. Specifically croak-in-boolean-context is now easily triggered where it used to be safe: if ($data->max < 40) { # croaks: piddle in boolean context } Was this use case considered and discussed?

Re: [Pdl-devel] PDL 2.075 released

2022-02-24 Thread Ingo Schmid
HI Ed, here's some feedback to the new release. Thank you for your tireless efforts! I experience errors in previously working code, at least in 2.074 and 2.075. $r and $i are piddles, as are $empty_lines and $vlines. These lines (67 #!perl use PDL; use PDL::NiceSlice; use 5.10.0; use strict