You’re welcome!

As a generality, if Perl says “Can't locate object method "dims" via package 
"100" (perhaps you forgot
to load "100"?)”, it’s because something like

              $pdl->dims

Has an inappropriate value for $pdl, and usually that’s down to caller error.

As another generality, if asking for help, you can save a step by including 
what version of the various packages you’re using (and ideally a version of 
Perl and your OS too), and if line numbers of files are given, show those too. 
At the least, looking at those things might enable you to self-help!

Best regards,
Ed

From: Hernán De Angelis<mailto:[email protected]>
Sent: 04 January 2021 09:28
To: Ed .<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>
Subject: Re: [Pdl-general] Status of PDL:NetCDF?



What does line 1333 of your PDL/NetCDF.pm say? I’ve just been working on the 
Graph module, and such errors say to me that I have got the arguments wrong on 
some function.

And Ed was right! I was using the wrong variables for specifying x and y.

Now it works!

Thanks!

/H.





From: Hernán De Angelis<mailto:[email protected]>
Sent: 04 January 2021 08:39
To: [email protected]<mailto:[email protected]>
Subject: [Pdl-general] Status of PDL:NetCDF?

Dear PDL:ers,

I am revisiting an old project and need to reuse bits of code I wrote
nearly a decade ago. The code uses PDL:NetCDF to write piddles with the
results of some modelling to netCDF for use in other software.

The part of the code that writes NetCDF is this:

# write NetCDF

my $ncobjout;
$ncobjout = PDL::NetCDF->new("matrix.grd",'w','y','x',{MODE =>
O_CREAT|O_RDWR,REVERSE_DIMS => 1, NC_FORMAT =>
PDL::NetCDF::NC_FORMAT_NETCDF4});
$ncobjout->putatt('COARDS/CF-1.0','Conventions');
$ncobjout->put('y',['y'],$y);
$ncobjout->put('x',['x'],$x);
$ncobjout->put('w',['y','x'],$matrix(:,:));
$ncobjout->close;

It fails with a strange message:

Can't locate object method "dims" via package "100" (perhaps you forgot
to load "100"?) at
/usr/local/perls/perl-5.32.0/lib/site_perl/5.32.0/x86_64-linux/PDL/NetCDF.pm
line 1333

But it worked fine 8-10 yrs ago. Also there is no reference to a package
called "100"(?) in the code for PDL::NetCDF.

Now, on CPAN PDL:NetCDF is v 4.2 från 2013 (!) and although it compiles
fine, 17/21 tests fail on HDF5 conflicts. That may explain something. My
netCDF is version 4.7.4.

A part of me tells me that I should not reuse old PDL code but just
rewrite everything needed in numpy and move on. Another part of me would
prefer not to and believes (perhaps naively?) that there is an easy
solution. Any ideas?

Thanks in advance

Hernán




_______________________________________________
pdl-general mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/pdl-general


_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to