diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f95aa57..dacf64d45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,6 +215,7 @@ jobs: run: | curl -L https://install.perlbrew.pl | bash source ~/perl5/perlbrew/etc/bashrc + yes|sudo perl -MCPAN -e 'CPAN::Shell->notest("install","Devel::PatchPerl")' perlbrew install --notest -D ${{ matrix.weirdness }} perl-5.40.0 --as perl-5.40.0-${{ matrix.weirdness }} || (cat ~/perl5/perlbrew/build.perl-5.40.0.log; false) - name: run tests env: @@ -223,7 +224,7 @@ jobs: MAKEFLAGS: --jobs=4 run: | source ~/perl5/perlbrew/etc/bashrc - perlbrew switch perl-5.32.0-${{ matrix.weirdness }} + perlbrew switch perl-5.40.0-${{ matrix.weirdness }} perlbrew install-cpanm perl -V|grep archname (cpanm -n ExtUtils::MakeMaker Devel::CheckLib File::Which && cpanm -n --installdeps .) || ( cat ~/.cpanm/build.log && false ) diff --git a/lib/PDL/IO/Misc.pd b/lib/PDL/IO/Misc.pd index 61beae1af..d23f823a1 100644 --- a/lib/PDL/IO/Misc.pd +++ b/lib/PDL/IO/Misc.pd @@ -132,7 +132,7 @@ sub _burp_1D { } else { # could add POSIX::strtol for hex and octal support but # can't break float conversions (how?) - $data->slice("$start:$index") .= pdl($data->type, $databox); + $data->slice("$start:$index") .= pdl($databox); } $_[0] = [ $data, [] ]; } diff --git a/lib/PDL/Primitive.pd b/lib/PDL/Primitive.pd index fef6e2ae5..cdfb82127 100644 --- a/lib/PDL/Primitive.pd +++ b/lib/PDL/Primitive.pd @@ -3304,14 +3304,13 @@ sub PDL::interpND { } elsif($method =~ m/^f(ft|ourier)?/i) { - local $@; - eval "use PDL::FFT;"; + require PDL::FFT; my $fftref = $opt->{fft}; $fftref = [] unless(ref $fftref eq 'ARRAY'); if(@$fftref != 2) { my $x = $source->copy; my $y = zeroes($source); - fftnd($x,$y); + PDL::FFT::fftnd($x,$y); $fftref->[0] = sqrt($x*$x+$y*$y) / $x->nelem; $fftref->[1] = - atan2($y,$x); } diff --git a/t/fft.t b/t/fft.t index 964f1b3e6..b797d85a0 100644 --- a/t/fft.t +++ b/t/fft.t @@ -30,6 +30,13 @@ is_pdl $pd->im, $pb->zeroes, "fft zeroes using complex ndarrays"; is_pdl $pa, $pb, "original image recovered"; } +{ + my $x = xvals( 10, 10 ) + yvals( 10, 10 ) * 10; + my $index = cat( 3 + xvals( 5, 5 ) * 0.25, 7 + yvals( 5, 5 ) * 0.25 ) + ->reorder( 2, 0, 1 ); + is_pdl $x->long->interpND($index, {method=>'f'}), long('36 36 34 34 35; 51 51 49 49 50; 52 51 49 49 51; 33 33 31 31 32; 26 26 24 24 25'); +} + { my $pb = $pa->copy; my $pc = $pb->zeroes; diff --git a/t/primitive-interpolate.t b/t/primitive-interpolate.t index 2acaa1d06..a29ef9ee4 100644 --- a/t/primitive-interpolate.t +++ b/t/primitive-interpolate.t @@ -37,7 +37,6 @@ subtest interpND => sub { is_pdl $x->long->interpND($index), $z->long, {atol=>6}; is_pdl $x->long->interpND($index, {method=>'l'}), $z->long; is_pdl $x->long->interpND($index, {method=>'c'}), $z->long; - is_pdl $x->long->interpND($index, {method=>'f'}), long('36 36 34 34 35; 51 51 49 49 50; 52 51 49 49 51; 33 33 31 31 32; 26 26 24 24 25'); }; subtest PCHIP => sub {