Skip to content

Commit

Permalink
make perlbrew versions consistent, sudo work around perlbrew bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Dec 21, 2024
1 parent 0ea4e94 commit 008e233
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion lib/PDL/IO/Misc.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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, [] ];
}
Expand Down
5 changes: 2 additions & 3 deletions lib/PDL/Primitive.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
7 changes: 7 additions & 0 deletions t/fft.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion t/primitive-interpolate.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 008e233

Please sign in to comment.