Re: [Pdl-general] How would you find where an N-piddle switches from positive to negative?

2022-10-06 Thread Hernán De Angelis

A method I used in the past for a similar problem was:

- take the absolute value
- then get the index of the minimum value:

$indexno = $piddle->index(minimum_ind(abs($piddle))

There may be precision problems for very small piddles. You need a 
series of values that crosses zero only once.




Good luck

Hernán



Den 2022-10-06 kl. 04:53, skrev Luis Mochan:

Maybe rle can gelp get all sign changes, as in your second example:

  pdl> $a=pdl[ 5.3332316,  4.3332316,  3.3332316,  2.3332316,  1.3332316, 
0.33323163, -0.66676837, -1.6667684, -2.6667684, -3.6667684]
  pdl> p $a
  [ 5.3332316  4.3332316  3.3332316  2.3332316  1.3332316 0.33323163 
-0.66676837 -1.6667684 -2.6667684 -3.6667684]
  pdl> p $a<=>0
  [1 1 1 1 1 1 -1 -1 -1 -1]

$a<=>0 is just the sign of the elements of $a

  pdl> p +($a<=>0)->rle
  [6 4] [1 -1]

which means there are 6 1's followed by 4 -1's

  pdl> ($rle)=($a<=>0)->rle;

$rle has [6 4]

  pdl> p $rle((0))-1
  5

I choose the first sign change with ((0)) and subtract 1 to get the
index from the number of elements.

You can put everything together as in

  pdl> p +[($a<=>0)->rle]->[0]->((0))-1
  5

You could generalize this to get further resonances in more
complicated circuits.

Regards,
Luis


On Wed, Oct 05, 2022 at 06:50:32PM -0700, Eric Wheeler wrote:

Hello all,

I'm trying to find the series resonant frequency of an RF component, which
is where the component reactance switches from positive to negtive or
vice-versa.

Given an N-vector PDL of sorted elements, I need to know at what index it
switches from positive to negative.

Here are some examples; in real life these are real values from physical
measurements, so they are never going to be nice round integers---but you
can assume they will be sorted in ascending or descending order.

Example 1:

   pdl> p sequence(10)-5
   [-5 -4 -3 -2 -1 0 1 2 3 4]
^^
   I need to know "index 4" is the place at which it switches.


Example 2:

   pdl> p ((-sequence(10))+5+rand())
   [ 5.3332316  4.3332316  3.3332316  2.3332316  1.3332316 0.33323163 
-0.66676837 -1.6667684 -2.6667684 -3.6667684]
   ^^
   In this floating-point example it would be "index 5"


Is there already a "PDL-broadcast-way" of doing this?

How would you do it?

--
Eric Wheeler


___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general

___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] PDL build not passing test in Perl 5.36.0

2022-05-28 Thread Hernán De Angelis

I will update the news feed in the page and make a PR.

By the way, for the moment I have no idea how to proceed with the 
PDL::Demos gallery. Will keep looking and thinking.


/H.



Den 2022-05-28 kl. 19:19, skrev Ed .:


Glad to hear it!

Best regards,

Ed

*From: *Hernán De Angelis <mailto:variablestarli...@gmail.com>
*Sent: *28 May 2022 18:19
*To: *Ed . <mailto:ej...@hotmail.com>; pdl-general@lists.sourceforge.net
*Subject: *Re: [Pdl-general] PDL build not passing test in Perl 5.36.0

Thanks, Ed. Works like charm!

/H.

Den 2022-05-28 kl. 18:44, skrev Ed .:

See separate release announcement for PDL 2.080.

Best regards,

Ed

*From: *Hernán De Angelis <mailto:variablestarli...@gmail.com>
*Sent: *28 May 2022 14:07
*To: *pdl-general@lists.sourceforge.net
*Subject: *[Pdl-general] PDL build not passing test in Perl 5.36.0

Hi all

I just upgraded Perl to 5.36.0 and rebuilt PDL. It seems there is
some trouble with the tests. Not sure what the cause of this is
but it seems related to Text::Balanced.

What could be wrong here? See test result below.

Cheers

/H.



make[2]: Entering directory
'/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter'
PERL_DL_NONLAZY=1 "/usr/local/perls/perl-5.36.0/bin/perl"
"-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef
*Test::Harness::Switches; test_harness(0, '../../blib/lib',
'../../blib/arch')" t/*.t
t/niceslice-utilcall.t .. Prototype mismatch: sub
Text::Balanced::_match_variable: none vs ($$) at

/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm
line 603.
Prototype mismatch: sub Text::Balanced::_match_codeblock: none vs
($$$) at

/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm
line 605.
Prototype mismatch: sub Text::Balanced::_match_quotelike: none vs
() at

/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm
line 607.
t/niceslice-utilcall.t .. ok
t/niceslice.t ... Prototype mismatch: sub
Text::Balanced::_match_variable: none vs ($$) at

/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm
line 603.
Prototype mismatch: sub Text::Balanced::_match_codeblock: none vs
($$$) at

/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm
line 605.
Prototype mismatch: sub Text::Balanced::_match_quotelike: none vs
() at

/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm
line 607.
t/niceslice.t ... 1/?
#   Failed test 'NiceSlice leaves strings along'
#   at t/niceslice.t line 239.
#  got: '
#   CREATE TABLE $table ->slice(
#   CHECK ( yr = $yr )
#   ) INHERITS ($schema.master_table)
#   '
# expected: '
#   CREATE TABLE $table (
#   CHECK ( yr = $yr )
#   ) INHERITS ($schema.master_table)
#   '
# Looks like you failed 1 test of 70.
t/niceslice.t ... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/70 subtests

Test Summary Report
---
t/niceslice.t (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  69
  Non-zero exit status: 1
Files=2, Tests=137,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.11
cusr  0.01 csys =  0.14 CPU)
Result: FAIL
Failed 1/2 test programs. 1/137 subtests failed.
make[2]: *** [Makefile:635: test_dynamic] Error 1
make[2]: Leaving directory
'/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter'
make[1]: *** [Makefile:781: subdirs-test_dynamic] Error 2
make[1]: Leaving directory '/root/.cpan/build/PDL-2.079-0/Basic'
make: *** [Makefile:1087: subdirs-test_dynamic] Error 2

___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] PDL build not passing test in Perl 5.36.0

2022-05-28 Thread Hernán De Angelis

Thanks, Ed. Works like charm!

/H.

Den 2022-05-28 kl. 18:44, skrev Ed .:


See separate release announcement for PDL 2.080.

Best regards,

Ed

*From: *Hernán De Angelis <mailto:variablestarli...@gmail.com>
*Sent: *28 May 2022 14:07
*To: *pdl-general@lists.sourceforge.net
*Subject: *[Pdl-general] PDL build not passing test in Perl 5.36.0

Hi all

I just upgraded Perl to 5.36.0 and rebuilt PDL. It seems there is some 
trouble with the tests. Not sure what the cause of this is but it 
seems related to Text::Balanced.


What could be wrong here? See test result below.

Cheers

/H.



make[2]: Entering directory 
'/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter'
PERL_DL_NONLAZY=1 "/usr/local/perls/perl-5.36.0/bin/perl" 
"-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef 
*Test::Harness::Switches; test_harness(0, '../../blib/lib', 
'../../blib/arch')" t/*.t
t/niceslice-utilcall.t .. Prototype mismatch: sub 
Text::Balanced::_match_variable: none vs ($$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 603.
Prototype mismatch: sub Text::Balanced::_match_codeblock: none vs 
($$$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 605.
Prototype mismatch: sub Text::Balanced::_match_quotelike: none vs 
() at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 607.

t/niceslice-utilcall.t .. ok
t/niceslice.t ... Prototype mismatch: sub 
Text::Balanced::_match_variable: none vs ($$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 603.
Prototype mismatch: sub Text::Balanced::_match_codeblock: none vs 
($$$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 605.
Prototype mismatch: sub Text::Balanced::_match_quotelike: none vs 
() at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 607.

t/niceslice.t ... 1/?
#   Failed test 'NiceSlice leaves strings along'
#   at t/niceslice.t line 239.
#  got: '
#   CREATE TABLE $table ->slice(
#   CHECK ( yr = $yr )
#   ) INHERITS ($schema.master_table)
#   '
# expected: '
#   CREATE TABLE $table (
#   CHECK ( yr = $yr )
#   ) INHERITS ($schema.master_table)
#   '
# Looks like you failed 1 test of 70.
t/niceslice.t ... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/70 subtests

Test Summary Report
---
t/niceslice.t (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  69
  Non-zero exit status: 1
Files=2, Tests=137,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.11 
cusr  0.01 csys =  0.14 CPU)

Result: FAIL
Failed 1/2 test programs. 1/137 subtests failed.
make[2]: *** [Makefile:635: test_dynamic] Error 1
make[2]: Leaving directory 
'/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter'

make[1]: *** [Makefile:781: subdirs-test_dynamic] Error 2
make[1]: Leaving directory '/root/.cpan/build/PDL-2.079-0/Basic'
make: *** [Makefile:1087: subdirs-test_dynamic] Error 2

___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


[Pdl-general] PDL build not passing test in Perl 5.36.0

2022-05-28 Thread Hernán De Angelis

Hi all

I just upgraded Perl to 5.36.0 and rebuilt PDL. It seems there is some 
trouble with the tests. Not sure what the cause of this is but it seems 
related to Text::Balanced.


What could be wrong here? See test result below.

Cheers

/H.



make[2]: Entering directory 
'/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter'
PERL_DL_NONLAZY=1 "/usr/local/perls/perl-5.36.0/bin/perl" 
"-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef 
*Test::Harness::Switches; test_harness(0, '../../blib/lib', 
'../../blib/arch')" t/*.t
t/niceslice-utilcall.t .. Prototype mismatch: sub 
Text::Balanced::_match_variable: none vs ($$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 603.
Prototype mismatch: sub Text::Balanced::_match_codeblock: none vs 
($$$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 605.
Prototype mismatch: sub Text::Balanced::_match_quotelike: none vs () 
at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 607.

t/niceslice-utilcall.t .. ok
t/niceslice.t ... Prototype mismatch: sub 
Text::Balanced::_match_variable: none vs ($$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 603.
Prototype mismatch: sub Text::Balanced::_match_codeblock: none vs 
($$$) at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 605.
Prototype mismatch: sub Text::Balanced::_match_quotelike: none vs () 
at 
/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter/../../blib/lib/PDL/NiceSlice.pm 
line 607.

t/niceslice.t ... 1/?
#   Failed test 'NiceSlice leaves strings along'
#   at t/niceslice.t line 239.
#  got: '
#   CREATE TABLE $table ->slice(
#   CHECK ( yr = $yr )
#   ) INHERITS ($schema.master_table)
#   '
# expected: '
#   CREATE TABLE $table (
#   CHECK ( yr = $yr )
#   ) INHERITS ($schema.master_table)
#   '
# Looks like you failed 1 test of 70.
t/niceslice.t ... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/70 subtests

Test Summary Report
---
t/niceslice.t (Wstat: 256 (exited 1) Tests: 70 Failed: 1)
  Failed test:  69
  Non-zero exit status: 1
Files=2, Tests=137,  0 wallclock secs ( 0.02 usr  0.00 sys + 0.11 cusr  
0.01 csys =  0.14 CPU)

Result: FAIL
Failed 1/2 test programs. 1/137 subtests failed.
make[2]: *** [Makefile:635: test_dynamic] Error 1
make[2]: Leaving directory 
'/root/.cpan/build/PDL-2.079-0/Basic/SourceFilter'

make[1]: *** [Makefile:781: subdirs-test_dynamic] Error 2
make[1]: Leaving directory '/root/.cpan/build/PDL-2.079-0/Basic'
make: *** [Makefile:1087: subdirs-test_dynamic] Error 2___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] pdl.perl.org website updated

2022-04-17 Thread Hernán De Angelis
Hi Ed

Fine! I will then do as you suggest, fork first, then propose some small
changes as pull request.

Have a nice Easter sunday!

Hernán


Den sön 17 apr. 2022 20:25Ed .  skrev:

> Hi Hernán,
>
>
>
> Excellent questions! The “recent news” section is currently just HTML in
> “home.html” as you say, manually added by people including, over the years,
> Chris, Derek, and me. The reason for the non-version-dependent links is
> simply that’s what was added.
>
>
>
> The GitHub “releases” feature isn’t something PDL really uses, because
> people get it either from a packaging system, or CPAN. It would probably be
> “nice” to have it automatically updated (though the obvious “hook” would be
> a GitHub Action triggered by a tag, as we currently use for Cygwin testing
> for each release). But the first question to answer would be what would be
> the benefit to justify the effort?
>
>
>
> One vast benefit of switching to GitHub Pages for the website is that it’s
> easy for anyone to fork the repo and pull-request an update – the previous
> setup needed an admin to use rsync, which wasn’t very easy. It might make
> the most sense to open an issue first to discuss any changes (or just email
> me), but if there are website changes you feel are obvious and just want to
> go ahead, please do! There is a tiny guide at
> https://github.com/PDLPorters/pdl/wiki/Developer%27s-Corner#modifying-the-website
> .
>
>
>
> Best regards,
>
> Ed
>
>
>
> *From: *Hernán De Angelis 
> *Sent: *16 April 2022 13:28
> *To: *pdl-general@lists.sourceforge.net
> *Subject: *Re: [Pdl-general] pdl.perl.org website updated
>
>
>
> Hi!
>
> Nice! The page appears to load faster. I have a couple of (potentially
> silly) questions:
>
> - how is the "recent news" feed managed? Is this done manually in the
> "home.html" page (
> https://github.com/PDLPorters/pdlporters.github.com/blob/master/content/home.html)
> ?
>
> - links to previous PDL versions in CPAN point to the same address (
> https://metacpan.org/pod/PDL). Shouldn't it be something like, for
> example for 2.077:
> https://metacpan.org/release/ETJ/PDL-2.077/view/Basic/PDL.pm ?
>
> - why is the last released version in github 2.026 from feb 2021?
> Shouldn't it be nice to have it in sync with metacpan? Perhaps there is
> good reason to do so and I am just not aware of it.
>
> If what is needed is manpower to keep these thinks updated and consistent
> I may be able to help.
>
>
> H.
>
>
>
> Den 2022-04-15 kl. 18:11, skrev Ed .:
>
> Dear PDL folks,
>
>
>
> Those of you who look at the PDL website every day will already know this.
> For those who don’t, I have just (hopefully) finished tweaking the website
> at https://pdl.perl.org/:
>
>1. The astute among you will notice that’s now “https” not “http”
>2. It’s hosted on GitHub Pages rather than Sourceforge, so it’s now
>really fast
>3. Also making it really fast and nice to use is Joel’s amazing
>JavaScript-based update
>4. The search now uses MetaCPAN which has a neat autocomplete feature
>
>
>
> All credit to Joel for his modernisation work; Chris for helping me with
> the updating of the Sourceforge site; Robert of the Perl NOC for his
> near-instantaneous help with switching the hosting. I have probably missed
> some stuff so please have a nose around and open issues on
> https://github.com/PDLPorters/pdlporters.github.com/issues or use the
> “Website issues” link in the sidebar (which links to that).
>
>
>
> As usual, please give the new *website* a try and report problems.
>
>
>
> Best regards,
>
> Ed
>
>
>
>
>
>
> ___
>
> pdl-general mailing list
>
> pdl-general@lists.sourceforge.net
>
> https://lists.sourceforge.net/lists/listinfo/pdl-general
>
>
>
>
>
___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] pdl.perl.org website updated

2022-04-16 Thread Hernán De Angelis

Hi!

Nice! The page appears to load faster. I have a couple of (potentially 
silly) questions:


- how is the "recent news" feed managed? Is this done manually in the 
"home.html" page 
(https://github.com/PDLPorters/pdlporters.github.com/blob/master/content/home.html) 
?


- links to previous PDL versions in CPAN point to the same address 
(https://metacpan.org/pod/PDL). Shouldn't it be something like, for 
example for 2.077: 
https://metacpan.org/release/ETJ/PDL-2.077/view/Basic/PDL.pm ?


- why is the last released version in github 2.026 from feb 2021? 
Shouldn't it be nice to have it in sync with metacpan? Perhaps there is 
good reason to do so and I am just not aware of it.


If what is needed is manpower to keep these thinks updated and 
consistent I may be able to help.



H.




Den 2022-04-15 kl. 18:11, skrev Ed .:


Dear PDL folks,

Those of you who look at the PDL website every day will already know 
this. For those who don’t, I have just (hopefully) finished tweaking 
the website at https://pdl.perl.org/:


  * The astute among you will notice that’s now “https” not “http”
  * It’s hosted on GitHub Pages rather than Sourceforge, so it’s now
really fast
  * Also making it really fast and nice to use is Joel’s amazing
JavaScript-based update
  * The search now uses MetaCPAN which has a neat autocomplete feature

All credit to Joel for his modernisation work; Chris for helping me 
with the updating of the Sourceforge site; Robert of the Perl NOC for 
his near-instantaneous help with switching the hosting. I have 
probably missed some stuff so please have a nose around and open 
issues on https://github.com/PDLPorters/pdlporters.github.com/issues 
or use the “Website issues” link in the sidebar (which links to that).


As usual, please give the new *website* a try and report problems.

Best regards,

Ed



___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general
___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] PDL 2.078

2022-04-12 Thread Hernán De Angelis
Thank you, Ed. I understand what you mean. I believe now that a previous
version of Alien::proj was indeed present so perhaps that was causing som
trouble. I also understand what you say about perldl.conf. I guess we can
consider this case closed and my questions answered. Thank you all for the
help.

Hernán

Den tis 12 apr. 2022 18:52Ed .  skrev:

> Hi Hernán,
>
>
>
> Great to hear your local issue is sorted – thank you to you and Shawn!
>
>
>
> PDL absolutely will build without Alien::proj. Problems will only arise if
> it is installed but broken. You can prove this by making a new Perl
> installation (“perlbrew” is my recommended tool) with no Alien::proj (but
> with other actual needed deps like File::Map) then install PDL on it. This
> is also tested on every single commit of PDL which gets built and tested in
> our continuous integration (CI) in (among many, many other environments) a
> container on CentOS with minimal deps.
>
>
>
> perldl.conf as a mechanism is not a suitable vehicle for this, nor really
> for anything else. The whole Alien concept in Perl was originally invented
> to solve this class of problems, for PDL. We are sticking with it until a
> convincing case is made for something better.
>
>
>
> Best regards,
>
> Ed
>
>
>
> *From: *Hernán De Angelis 
> *Sent: *12 April 2022 12:50
> *To: *pdl-general@lists.sourceforge.net
> *Subject: *Re: [Pdl-general] PDL 2.078
>
>
>
> Dear all,
>
> Just to report that thanks to a good collaboration with Shawn we were able
> to track the problem to an empty "PKG_CONFIG_PATH" in my system. After
> adding the proper paths now Alien::proj and PDL both compile fast, well and
> smoothly.
>
> It also seems that PDL will not build without Alien::proj. Then the
> question remains: would it be possible or desirable to be able to build PDL
> without proj by giving an appropriate flag in perldl.conf?
>
> Best regards and thanks to all
>
> Hernán
>
>
>
> Den 2022-04-12 kl. 11:12, skrev Shawn Laffan:
>
> It would be useful to be able to build PDL without the proj-dependent
> components.  This could maybe be done using an environment variable, or an
> argument passed to the ```perl Makefile.PL``` call.  Ed would be better
> placed to comment on this aspect.
>
>
>
> Alien::proj will not attempt to build from source if it can find existing
> libs.  If it is building from source on a system where proj>6 is installed
> then there might be an issue with the probes.  The probe to find existing
> installations uses pkg-config.  If that is not on your system, or the
> proj.pc file is not in the PKG_CONFIG_PATH, then Alien::proj will fall back
> to a source install.  (Note - Hernán is following that up separately).
>
>
>
> Shawn.
>
>
>
> On Tue, 12 Apr 2022 at 18:06, Hernán De Angelis <
> variablestarli...@gmail.com> wrote:
>
> Hello Shawn
>
> Thanks for your answer.
>
> I am not trying to build Alien::proj. I just would like to tell PDL not to
> care about it. How is it that up to 2.027 this wasn't a problem but it
> suddenly is in 2.028? I will dig a bit on this and try to find out. I have
> a dislike of Alien::* since it will install and build things I already have
> and which I have control over. This may be purely subjective but if I can
> avoid having this it would be nice. Again, this wasn't a problem before.
> Why now? I am not asking anyone to work to find it, my question is rather
> if someone knows of an easy way to bypass having to install Alien::* just
> to get PDL going, albeit without the functionality provided by proj.
>
> I use openSUSE Tumbleweed (rolling release). I have used Linux exclusively
> since 2005, mostly openSUSE and its predecessors. For the tools I use more
> often I do not use a package manager (zypper in openSUSE) but I build them
> (proj, geos, gdal, GRASS GIS, QGIS and others) from source myself. All of
> them live in /usr/local and subdirectories, properly exported to the path
> and library path (they actually found each other, no problems there). I
> normally update Perl modules using CPAN, including PDL, but when
> troubleshooting is needed I also build from source using the "perl
> Makefile.pl" method. And yes, I am familiar with Geo::GDAL::FFI. I use it
> in a couple of projects. It installs and runs fine.
>
>
> Best regards
>
> Hernán
>
>
> Den 2022-04-11 kl. 23:57, skrev Shawn Laffan:
>
> Hello Hernan,
>
>
>
> If you have issues installing Alien::proj then could you please file a bug
> report?  https://github.com/shawnlaffan/perl-alien-proj
>
>
>
> If you have proj installed with its headers then Alien::proj will run a
> system 

Re: [Pdl-general] PDL 2.078

2022-04-12 Thread Hernán De Angelis

Hello Shawn

Thanks for your answer.

I am not trying to build Alien::proj. I just would like to tell PDL not 
to care about it. How is it that up to 2.027 this wasn't a problem but 
it suddenly is in 2.028? I will dig a bit on this and try to find out. I 
have a dislike of Alien::* since it will install and build things I 
already have and which I have control over. This may be purely 
subjective but if I can avoid having this it would be nice. Again, this 
wasn't a problem before. Why now? I am not asking anyone to work to find 
it, my question is rather if someone knows of an easy way to bypass 
having to install Alien::* just to get PDL going, albeit without the 
functionality provided by proj.


I use openSUSE Tumbleweed (rolling release). I have used Linux 
exclusively since 2005, mostly openSUSE and its predecessors. For the 
tools I use more often I do not use a package manager (zypper in 
openSUSE) but I build them (proj, geos, gdal, GRASS GIS, QGIS and 
others) from source myself. All of them live in /usr/local and 
subdirectories, properly exported to the path and library path (they 
actually found each other, no problems there). I normally update Perl 
modules using CPAN, including PDL, but when troubleshooting is needed I 
also build from source using the "perl Makefile.pl" method. And yes, I 
am familiar with Geo::GDAL::FFI. I use it in a couple of projects. It 
installs and runs fine.



Best regards

Hernán



Den 2022-04-11 kl. 23:57, skrev Shawn Laffan:

Hello Hernan,

If you have issues installing Alien::proj then could you please file a 
bug report? https://github.com/shawnlaffan/perl-alien-proj


If you have proj installed with its headers then Alien::proj will run 
a system install.  This will just use your existing installation.  If 
it cannot find the headers then it will run a share install, which 
means it builds the system from source code.


You have not said what operating system you are using but as an 
example the libproj-dev package is needed on ubuntu to trigger a 
system install.


WRT Ed's comment about GDAL bindings, Geo::GDAL::FFI provides these 
for perl and has methods to convert rasters to and from PDL ndarrays.

https://metacpan.org/pod/Geo::GDAL::FFI
https://metacpan.org/pod/Geo::GDAL::FFI::Band#SetPiddle

Regards,
Shawn.

On Tue, 12 Apr 2022 at 04:29, Hernán De Angelis 
 wrote:


Hi Ed

Thank you for your detailed response.

I understand that Alien::proj will install the latest proj. For
some reason I cannot manage to build it. On the other hand
Alien::gdal builds ok.

I understand from your answer that PDL will build even if
Alien::proj is not present. I wonder why then I get the error
below. What could be missing here?

I also understand that PDL has operated this way since 2014 but I
have not had this problem before even when I update PDL every time
there is a new upgrade and have used PDL since 2006. So something
is not as it was recently either in PDL code or my machine. I am
trying to discern what it is.

I will investigate this a bit more and see what I can find.

Again a big thank you for taking the pains of maintaining and
developing PDL further. And even answering these emails! That's
much appreciated!

Minor comments: I meant FFT and not FFTW. GLUT just compiled fine,
maybe something got changed since this morning... And please
disregard the "whimsical" part, just a bit of misplaced humor :-)


Best regards

Hernán


make[3]: Entering directory
'/root/.cpan/build/PDL-2.078-0/Libtmp/Transform/Cartography'
chmod 755 ../../blib/arch/auto/PDL/Transform/Transform.so
Manifying 1 pod document
make[3]: Leaving directory
'/root/.cpan/build/PDL-2.078-0/Libtmp/Transform/Cartography'
make[3]: Entering directory
'/root/.cpan/build/PDL-2.078-0/Libtmp/Transform/Proj4'
"/usr/local/perls/perl-5.34.1/bin/perl" "-I../../../blib/arch"
"-I../../../blib/lib"
"-MPDL::PP=PDL::Transform::Proj4,PDL::Transform::Proj4,Proj4,,1"
Proj4.pd
"/usr/local/perls/perl-5.34.1/bin/perl" -MExtUtils::Command::MM -e
'cp_nonempty' -- Proj4.bs
../../../blib/arch/auto/PDL/Transform/Proj4/Proj4.bs 644
/usr/local/perls/perl-5.34.1/bin/perl: symbol lookup error:
../../../blib/arch/auto/PDL/GIS/Proj/Proj.so: undefined symbol:
proj_list_operations
make[3]: *** [Makefile:863: Proj4.pm] Error 127
make[3]: Leaving directory
'/root/.cpan/build/PDL-2.078-0/Libtmp/Transform/Proj4'
make[2]: *** [Makefile:516: subdirs] Error 2
make[2]: Leaving directory
'/root/.cpan/build/PDL-2.078-0/Libtmp/Transform'
make[1]: *** [Makefile:515: subdirs] Error 2
make[1]: Leaving directory '/root/.cpan/build/PDL-2.078-0/Libtmp'
make: *** [Makefile:552: subdirs] Error 2








Den 2022-04-11 kl. 18:12, skrev Ed .:


Hi Hernán!

PDL’s build (

[Pdl-general] PDL 2.078

2022-04-11 Thread Hernán De Angelis

Hi all

Thanks Ed and others for the great job you do maintaining and developing 
PDL. Hats off!


Today I got news that 2.078 was available so I promptly went on CPAN and 
hit upgrade. But for the first time in *many* years PDL did not just 
build smoothly right away.


Upon investigation I see that PDL complains about Proj4 and HDF4 lacking 
when trying to build PDL::Transform. Problem is I cannot find anywhere 
in perdl.conf where I can tell PDL not to care about this and not run 
the t/gis_proj.t and t/proj_transform.t tests. If I remember correctly 
that possibility existed years ago. Can we still build PDL without using 
Proj? Perhaps using --force? But that is not very elegant ...


A related question is: does PDL really need Alien::* for this stuff? I 
would prefer not to mess with that because these packages install lots 
of stuff I do not need nor want in my system. I actually work everyday 
with geoinformatics and normally have the latest gdal/ogr and proj. If 
PDL needs proj I believe it would be much better to have PDL rely on 
those rather than some whimsical Alien::* installing ancient proj4 
versions (proj is v. 9 now).


Less serious stuff:
- Glut fails to install at the end but this has been the case for many 
months and not been a problem
- there are a lot of FORTRAN warnings (see exerpt below), perhaps some 
deprecated syntax that the latest gfortran (11.2.1 20220316) does not like.


Good things:
- Core, FFTW, GSL build smoothly as usual.


Best

Hernán




# # # # # #
# some fortran warnings
# # # # # #

Warning: Fortran 2018 deleted feature: DO termination statement which is 
not END DO or CONTINUE with label 120 at (1)

slatec/tred2.f:112:72:

  112 |   180   G = G + Z(J,K) * Z(I,K)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is 
not END DO or CONTINUE with label 180 at (1)

slatec/tred2.f:118:72:

  118 |   200   G = G + Z(K,J) * Z(I,K)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is 
not END DO or CONTINUE with label 200 at (1)

slatec/tred2.f:131:72:

  131 | DO 260 K = 1, J
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 260 
at (1)

slatec/tred2.f:149:72:

  149 |   340   G = G + Z(I,K) * Z(K,J)
| 1
Warning: Fortran 2018 deleted feature: DO termination statement which is 
not END DO or CONTINUE with label 340 at (1)

slatec/tred2.f:151:72:

  151 | DO 360 K = 1, L
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 360 
at (1)___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] Status of PDL:NetCDF?

2021-01-04 Thread Hernán De Angelis


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:variablestarli...@gmail.com>


*Sent: *04 January 2021 08:39
*To: *pdl-general@lists.sourceforge.net 
<mailto:pdl-general@lists.sourceforge.net>

*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
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general 
<https://lists.sourceforge.net/lists/listinfo/pdl-general>


___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] Status of PDL:NetCDF?

2021-01-04 Thread Hernán De Angelis

And, if I put that line in my code:

my @dimlens = reverse $matrix->dims;

It works like charm.

May be there is a missing call to a core PDL library?

/H.

On 2021-01-04 09:50, Hernán De Angelis wrote:


Thanks for the extremely fast response, Ed!

Line 1333 in PDL:NetCDF says:

  my @dimlens = reverse $pdl->dims;

Hernán

On 2021-01-04 09:43, Ed . wrote:


Dear Hernán,

My instant response: don’t give up!

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.


I would imagine that numpy would be less reliable after 8-10 years 
than Perl stuff, since a major goal of Perl is to be backwards 
compatible, and PDL has followed that. But let us find out if that 
applies here, by solving your problem!


Best regards,

Ed

*From: *Hernán De Angelis <mailto:variablestarli...@gmail.com>
*Sent: *04 January 2021 08:39
*To: *pdl-general@lists.sourceforge.net 
<mailto:pdl-general@lists.sourceforge.net>

*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
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general 
<https://lists.sourceforge.net/lists/listinfo/pdl-general>


___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] Status of PDL:NetCDF?

2021-01-04 Thread Hernán De Angelis

Thanks for the extremely fast response, Ed!

Line 1333 in PDL:NetCDF says:

  my @dimlens = reverse $pdl->dims;

Hernán

On 2021-01-04 09:43, Ed . wrote:


Dear Hernán,

My instant response: don’t give up!

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.


I would imagine that numpy would be less reliable after 8-10 years 
than Perl stuff, since a major goal of Perl is to be backwards 
compatible, and PDL has followed that. But let us find out if that 
applies here, by solving your problem!


Best regards,

Ed

*From: *Hernán De Angelis <mailto:variablestarli...@gmail.com>
*Sent: *04 January 2021 08:39
*To: *pdl-general@lists.sourceforge.net 
<mailto:pdl-general@lists.sourceforge.net>

*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
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general 
<https://lists.sourceforge.net/lists/listinfo/pdl-general>


___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] Status of PDL:NetCDF?

2021-01-04 Thread Hernán De Angelis

Forgot to add that perl is 5.32.0

/H.

On 2021-01-04 09:38, Hernán De Angelis wrote:

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
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general