You can subscribe to this list here.
2015 |
Jan
|
Feb
(44) |
Mar
(75) |
Apr
(42) |
May
(50) |
Jun
(82) |
Jul
(17) |
Aug
(45) |
Sep
(32) |
Oct
(32) |
Nov
(41) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2016 |
Jan
(9) |
Feb
(5) |
Mar
(6) |
Apr
(6) |
May
(34) |
Jun
(47) |
Jul
(10) |
Aug
(2) |
Sep
(6) |
Oct
(35) |
Nov
(6) |
Dec
|
2017 |
Jan
(7) |
Feb
(5) |
Mar
(3) |
Apr
(2) |
May
(12) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
|
Nov
(5) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
(16) |
Apr
(7) |
May
(10) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(1) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
(32) |
May
(11) |
Jun
(5) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
2021 |
Jan
|
Feb
(25) |
Mar
(38) |
Apr
(11) |
May
(3) |
Jun
(6) |
Jul
(2) |
Aug
(22) |
Sep
(12) |
Oct
(18) |
Nov
(6) |
Dec
(1) |
2022 |
Jan
(5) |
Feb
(47) |
Mar
(6) |
Apr
(9) |
May
(7) |
Jun
(2) |
Jul
(5) |
Aug
(15) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2023 |
Jan
|
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(2) |
Jun
(2) |
Jul
(3) |
Aug
(6) |
Sep
(17) |
Oct
(5) |
Nov
|
Dec
|
2024 |
Jan
(8) |
Feb
(4) |
Mar
(1) |
Apr
(8) |
May
(13) |
Jun
(10) |
Jul
|
Aug
|
Sep
(1) |
Oct
(16) |
Nov
(9) |
Dec
(18) |
2025 |
Jan
(47) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Guillermo P. O. <go...@ex...> - 2025-01-22 16:24:40
|
Hello again, I find some a not pretty solution using whereND $r=(zeroes(3,3)->ndcoords/2-pdl(0.5,0.5))->r2C $rr=($r**2)->sumover->sqrt ($r1,$r2)=whereND($r->slice("(0)"),$r->slice("(1)"),$rr->abs<0.2) ($r3,$r4)=whereND($r->slice("(0)"),$r->slice("(1)"),$rr->abs>=0.2) Then. modifying $r1.= f($r1) $r3.= f($r2,$r4) ... Perform back dataflow to $r that I am looking for Maybe a better solution is possible? Best regards El mié, 22 ene 2025 a las 12:39, Guillermo P. Ortiz (<go...@ex...>) escribió: > Hello, > the complex number in the case 1D can be obtained as expected > doing first $r=$r->r2C > > But in 2D case I still did not have succeeded to match with > dataflow on $r in the sense of the mask > > For example, If I do > > $r=(zeroes(3,3)->ndcoords/2-pdl(0.5,0.5))->r2C; > $rr=($r**2)->sumover->sqrt; > ($r1,$r2)=where_both($rr,$rr->abs<0.2) > > I obtain the expected result in $r1 and $r2 in agreement > with the mask of the vectors lengths > > But, how to pass from that the respective length in the $r1 > and $r2 to the vectors in $r ? It would be some index indirection that > manage these facts? > > Regards > > > > > > > > > > > > > > > > > El mar, 21 ene 2025 a las 20:35, Guillermo P. Ortiz (< > go...@ex...>) escribió: > >> Hi Ed, >> yes, just I was trying with where_both >> But I get unexpected behaviour for me in 2D case >> >> 1) first in 1D >> >> pdl> $r=zeroes(3)->ndcoords/2-pdl(0.5) >> >> pdl> p $r >> >> [ >> [-0.5] >> [ 0] >> [ 0.5] >> ] >> >> pdl> ($r1,$r2)=where_both($r,$r->abs < 0.2) >> >> pdl> p $r1 >> [0] >> >> pdl> p $r2 >> [-0.5 0.5] >> >> now, trying to modify $r following that condition >> >> pdl> $r1.=$r1+1 >> >> pdl> $r2.=$r2+3 >> >> pdl> p $r >> >> [ >> [2.5] >> [ 1] >> [3.5] >> ] >> >> But this seem did not work for complex number >> >> pdl> $r1.=$r1*(1+i) >> >> pdl> $r2.=$r2-(1+i) >> >> >> pdl> p $r >> >> [ >> [1.5] >> >> [ 1] >> [2.5] >> >> ] >> >> And, seem did not work in 2D for real case neither >> >> pdl> $r=zeroes(3,3)->ndcoords/2-pdl(0.5,0.5) >> >> pdl> p $r >> >> [ >> [ >> [-0.5 -0.5] >> [ 0 -0.5] >> [ 0.5 -0.5] >> ] >> [ >> [-0.5 0] >> [ 0 0] >> >> [ 0.5 0] >> ] >> [ >> [-0.5 0.5] >> >> [ 0 0.5] >> [ 0.5 0.5] >> >> ] >> ] >> >> pdl> ($r1,$r2)=where_both($r,($r**2)->sumover->sqrt < 0.2) >> >> pdl> p $r1 >> [0.5] >> >> pdl> p $r2 >> [-0.5 -0.5 0 -0.5 -0.5 -0.5 0 0] >> >> what I doing wrong here? >> >> Regards >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> El mar., 21 de enero de 2025 19:42, Ed . <ej...@ho...> escribió: >> >>> Hi Guillermo, >>> >>> That does feel to me like you'd want to *not* do something on the whole >>> ndarray, but instead do something on a $pdl->where(condition...). What >>> do you think? >>> >>> Best regards, >>> Ed >>> >>> ------------------------------ >>> *From:* Guillermo P. Ortiz <go...@ex...> >>> *Sent:* 21 January 2025 19:07 >>> *To:* Ed . <ej...@ho...> >>> *Cc:* pdl...@li... <pdl...@li...>; >>> perldl <pdl...@li...> >>> *Subject:* Re: [Pdl-devel] conditional inline >>> >>> For instance, I am trying with $r, like below >>> >>> $r=(zeroes(2*$N+1,2*$N+1)->ndcoords-pdl($N,$N))/(2*$N+1) >>> >>> Regards >>> >>> El mar, 21 ene 2025 a las 14:39, Guillermo P. Ortiz (< >>> go...@ex...>) escribió: >>> >>> Yes Ed, you are right. >>> I want to perform different operations on $r >>> depending on its distance to a point $r0 in 2D. >>> Then, I guess that first, and because for further >>> manipulation, I decide to center $r-=$r0 in >>> such a point. >>> >>> Then in false code, >>> >>> if ( length ($r) < $a) >>> { return f($r)} >>> else >>> { return g($r) } >>> >>> where "length" I am not sure, but it could be inner($r,$r)->sqrt. >>> Maybe no ternary expression but some subroutine will be fine also. >>> >>> Regards >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> El mar, 21 ene 2025 a las 14:16, Ed . (<ej...@ho...>) escribió: >>> >>> Hi Guillermo, >>> >>> That conditional will, for the case you've given, always be false, >>> because it has values more than 0.2 away from 0.5. When you use all, >>> you are asking a question about the entire ndarray, in other words for >>> every single value in it. >>> >>> I believe that there's some real problem you're trying to solve, but I'm >>> afraid I still have absolutely no idea what it is. Please help me help you! >>> >>> Best regards, >>> Ed >>> >>> ------------------------------ >>> *From:* Guillermo P. Ortiz <go...@ex...> >>> *Sent:* 21 January 2025 01:19 >>> *To:* Ed . <ej...@ho...> >>> *Cc:* pdl...@li... <pdl...@li...>; >>> perldl <pdl...@li...> >>> *Subject:* Re: [Pdl-devel] conditional inline >>> >>> Ok, Ed, >>> That example did not work for me. >>> The conditional results seems to be allways false. I mean, that it give >>> $x also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 >>> result. >>> >>> Regates >>> >>> >>> >>> El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...> escribió: >>> >>> Hi Guillermo, >>> >>> You may still be having a problem, but you have yet to tell us what it >>> is. The code you sent works fine, including as many dimensions as you like >>> (because all acts on the whole ndarray at once). >>> >>> If there's a problem in there, please share it :-) >>> >>> Best regards, >>> Ed >>> >>> ------------------------------ >>> *From:* Guillermo P. Ortiz <go...@ex...> >>> *Sent:* 20 January 2025 23:35 >>> *To:* Ed . <ej...@ho...> >>> *Cc:* pdl...@li... <pdl...@li...>; >>> perldl <pdl...@li...> >>> *Subject:* Re: [Pdl-devel] conditional inline >>> >>> Thanks Ed, >>> Using ternary conditional expression >>> I still have some problem with múltiple disensión case. >>> See my example in message befare >>> >>> >>> El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: >>> >>> Hi Guillermo, >>> >>> You can do that indeed, that's just Perl. If you wanted to do operations >>> on a subset of that ndarray, then you'd do e.g. >>> >>> $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; >>> >>> An observation is that the above condition could be a bit shorter by >>> using the recently-added approx_artol: (which would also mean it ran >>> quicker) >>> >>> $pdl->approx_artol(0.5, 0.2) >>> >>> Best regards, >>> Ed >>> >>> ------------------------------ >>> *From:* Guillermo P. Ortiz <go...@ex...> >>> *Sent:* 20 January 2025 19:39 >>> *To:* pdl...@li... <pdl...@li...>; >>> perldl <pdl...@li...> >>> *Subject:* [Pdl-devel] conditional inline >>> >>> Hello ! >>> >>> I am not sure, but maybe It is possible to do with perl PDL something >>> like this? >>> >>> $ndarray= condition on $ndarray ? assign when true : assign when false >>> >>> for example: >>> >>> $x=zeroes(20)->xlinvals(0,1); >>> >>> $y=(all abs($x-0.5)<0.2)?$x**2:$x; >>> >>> Thanks in advance >>> >>> Regards >>> >>> -- >>> >>> >>> Dr. Guillermo P. Ortiz >>> Electromagnetismo Aplicado >>> Dto. Física, Facultad de Ciencias Exactas >>> Universidad Nacional del Nordeste >>> Avda Libertad 5460 >>> <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, >>> Campus UNNE. >>> W3404AAS Corrientes, Argentina. >>> (+54) 379-4424678 interno 4613 >>> gortiz* at *unne edu ar >>> >>> |
From: Ed . <ej...@ho...> - 2025-01-22 16:18:51
|
Hi Luis, I agree that in a sense, the system was buggy (albeit only misleading rather than actually operating wrongly), which is why I fixed it and that will be reflected in the next version. In the meantime, there is the workaround (or actual solution, depending on your point of view) of adding to the cpanm invocation. Best regards, Ed ________________________________ From: Luis Mochan <mo...@ic...> Sent: 22 January 2025 15:38 To: Ed . <ej...@ho...> Cc: perldl <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] pdl scripts Hi Ed, On Wed, Jan 22, 2025 at 02:50:41PM +0000, Ed . wrote: > Hi Luis, > > The suggestion I made in my first reply: "cpanm can be told to install recommended modules" is the one I am still making. I understand. My worry is about the new users. They may just turn away if they believe the system is buggy :( (My students didn't; I convinced them to stay, or else... :) > > Please install PDL with `cpanm --with-suggests` (the "suggests" will also bring in Sys::SigAction which means you can use ctrl-C to abort a partly typed-in command, which I find very handy). Ok. > Clearly, perldl should give a better error message than the one it does now, which is very misleading - it says it couldn't load "PDL", but that's not correct. I've just pushed a commit to master that makes it tolerate T:RK not being there - it was being used only for apropos and a couple of other places to get the screen width. Ok, I'll try again later. Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Luis M. <mo...@ic...> - 2025-01-22 15:41:51
|
Hi Jo, I recall it didn't work either, nor perldl (but I don't trust my memory). I would have to start again to test them. As I wrote before, my worry is the impression it might cause to new users to have a program installed and then find out it sends error messages (erroneous, as Ed explained above) when first tried. Regards, Luis On Wed, Jan 22, 2025 at 02:30:01PM +0000, Jörg Sommrey wrote: > Hi Luis, > > you might try 'pdl2' instead of 'pdl'. The latter doesn't work for me > neither after upgrading PDL lately. > Just a guess. > > -jo > > On Wed 22 Jan 2025 04:46:09 AM CET, Luis Mochan <mo...@ic...> wrote: > > > Hi Ed, > > > > Maybe I didn't explain the issue, maybe I don't quite understand > > it. And maybe I didn't quite understand your answer: > > > > 1. I made a new account in my laptop > > 2. I installed perlbrew > > 3. I installed perl-5.40.1 > > 4. In installed cpanm > > 5. I installed PDL with cpanm > > 6. I ran pdl > > 7. I obtained the answer: > > > > perlDL shell v1.357 > > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > > 'COPYING' in the PDL distribution. This is free software and you > > are welcome to redistribute it under certain conditions, see > > the same file for details. > > ReadLines, NiceSlice, MultiLines enabled > > Reading PDL/default.perldlrc... > > * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC > > (you may need to install the Term::ReadKey module) (@INC entries > > checked: /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux > > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 > > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux > > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm > > line 52. > > BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm > > line 52. > > Compilation failed in require at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc > > line 37. > > BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc > > line 37. > > Compilation failed in require at (eval 13) line 1. > > ' - trying blib. > > WARNING: PDL startup not found only plain perl available > > > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > ** perl> > > > > The line marked with an * above says: 'WARNING: Error loading PDL: > > 'Can't locate Term/ReadKey.pm in @INC (you may need to install the > > Term::ReadKey module)...' > > > > So it is not that I (or my students) care about Term::ReadKey, it is > > that the advice we got is that we'd better install it. > > > > Also, the line marked with ** shows we obtained the prompt 'perl>' > > instead of the expected prompt 'pdl>'. > > > > In my previous installations, I hadn't had this problem, as I > > installed manually many required and optional pre-requisites, > > including Term::ReadLine::Gnu, which I guess is the readline you > > mention in your answer. However, installing Term::Readline::Gnu didn't > > help with the problem above. I obtained again: > > > > $ pdl > > perlDL shell v1.357 > > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > > 'COPYING' in the PDL distribution. This is free software and you > > are welcome to redistribute it under certain conditions, see > > the same file for details. > > ReadLines, NiceSlice, MultiLines enabled > > Reading PDL/default.perldlrc... > > WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC > > (you may need to install the Term::ReadKey module) (@INC entries > > checked: /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux > > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 > > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux > > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm > > line 52. > > BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm > > line 52. > > Compilation failed in require at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc > > line 37. > > BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc > > line 37. > > Compilation failed in require at (eval 11) line 1. > > ' - trying blib. > > WARNING: PDL startup not found only plain perl available > > > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > > > perl> > > > > But after installing ReadKey things started behaving as usual: > > > > $ cpanm Term::ReadKey > > --> Working on Term::ReadKey > > Fetching > > http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz ... > > OK > > Configuring TermReadKey-2.38 ... OK > > Building and testing TermReadKey-2.38 ... OK > > Successfully installed TermReadKey-2.38 > > 1 distribution installed > > $ pdl > > perlDL shell v1.357 > > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > > 'COPYING' in the PDL distribution. This is free software and you > > are welcome to redistribute it under certain conditions, see > > the same file for details. > > ReadLines, NiceSlice, MultiLines enabled > > Reading PDL/default.perldlrc... > > Found docs database /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db > > Type 'help' for online help > > Type 'demo' for online demos > > Loaded PDL v2.098 (supports bad values) > > > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > > > pdl> > > > > So, what is the user expected to do? The installation of PDL was declared > > succesful, a program ('pdl') distributed with PDL was installed, the > > program didn't run smoothly and sent error messages asking the user to > > install another package: Term::ReadKey. How would you interpret this > > situation as a new user? Wouldn't you be confused? Wouldn't you > > conclude there is something wrong? > > > > I don't know what is the correct solution. I suggested adding > > Term::ReadKey to the required packages, so it would be installed > > automatically. Maybe that is not the correct solution, but then, I > > don't know, what would be the correct solution? > > > > Best regards, > > Luis > > > > > > > > > > On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: > > > Hi Luis, > > > > > > PDL isn't just an interactive environment. "Required" would be > > > wrong. I use the interactive part very heavily (which isn't very > > > surprising), and wouldn't want to use it without readline (which I > > > have faced when debugging in a qemu environment on a weird > > > architecture). I am not going to make any of the Term::* be > > > "required" for PDL. I hope you understand. > > > > > > If it helps, the REPL script was installed, but not all of the > > > components. It does sound like you're asking me to make a separate > > > PDL::REPL repo where that stuff would live, but I don't want to do > > > that. > > > > > > Best regards, > > > Ed > > > > > > ________________________________ > > > From: Luis Mochan <mo...@ic...> > > > Sent: 21 January 2025 20:07 > > > To: Ed . <ej...@ho...> > > > Cc: perldl <pdl...@li...>; perldl > > > <pdl...@li...> > > > Subject: Re: [Pdl-devel] pdl scripts > > > > > > Hi Ed, > > > > > > On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: > > > > Hi Luis, > > > > > > > > That's a really good question! > > > > > > > > PDL's "requirements" (when you say e.g. cpanm PDL) are hard > > > requirements for PDL to run: largely File::Map and File::Which. CPAN > > > has a mechanism to "recommend" other modules, including > > > Term::ReadKey. It has done so for a long time. cpanm can be told to > > > install recommended modules. > > > > > > The doubt I have now is, should Term::ReadKey be recommended or should > > > it be required? The problem is that the repl's were installed, but > > > they didn't work without it. > > > > > > > The demos will be sparse... > > > > > > Ok, thanks. I'll pass that info to the students. > > > > > > Regards, > > > Luis > > > > > > -- > > > > > > o > > > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > > > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > > > Av. Universidad s/n CP 62210 | (*)/\/ \ > > > Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ > > > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB > > > -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Guillermo P. O. <go...@ex...> - 2025-01-22 15:40:12
|
Hello, the complex number in the case 1D can be obtained as expected doing first $r=$r->r2C But in 2D case I still did not have succeeded to match with dataflow on $r in the sense of the mask For example, If I do $r=(zeroes(3,3)->ndcoords/2-pdl(0.5,0.5))->r2C; $rr=($r**2)->sumover->sqrt; ($r1,$r2)=where_both($rr,$rr->abs<0.2) I obtain the expected result in $r1 and $r2 in agreement with the mask of the vectors lengths But, how to pass from that the respective length in the $r1 and $r2 to the vectors in $r ? It would be some index indirection that manage these facts? Regards El mar, 21 ene 2025 a las 20:35, Guillermo P. Ortiz (<go...@ex...>) escribió: > Hi Ed, > yes, just I was trying with where_both > But I get unexpected behaviour for me in 2D case > > 1) first in 1D > > pdl> $r=zeroes(3)->ndcoords/2-pdl(0.5) > > pdl> p $r > > [ > [-0.5] > [ 0] > [ 0.5] > ] > > pdl> ($r1,$r2)=where_both($r,$r->abs < 0.2) > > pdl> p $r1 > [0] > > pdl> p $r2 > [-0.5 0.5] > > now, trying to modify $r following that condition > > pdl> $r1.=$r1+1 > > pdl> $r2.=$r2+3 > > pdl> p $r > > [ > [2.5] > [ 1] > [3.5] > ] > > But this seem did not work for complex number > > pdl> $r1.=$r1*(1+i) > > pdl> $r2.=$r2-(1+i) > > > pdl> p $r > > [ > [1.5] > > [ 1] > [2.5] > > ] > > And, seem did not work in 2D for real case neither > > pdl> $r=zeroes(3,3)->ndcoords/2-pdl(0.5,0.5) > > pdl> p $r > > [ > [ > [-0.5 -0.5] > [ 0 -0.5] > [ 0.5 -0.5] > ] > [ > [-0.5 0] > [ 0 0] > > [ 0.5 0] > ] > [ > [-0.5 0.5] > > [ 0 0.5] > [ 0.5 0.5] > > ] > ] > > pdl> ($r1,$r2)=where_both($r,($r**2)->sumover->sqrt < 0.2) > > pdl> p $r1 > [0.5] > > pdl> p $r2 > [-0.5 -0.5 0 -0.5 -0.5 -0.5 0 0] > > what I doing wrong here? > > Regards > > > > > > > > > > > > > > > > > > > > > > > El mar., 21 de enero de 2025 19:42, Ed . <ej...@ho...> escribió: > >> Hi Guillermo, >> >> That does feel to me like you'd want to *not* do something on the whole >> ndarray, but instead do something on a $pdl->where(condition...). What >> do you think? >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 21 January 2025 19:07 >> *To:* Ed . <ej...@ho...> >> *Cc:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* Re: [Pdl-devel] conditional inline >> >> For instance, I am trying with $r, like below >> >> $r=(zeroes(2*$N+1,2*$N+1)->ndcoords-pdl($N,$N))/(2*$N+1) >> >> Regards >> >> El mar, 21 ene 2025 a las 14:39, Guillermo P. Ortiz (< >> go...@ex...>) escribió: >> >> Yes Ed, you are right. >> I want to perform different operations on $r >> depending on its distance to a point $r0 in 2D. >> Then, I guess that first, and because for further >> manipulation, I decide to center $r-=$r0 in >> such a point. >> >> Then in false code, >> >> if ( length ($r) < $a) >> { return f($r)} >> else >> { return g($r) } >> >> where "length" I am not sure, but it could be inner($r,$r)->sqrt. >> Maybe no ternary expression but some subroutine will be fine also. >> >> Regards >> >> >> >> >> >> >> >> >> >> >> >> >> El mar, 21 ene 2025 a las 14:16, Ed . (<ej...@ho...>) escribió: >> >> Hi Guillermo, >> >> That conditional will, for the case you've given, always be false, >> because it has values more than 0.2 away from 0.5. When you use all, you >> are asking a question about the entire ndarray, in other words for every >> single value in it. >> >> I believe that there's some real problem you're trying to solve, but I'm >> afraid I still have absolutely no idea what it is. Please help me help you! >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 21 January 2025 01:19 >> *To:* Ed . <ej...@ho...> >> *Cc:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* Re: [Pdl-devel] conditional inline >> >> Ok, Ed, >> That example did not work for me. >> The conditional results seems to be allways false. I mean, that it give >> $x also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 >> result. >> >> Regates >> >> >> >> El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...> escribió: >> >> Hi Guillermo, >> >> You may still be having a problem, but you have yet to tell us what it >> is. The code you sent works fine, including as many dimensions as you like >> (because all acts on the whole ndarray at once). >> >> If there's a problem in there, please share it :-) >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 20 January 2025 23:35 >> *To:* Ed . <ej...@ho...> >> *Cc:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* Re: [Pdl-devel] conditional inline >> >> Thanks Ed, >> Using ternary conditional expression >> I still have some problem with múltiple disensión case. >> See my example in message befare >> >> >> El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: >> >> Hi Guillermo, >> >> You can do that indeed, that's just Perl. If you wanted to do operations >> on a subset of that ndarray, then you'd do e.g. >> >> $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; >> >> An observation is that the above condition could be a bit shorter by >> using the recently-added approx_artol: (which would also mean it ran >> quicker) >> >> $pdl->approx_artol(0.5, 0.2) >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 20 January 2025 19:39 >> *To:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* [Pdl-devel] conditional inline >> >> Hello ! >> >> I am not sure, but maybe It is possible to do with perl PDL something >> like this? >> >> $ndarray= condition on $ndarray ? assign when true : assign when false >> >> for example: >> >> $x=zeroes(20)->xlinvals(0,1); >> >> $y=(all abs($x-0.5)<0.2)?$x**2:$x; >> >> Thanks in advance >> >> Regards >> >> -- >> >> >> Dr. Guillermo P. Ortiz >> Electromagnetismo Aplicado >> Dto. Física, Facultad de Ciencias Exactas >> Universidad Nacional del Nordeste >> Avda Libertad 5460 >> <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, >> Campus UNNE. >> W3404AAS Corrientes, Argentina. >> (+54) 379-4424678 interno 4613 >> gortiz* at *unne edu ar >> >> |
From: Luis M. <mo...@ic...> - 2025-01-22 15:38:45
|
Hi Ed, On Wed, Jan 22, 2025 at 02:50:41PM +0000, Ed . wrote: > Hi Luis, > > The suggestion I made in my first reply: "cpanm can be told to install recommended modules" is the one I am still making. I understand. My worry is about the new users. They may just turn away if they believe the system is buggy :( (My students didn't; I convinced them to stay, or else... :) > > Please install PDL with `cpanm --with-suggests` (the "suggests" will also bring in Sys::SigAction which means you can use ctrl-C to abort a partly typed-in command, which I find very handy). Ok. > Clearly, perldl should give a better error message than the one it does now, which is very misleading - it says it couldn't load "PDL", but that's not correct. I've just pushed a commit to master that makes it tolerate T:RK not being there - it was being used only for apropos and a couple of other places to get the screen width. Ok, I'll try again later. Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Jörg S. <jo...@so...> - 2025-01-22 15:34:52
|
On Wed 22 Jan 2025 03:55:20 PM CET, "Ed ." <ej...@ho...> wrote: > Hi Jörg, > > Can you please spell out what happens when you run "pdl" (which is > the compiled C executable that runs perldl)? It's supposed to work. Yes it actually does work - my fault. It was 'do_print 1;' in .perldlrc that caused 'pdl' to fail. I should have read the error message explaining the error. The 'perl>' prompt just rang a bell. It's a bit strange: I have been using 'do_print' for a long time now and I was not aware it was available in 'pdl2' only. -jo > > pdl2 won't work "out of the box", since it got removed due to its > very heavy dependencies. To run that now, you'll need to do cpanm > PDL::Perldl2 (and then wait for Moose et al to get installed). > > Best regards, > Ed > > ________________________________ > From: Jörg Sommrey <jo...@so...> > Sent: 22 January 2025 14:30 > To: Luis Mochan <mo...@ic...> > Cc: Ed . <ej...@ho...>; perldl > <pdl...@li...>; perldl > <pdl...@li...> > Subject: Re: [Pdl-devel] pdl scripts > > Hi Luis, > > you might try 'pdl2' instead of 'pdl'. The latter doesn't work for me > neither after upgrading PDL lately. > Just a guess. > > -jo > > On Wed 22 Jan 2025 04:46:09 AM CET, Luis Mochan <mo...@ic...> wrote: > >> Hi Ed, >> >> Maybe I didn't explain the issue, maybe I don't quite understand >> it. And maybe I didn't quite understand your answer: >> >> 1. I made a new account in my laptop >> 2. I installed perlbrew >> 3. I installed perl-5.40.1 >> 4. In installed cpanm >> 5. I installed PDL with cpanm >> 6. I ran pdl >> 7. I obtained the answer: >> >> perlDL shell v1.357 >> PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file >> 'COPYING' in the PDL distribution. This is free software and you >> are welcome to redistribute it under certain conditions, see >> the same file for details. >> ReadLines, NiceSlice, MultiLines enabled >> Reading PDL/default.perldlrc... >> * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in >> @INC (you may need to install the Term::ReadKey module) (@INC >> entries checked: >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> Compilation failed in require at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> Compilation failed in require at (eval 13) line 1. >> ' - trying blib. >> WARNING: PDL startup not found only plain perl available >> >> Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) >> ** perl> >> >> The line marked with an * above says: 'WARNING: Error loading PDL: >> 'Can't locate Term/ReadKey.pm in @INC (you may need to install the >> Term::ReadKey module)...' >> >> So it is not that I (or my students) care about Term::ReadKey, it is >> that the advice we got is that we'd better install it. >> >> Also, the line marked with ** shows we obtained the prompt 'perl>' >> instead of the expected prompt 'pdl>'. >> >> In my previous installations, I hadn't had this problem, as I >> installed manually many required and optional pre-requisites, >> including Term::ReadLine::Gnu, which I guess is the readline you >> mention in your answer. However, installing Term::Readline::Gnu didn't >> help with the problem above. I obtained again: >> >> $ pdl >> perlDL shell v1.357 >> PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file >> 'COPYING' in the PDL distribution. This is free software and you >> are welcome to redistribute it under certain conditions, see >> the same file for details. >> ReadLines, NiceSlice, MultiLines enabled >> Reading PDL/default.perldlrc... >> WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in >> @INC (you may need to install the Term::ReadKey module) (@INC >> entries checked: >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> Compilation failed in require at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> Compilation failed in require at (eval 11) line 1. >> ' - trying blib. >> WARNING: PDL startup not found only plain perl available >> >> Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) >> >> perl> >> >> But after installing ReadKey things started behaving as usual: >> >> $ cpanm Term::ReadKey >> --> Working on Term::ReadKey >> Fetching >> http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz >> ... OK >> Configuring TermReadKey-2.38 ... OK >> Building and testing TermReadKey-2.38 ... OK >> Successfully installed TermReadKey-2.38 >> 1 distribution installed >> $ pdl >> perlDL shell v1.357 >> PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file >> 'COPYING' in the PDL distribution. This is free software and you >> are welcome to redistribute it under certain conditions, see >> the same file for details. >> ReadLines, NiceSlice, MultiLines enabled >> Reading PDL/default.perldlrc... >> Found docs database >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db >> Type 'help' for online help >> Type 'demo' for online demos >> Loaded PDL v2.098 (supports bad values) >> >> Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) >> >> pdl> >> >> So, what is the user expected to do? The installation of PDL was declared >> succesful, a program ('pdl') distributed with PDL was installed, the >> program didn't run smoothly and sent error messages asking the user to >> install another package: Term::ReadKey. How would you interpret this >> situation as a new user? Wouldn't you be confused? Wouldn't you >> conclude there is something wrong? >> >> I don't know what is the correct solution. I suggested adding >> Term::ReadKey to the required packages, so it would be installed >> automatically. Maybe that is not the correct solution, but then, I >> don't know, what would be the correct solution? >> >> Best regards, >> Luis >> >> >> >> >> On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: >>> Hi Luis, >>> >>> PDL isn't just an interactive environment. "Required" would be >>> wrong. I use the interactive part very heavily (which isn't very >>> surprising), and wouldn't want to use it without readline (which I >>> have faced when debugging in a qemu environment on a weird >>> architecture). I am not going to make any of the Term::* be >>> "required" for PDL. I hope you understand. >>> >>> If it helps, the REPL script was installed, but not all of the >>> components. It does sound like you're asking me to make a separate >>> PDL::REPL repo where that stuff would live, but I don't want to do >>> that. >>> >>> Best regards, >>> Ed >>> >>> ________________________________ >>> From: Luis Mochan <mo...@ic...> >>> Sent: 21 January 2025 20:07 >>> To: Ed . <ej...@ho...> >>> Cc: perldl <pdl...@li...>; perldl >>> <pdl...@li...> >>> Subject: Re: [Pdl-devel] pdl scripts >>> >>> Hi Ed, >>> >>> On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: >>> > Hi Luis, >>> > >>> > That's a really good question! >>> > >>> > PDL's "requirements" (when you say e.g. cpanm PDL) are hard >>> requirements for PDL to run: largely File::Map and File::Which. >>> CPAN has a mechanism to "recommend" other modules, including >>> Term::ReadKey. It has done so for a long time. cpanm can be told to >>> install recommended modules. >>> >>> The doubt I have now is, should Term::ReadKey be recommended or should >>> it be required? The problem is that the repl's were installed, but >>> they didn't work without it. >>> >>> > The demos will be sparse... >>> >>> Ok, thanks. I'll pass that info to the students. >>> >>> Regards, >>> Luis >>> >>> -- >>> >>> o >>> W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) >>> Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ >>> Av. Universidad s/n CP 62210 | (*)/\/ \ >>> Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ >>> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Ed . <ej...@ho...> - 2025-01-22 14:55:29
|
Hi Jörg, Can you please spell out what happens when you run "pdl" (which is the compiled C executable that runs perldl)? It's supposed to work. pdl2 won't work "out of the box", since it got removed due to its very heavy dependencies. To run that now, you'll need to do cpanm PDL::Perldl2 (and then wait for Moose et al to get installed). Best regards, Ed ________________________________ From: Jörg Sommrey <jo...@so...> Sent: 22 January 2025 14:30 To: Luis Mochan <mo...@ic...> Cc: Ed . <ej...@ho...>; perldl <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] pdl scripts Hi Luis, you might try 'pdl2' instead of 'pdl'. The latter doesn't work for me neither after upgrading PDL lately. Just a guess. -jo On Wed 22 Jan 2025 04:46:09 AM CET, Luis Mochan <mo...@ic...> wrote: > Hi Ed, > > Maybe I didn't explain the issue, maybe I don't quite understand > it. And maybe I didn't quite understand your answer: > > 1. I made a new account in my laptop > 2. I installed perlbrew > 3. I installed perl-5.40.1 > 4. In installed cpanm > 5. I installed PDL with cpanm > 6. I ran pdl > 7. I obtained the answer: > > perlDL shell v1.357 > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > 'COPYING' in the PDL distribution. This is free software and you > are welcome to redistribute it under certain conditions, see > the same file for details. > ReadLines, NiceSlice, MultiLines enabled > Reading PDL/default.perldlrc... > * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in > @INC (you may need to install the Term::ReadKey module) (@INC > entries checked: > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > Compilation failed in require at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > Compilation failed in require at (eval 13) line 1. > ' - trying blib. > WARNING: PDL startup not found only plain perl available > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > ** perl> > > The line marked with an * above says: 'WARNING: Error loading PDL: > 'Can't locate Term/ReadKey.pm in @INC (you may need to install the > Term::ReadKey module)...' > > So it is not that I (or my students) care about Term::ReadKey, it is > that the advice we got is that we'd better install it. > > Also, the line marked with ** shows we obtained the prompt 'perl>' > instead of the expected prompt 'pdl>'. > > In my previous installations, I hadn't had this problem, as I > installed manually many required and optional pre-requisites, > including Term::ReadLine::Gnu, which I guess is the readline you > mention in your answer. However, installing Term::Readline::Gnu didn't > help with the problem above. I obtained again: > > $ pdl > perlDL shell v1.357 > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > 'COPYING' in the PDL distribution. This is free software and you > are welcome to redistribute it under certain conditions, see > the same file for details. > ReadLines, NiceSlice, MultiLines enabled > Reading PDL/default.perldlrc... > WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in > @INC (you may need to install the Term::ReadKey module) (@INC > entries checked: > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > Compilation failed in require at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > Compilation failed in require at (eval 11) line 1. > ' - trying blib. > WARNING: PDL startup not found only plain perl available > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > perl> > > But after installing ReadKey things started behaving as usual: > > $ cpanm Term::ReadKey > --> Working on Term::ReadKey > Fetching > http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz > ... OK > Configuring TermReadKey-2.38 ... OK > Building and testing TermReadKey-2.38 ... OK > Successfully installed TermReadKey-2.38 > 1 distribution installed > $ pdl > perlDL shell v1.357 > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > 'COPYING' in the PDL distribution. This is free software and you > are welcome to redistribute it under certain conditions, see > the same file for details. > ReadLines, NiceSlice, MultiLines enabled > Reading PDL/default.perldlrc... > Found docs database > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db > Type 'help' for online help > Type 'demo' for online demos > Loaded PDL v2.098 (supports bad values) > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > pdl> > > So, what is the user expected to do? The installation of PDL was declared > succesful, a program ('pdl') distributed with PDL was installed, the > program didn't run smoothly and sent error messages asking the user to > install another package: Term::ReadKey. How would you interpret this > situation as a new user? Wouldn't you be confused? Wouldn't you > conclude there is something wrong? > > I don't know what is the correct solution. I suggested adding > Term::ReadKey to the required packages, so it would be installed > automatically. Maybe that is not the correct solution, but then, I > don't know, what would be the correct solution? > > Best regards, > Luis > > > > > On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: >> Hi Luis, >> >> PDL isn't just an interactive environment. "Required" would be >> wrong. I use the interactive part very heavily (which isn't very >> surprising), and wouldn't want to use it without readline (which I >> have faced when debugging in a qemu environment on a weird >> architecture). I am not going to make any of the Term::* be >> "required" for PDL. I hope you understand. >> >> If it helps, the REPL script was installed, but not all of the >> components. It does sound like you're asking me to make a separate >> PDL::REPL repo where that stuff would live, but I don't want to do >> that. >> >> Best regards, >> Ed >> >> ________________________________ >> From: Luis Mochan <mo...@ic...> >> Sent: 21 January 2025 20:07 >> To: Ed . <ej...@ho...> >> Cc: perldl <pdl...@li...>; perldl >> <pdl...@li...> >> Subject: Re: [Pdl-devel] pdl scripts >> >> Hi Ed, >> >> On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: >> > Hi Luis, >> > >> > That's a really good question! >> > >> > PDL's "requirements" (when you say e.g. cpanm PDL) are hard >> requirements for PDL to run: largely File::Map and File::Which. >> CPAN has a mechanism to "recommend" other modules, including >> Term::ReadKey. It has done so for a long time. cpanm can be told to >> install recommended modules. >> >> The doubt I have now is, should Term::ReadKey be recommended or should >> it be required? The problem is that the repl's were installed, but >> they didn't work without it. >> >> > The demos will be sparse... >> >> Ok, thanks. I'll pass that info to the students. >> >> Regards, >> Luis >> >> -- >> >> o >> W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) >> Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ >> Av. Universidad s/n CP 62210 | (*)/\/ \ >> Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ >> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Jörg S. <jo...@so...> - 2025-01-22 14:52:46
|
Hi Luis, you might try 'pdl2' instead of 'pdl'. The latter doesn't work for me neither after upgrading PDL lately. Just a guess. -jo On Wed 22 Jan 2025 04:46:09 AM CET, Luis Mochan <mo...@ic...> wrote: > Hi Ed, > > Maybe I didn't explain the issue, maybe I don't quite understand > it. And maybe I didn't quite understand your answer: > > 1. I made a new account in my laptop > 2. I installed perlbrew > 3. I installed perl-5.40.1 > 4. In installed cpanm > 5. I installed PDL with cpanm > 6. I ran pdl > 7. I obtained the answer: > > perlDL shell v1.357 > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > 'COPYING' in the PDL distribution. This is free software and you > are welcome to redistribute it under certain conditions, see > the same file for details. > ReadLines, NiceSlice, MultiLines enabled > Reading PDL/default.perldlrc... > * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in > @INC (you may need to install the Term::ReadKey module) (@INC > entries checked: > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > Compilation failed in require at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > Compilation failed in require at (eval 13) line 1. > ' - trying blib. > WARNING: PDL startup not found only plain perl available > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > ** perl> > > The line marked with an * above says: 'WARNING: Error loading PDL: > 'Can't locate Term/ReadKey.pm in @INC (you may need to install the > Term::ReadKey module)...' > > So it is not that I (or my students) care about Term::ReadKey, it is > that the advice we got is that we'd better install it. > > Also, the line marked with ** shows we obtained the prompt 'perl>' > instead of the expected prompt 'pdl>'. > > In my previous installations, I hadn't had this problem, as I > installed manually many required and optional pre-requisites, > including Term::ReadLine::Gnu, which I guess is the readline you > mention in your answer. However, installing Term::Readline::Gnu didn't > help with the problem above. I obtained again: > > $ pdl > perlDL shell v1.357 > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > 'COPYING' in the PDL distribution. This is free software and you > are welcome to redistribute it under certain conditions, see > the same file for details. > ReadLines, NiceSlice, MultiLines enabled > Reading PDL/default.perldlrc... > WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in > @INC (you may need to install the Term::ReadKey module) (@INC > entries checked: > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line > 52. > Compilation failed in require at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > BEGIN failed--compilation aborted at > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line > 37. > Compilation failed in require at (eval 11) line 1. > ' - trying blib. > WARNING: PDL startup not found only plain perl available > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > perl> > > But after installing ReadKey things started behaving as usual: > > $ cpanm Term::ReadKey > --> Working on Term::ReadKey > Fetching > http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz > ... OK > Configuring TermReadKey-2.38 ... OK > Building and testing TermReadKey-2.38 ... OK > Successfully installed TermReadKey-2.38 > 1 distribution installed > $ pdl > perlDL shell v1.357 > PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file > 'COPYING' in the PDL distribution. This is free software and you > are welcome to redistribute it under certain conditions, see > the same file for details. > ReadLines, NiceSlice, MultiLines enabled > Reading PDL/default.perldlrc... > Found docs database > /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db > Type 'help' for online help > Type 'demo' for online demos > Loaded PDL v2.098 (supports bad values) > > Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) > > pdl> > > So, what is the user expected to do? The installation of PDL was declared > succesful, a program ('pdl') distributed with PDL was installed, the > program didn't run smoothly and sent error messages asking the user to > install another package: Term::ReadKey. How would you interpret this > situation as a new user? Wouldn't you be confused? Wouldn't you > conclude there is something wrong? > > I don't know what is the correct solution. I suggested adding > Term::ReadKey to the required packages, so it would be installed > automatically. Maybe that is not the correct solution, but then, I > don't know, what would be the correct solution? > > Best regards, > Luis > > > > > On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: >> Hi Luis, >> >> PDL isn't just an interactive environment. "Required" would be >> wrong. I use the interactive part very heavily (which isn't very >> surprising), and wouldn't want to use it without readline (which I >> have faced when debugging in a qemu environment on a weird >> architecture). I am not going to make any of the Term::* be >> "required" for PDL. I hope you understand. >> >> If it helps, the REPL script was installed, but not all of the >> components. It does sound like you're asking me to make a separate >> PDL::REPL repo where that stuff would live, but I don't want to do >> that. >> >> Best regards, >> Ed >> >> ________________________________ >> From: Luis Mochan <mo...@ic...> >> Sent: 21 January 2025 20:07 >> To: Ed . <ej...@ho...> >> Cc: perldl <pdl...@li...>; perldl >> <pdl...@li...> >> Subject: Re: [Pdl-devel] pdl scripts >> >> Hi Ed, >> >> On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: >> > Hi Luis, >> > >> > That's a really good question! >> > >> > PDL's "requirements" (when you say e.g. cpanm PDL) are hard >> requirements for PDL to run: largely File::Map and File::Which. >> CPAN has a mechanism to "recommend" other modules, including >> Term::ReadKey. It has done so for a long time. cpanm can be told to >> install recommended modules. >> >> The doubt I have now is, should Term::ReadKey be recommended or should >> it be required? The problem is that the repl's were installed, but >> they didn't work without it. >> >> > The demos will be sparse... >> >> Ok, thanks. I'll pass that info to the students. >> >> Regards, >> Luis >> >> -- >> >> o >> W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) >> Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ >> Av. Universidad s/n CP 62210 | (*)/\/ \ >> Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ >> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Ed . <ej...@ho...> - 2025-01-22 14:50:56
|
Hi Luis, The suggestion I made in my first reply: "cpanm can be told to install recommended modules" is the one I am still making. Please install PDL with `cpanm --with-suggests` (the "suggests" will also bring in Sys::SigAction which means you can use ctrl-C to abort a partly typed-in command, which I find very handy). Clearly, perldl should give a better error message than the one it does now, which is very misleading - it says it couldn't load "PDL", but that's not correct. I've just pushed a commit to master that makes it tolerate T:RK not being there - it was being used only for apropos and a couple of other places to get the screen width. Best regards, Ed ________________________________ From: Luis Mochan <mo...@ic...> Sent: 22 January 2025 03:46 To: Ed . <ej...@ho...> Cc: perldl <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] pdl scripts Hi Ed, Maybe I didn't explain the issue, maybe I don't quite understand it. And maybe I didn't quite understand your answer: 1. I made a new account in my laptop 2. I installed perlbrew 3. I installed perl-5.40.1 4. In installed cpanm 5. I installed PDL with cpanm 6. I ran pdl 7. I obtained the answer: perlDL shell v1.357 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. This is free software and you are welcome to redistribute it under certain conditions, see the same file for details. ReadLines, NiceSlice, MultiLines enabled Reading PDL/default.perldlrc... * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module) (@INC entries checked: /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. Compilation failed in require at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. Compilation failed in require at (eval 13) line 1. ' - trying blib. WARNING: PDL startup not found only plain perl available Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) ** perl> The line marked with an * above says: 'WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module)...' So it is not that I (or my students) care about Term::ReadKey, it is that the advice we got is that we'd better install it. Also, the line marked with ** shows we obtained the prompt 'perl>' instead of the expected prompt 'pdl>'. In my previous installations, I hadn't had this problem, as I installed manually many required and optional pre-requisites, including Term::ReadLine::Gnu, which I guess is the readline you mention in your answer. However, installing Term::Readline::Gnu didn't help with the problem above. I obtained again: $ pdl perlDL shell v1.357 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. This is free software and you are welcome to redistribute it under certain conditions, see the same file for details. ReadLines, NiceSlice, MultiLines enabled Reading PDL/default.perldlrc... WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module) (@INC entries checked: /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. Compilation failed in require at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. Compilation failed in require at (eval 11) line 1. ' - trying blib. WARNING: PDL startup not found only plain perl available Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) perl> But after installing ReadKey things started behaving as usual: $ cpanm Term::ReadKey --> Working on Term::ReadKey Fetching http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz ... OK Configuring TermReadKey-2.38 ... OK Building and testing TermReadKey-2.38 ... OK Successfully installed TermReadKey-2.38 1 distribution installed $ pdl perlDL shell v1.357 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. This is free software and you are welcome to redistribute it under certain conditions, see the same file for details. ReadLines, NiceSlice, MultiLines enabled Reading PDL/default.perldlrc... Found docs database /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db Type 'help' for online help Type 'demo' for online demos Loaded PDL v2.098 (supports bad values) Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) pdl> So, what is the user expected to do? The installation of PDL was declared succesful, a program ('pdl') distributed with PDL was installed, the program didn't run smoothly and sent error messages asking the user to install another package: Term::ReadKey. How would you interpret this situation as a new user? Wouldn't you be confused? Wouldn't you conclude there is something wrong? I don't know what is the correct solution. I suggested adding Term::ReadKey to the required packages, so it would be installed automatically. Maybe that is not the correct solution, but then, I don't know, what would be the correct solution? Best regards, Luis On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: > Hi Luis, > > PDL isn't just an interactive environment. "Required" would be wrong. I use the interactive part very heavily (which isn't very surprising), and wouldn't want to use it without readline (which I have faced when debugging in a qemu environment on a weird architecture). I am not going to make any of the Term::* be "required" for PDL. I hope you understand. > > If it helps, the REPL script was installed, but not all of the components. It does sound like you're asking me to make a separate PDL::REPL repo where that stuff would live, but I don't want to do that. > > Best regards, > Ed > > ________________________________ > From: Luis Mochan <mo...@ic...> > Sent: 21 January 2025 20:07 > To: Ed . <ej...@ho...> > Cc: perldl <pdl...@li...>; perldl <pdl...@li...> > Subject: Re: [Pdl-devel] pdl scripts > > Hi Ed, > > On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: > > Hi Luis, > > > > That's a really good question! > > > > PDL's "requirements" (when you say e.g. cpanm PDL) are hard requirements for PDL to run: largely File::Map and File::Which. CPAN has a mechanism to "recommend" other modules, including Term::ReadKey. It has done so for a long time. cpanm can be told to install recommended modules. > > The doubt I have now is, should Term::ReadKey be recommended or should > it be required? The problem is that the repl's were installed, but > they didn't work without it. > > > The demos will be sparse... > > Ok, thanks. I'll pass that info to the students. > > Regards, > Luis > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Av. Universidad s/n CP 62210 | (*)/\/ \ > Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Luis M. <mo...@ic...> - 2025-01-22 03:46:19
|
Hi Ed, Maybe I didn't explain the issue, maybe I don't quite understand it. And maybe I didn't quite understand your answer: 1. I made a new account in my laptop 2. I installed perlbrew 3. I installed perl-5.40.1 4. In installed cpanm 5. I installed PDL with cpanm 6. I ran pdl 7. I obtained the answer: perlDL shell v1.357 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. This is free software and you are welcome to redistribute it under certain conditions, see the same file for details. ReadLines, NiceSlice, MultiLines enabled Reading PDL/default.perldlrc... * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module) (@INC entries checked: /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. Compilation failed in require at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. Compilation failed in require at (eval 13) line 1. ' - trying blib. WARNING: PDL startup not found only plain perl available Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) ** perl> The line marked with an * above says: 'WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module)...' So it is not that I (or my students) care about Term::ReadKey, it is that the advice we got is that we'd better install it. Also, the line marked with ** shows we obtained the prompt 'perl>' instead of the expected prompt 'pdl>'. In my previous installations, I hadn't had this problem, as I installed manually many required and optional pre-requisites, including Term::ReadLine::Gnu, which I guess is the readline you mention in your answer. However, installing Term::Readline::Gnu didn't help with the problem above. I obtained again: $ pdl perlDL shell v1.357 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. This is free software and you are welcome to redistribute it under certain conditions, see the same file for details. ReadLines, NiceSlice, MultiLines enabled Reading PDL/default.perldlrc... WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module) (@INC entries checked: /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm line 52. Compilation failed in require at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. BEGIN failed--compilation aborted at /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc line 37. Compilation failed in require at (eval 11) line 1. ' - trying blib. WARNING: PDL startup not found only plain perl available Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) perl> But after installing ReadKey things started behaving as usual: $ cpanm Term::ReadKey --> Working on Term::ReadKey Fetching http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz ... OK Configuring TermReadKey-2.38 ... OK Building and testing TermReadKey-2.38 ... OK Successfully installed TermReadKey-2.38 1 distribution installed $ pdl perlDL shell v1.357 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. This is free software and you are welcome to redistribute it under certain conditions, see the same file for details. ReadLines, NiceSlice, MultiLines enabled Reading PDL/default.perldlrc... Found docs database /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db Type 'help' for online help Type 'demo' for online demos Loaded PDL v2.098 (supports bad values) Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) pdl> So, what is the user expected to do? The installation of PDL was declared succesful, a program ('pdl') distributed with PDL was installed, the program didn't run smoothly and sent error messages asking the user to install another package: Term::ReadKey. How would you interpret this situation as a new user? Wouldn't you be confused? Wouldn't you conclude there is something wrong? I don't know what is the correct solution. I suggested adding Term::ReadKey to the required packages, so it would be installed automatically. Maybe that is not the correct solution, but then, I don't know, what would be the correct solution? Best regards, Luis On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: > Hi Luis, > > PDL isn't just an interactive environment. "Required" would be wrong. I use the interactive part very heavily (which isn't very surprising), and wouldn't want to use it without readline (which I have faced when debugging in a qemu environment on a weird architecture). I am not going to make any of the Term::* be "required" for PDL. I hope you understand. > > If it helps, the REPL script was installed, but not all of the components. It does sound like you're asking me to make a separate PDL::REPL repo where that stuff would live, but I don't want to do that. > > Best regards, > Ed > > ________________________________ > From: Luis Mochan <mo...@ic...> > Sent: 21 January 2025 20:07 > To: Ed . <ej...@ho...> > Cc: perldl <pdl...@li...>; perldl <pdl...@li...> > Subject: Re: [Pdl-devel] pdl scripts > > Hi Ed, > > On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: > > Hi Luis, > > > > That's a really good question! > > > > PDL's "requirements" (when you say e.g. cpanm PDL) are hard requirements for PDL to run: largely File::Map and File::Which. CPAN has a mechanism to "recommend" other modules, including Term::ReadKey. It has done so for a long time. cpanm can be told to install recommended modules. > > The doubt I have now is, should Term::ReadKey be recommended or should > it be required? The problem is that the repl's were installed, but > they didn't work without it. > > > The demos will be sparse... > > Ok, thanks. I'll pass that info to the students. > > Regards, > Luis > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Av. Universidad s/n CP 62210 | (*)/\/ \ > Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Guillermo P. O. <go...@ex...> - 2025-01-21 23:35:47
|
Hi Ed, yes, just I was trying with where_both But I get unexpected behaviour for me in 2D case 1) first in 1D pdl> $r=zeroes(3)->ndcoords/2-pdl(0.5) pdl> p $r [ [-0.5] [ 0] [ 0.5] ] pdl> ($r1,$r2)=where_both($r,$r->abs < 0.2) pdl> p $r1 [0] pdl> p $r2 [-0.5 0.5] now, trying to modify $r following that condition pdl> $r1.=$r1+1 pdl> $r2.=$r2+3 pdl> p $r [ [2.5] [ 1] [3.5] ] But this seem did not work for complex number pdl> $r1.=$r1*(1+i) pdl> $r2.=$r2-(1+i) pdl> p $r [ [1.5] [ 1] [2.5] ] And, seem did not work in 2D for real case neither pdl> $r=zeroes(3,3)->ndcoords/2-pdl(0.5,0.5) pdl> p $r [ [ [-0.5 -0.5] [ 0 -0.5] [ 0.5 -0.5] ] [ [-0.5 0] [ 0 0] [ 0.5 0] ] [ [-0.5 0.5] [ 0 0.5] [ 0.5 0.5] ] ] pdl> ($r1,$r2)=where_both($r,($r**2)->sumover->sqrt < 0.2) pdl> p $r1 [0.5] pdl> p $r2 [-0.5 -0.5 0 -0.5 -0.5 -0.5 0 0] what I doing wrong here? Regards El mar., 21 de enero de 2025 19:42, Ed . <ej...@ho...> escribió: > Hi Guillermo, > > That does feel to me like you'd want to *not* do something on the whole > ndarray, but instead do something on a $pdl->where(condition...). What do > you think? > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 21 January 2025 19:07 > *To:* Ed . <ej...@ho...> > *Cc:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* Re: [Pdl-devel] conditional inline > > For instance, I am trying with $r, like below > > $r=(zeroes(2*$N+1,2*$N+1)->ndcoords-pdl($N,$N))/(2*$N+1) > > Regards > > El mar, 21 ene 2025 a las 14:39, Guillermo P. Ortiz (< > go...@ex...>) escribió: > > Yes Ed, you are right. > I want to perform different operations on $r > depending on its distance to a point $r0 in 2D. > Then, I guess that first, and because for further > manipulation, I decide to center $r-=$r0 in > such a point. > > Then in false code, > > if ( length ($r) < $a) > { return f($r)} > else > { return g($r) } > > where "length" I am not sure, but it could be inner($r,$r)->sqrt. > Maybe no ternary expression but some subroutine will be fine also. > > Regards > > > > > > > > > > > > > El mar, 21 ene 2025 a las 14:16, Ed . (<ej...@ho...>) escribió: > > Hi Guillermo, > > That conditional will, for the case you've given, always be false, because > it has values more than 0.2 away from 0.5. When you use all, you are > asking a question about the entire ndarray, in other words for every single > value in it. > > I believe that there's some real problem you're trying to solve, but I'm > afraid I still have absolutely no idea what it is. Please help me help you! > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 21 January 2025 01:19 > *To:* Ed . <ej...@ho...> > *Cc:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* Re: [Pdl-devel] conditional inline > > Ok, Ed, > That example did not work for me. > The conditional results seems to be allways false. I mean, that it give $x > also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 result. > > Regates > > > > El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...> escribió: > > Hi Guillermo, > > You may still be having a problem, but you have yet to tell us what it is. > The code you sent works fine, including as many dimensions as you like > (because all acts on the whole ndarray at once). > > If there's a problem in there, please share it :-) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 23:35 > *To:* Ed . <ej...@ho...> > *Cc:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* Re: [Pdl-devel] conditional inline > > Thanks Ed, > Using ternary conditional expression > I still have some problem with múltiple disensión case. > See my example in message befare > > > El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: > > Hi Guillermo, > > You can do that indeed, that's just Perl. If you wanted to do operations > on a subset of that ndarray, then you'd do e.g. > > $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; > > An observation is that the above condition could be a bit shorter by using > the recently-added approx_artol: (which would also mean it ran quicker) > > $pdl->approx_artol(0.5, 0.2) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 19:39 > *To:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* [Pdl-devel] conditional inline > > Hello ! > > I am not sure, but maybe It is possible to do with perl PDL something > like this? > > $ndarray= condition on $ndarray ? assign when true : assign when false > > for example: > > $x=zeroes(20)->xlinvals(0,1); > > $y=(all abs($x-0.5)<0.2)?$x**2:$x; > > Thanks in advance > > Regards > > -- > > > Dr. Guillermo P. Ortiz > Electromagnetismo Aplicado > Dto. Física, Facultad de Ciencias Exactas > Universidad Nacional del Nordeste > Avda Libertad 5460 > <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, > Campus UNNE. > W3404AAS Corrientes, Argentina. > (+54) 379-4424678 interno 4613 > gortiz* at *unne edu ar > > |
From: Ed . <ej...@ho...> - 2025-01-21 22:43:08
|
Hi Guillermo, That does feel to me like you'd want to not do something on the whole ndarray, but instead do something on a $pdl->where(condition...). What do you think? Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...> Sent: 21 January 2025 19:07 To: Ed . <ej...@ho...> Cc: pdl...@li... <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] conditional inline For instance, I am trying with $r, like below $r=(zeroes(2*$N+1,2*$N+1)->ndcoords-pdl($N,$N))/(2*$N+1) Regards El mar, 21 ene 2025 a las 14:39, Guillermo P. Ortiz (<go...@ex...<mailto:go...@ex...>>) escribió: Yes Ed, you are right. I want to perform different operations on $r depending on its distance to a point $r0 in 2D. Then, I guess that first, and because for further manipulation, I decide to center $r-=$r0 in such a point. Then in false code, if ( length ($r) < $a) { return f($r)} else { return g($r) } where "length" I am not sure, but it could be inner($r,$r)->sqrt. Maybe no ternary expression but some subroutine will be fine also. Regards El mar, 21 ene 2025 a las 14:16, Ed . (<ej...@ho...<mailto:ej...@ho...>>) escribió: Hi Guillermo, That conditional will, for the case you've given, always be false, because it has values more than 0.2 away from 0.5. When you use all, you are asking a question about the entire ndarray, in other words for every single value in it. I believe that there's some real problem you're trying to solve, but I'm afraid I still have absolutely no idea what it is. Please help me help you! Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...<mailto:go...@ex...>> Sent: 21 January 2025 01:19 To: Ed . <ej...@ho...<mailto:ej...@ho...>> Cc: pdl...@li...<mailto:pdl...@li...> <pdl...@li...<mailto:pdl...@li...>>; perldl <pdl...@li...<mailto:pdl...@li...>> Subject: Re: [Pdl-devel] conditional inline Ok, Ed, That example did not work for me. The conditional results seems to be allways false. I mean, that it give $x also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 result. Regates El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...<mailto:ej...@ho...>> escribió: Hi Guillermo, You may still be having a problem, but you have yet to tell us what it is. The code you sent works fine, including as many dimensions as you like (because all acts on the whole ndarray at once). If there's a problem in there, please share it :-) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...<mailto:go...@ex...>> Sent: 20 January 2025 23:35 To: Ed . <ej...@ho...<mailto:ej...@ho...>> Cc: pdl...@li...<mailto:pdl...@li...> <pdl...@li...<mailto:pdl...@li...>>; perldl <pdl...@li...<mailto:pdl...@li...>> Subject: Re: [Pdl-devel] conditional inline Thanks Ed, Using ternary conditional expression I still have some problem with múltiple disensión case. See my example in message befare El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...<mailto:ej...@ho...>> escribió: Hi Guillermo, You can do that indeed, that's just Perl. If you wanted to do operations on a subset of that ndarray, then you'd do e.g. $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; An observation is that the above condition could be a bit shorter by using the recently-added approx_artol: (which would also mean it ran quicker) $pdl->approx_artol(0.5, 0.2) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...<mailto:go...@ex...>> Sent: 20 January 2025 19:39 To: pdl...@li...<mailto:pdl...@li...> <pdl...@li...<mailto:pdl...@li...>>; perldl <pdl...@li...<mailto:pdl...@li...>> Subject: [Pdl-devel] conditional inline Hello ! I am not sure, but maybe It is possible to do with perl PDL something like this? $ndarray= condition on $ndarray ? assign when true : assign when false for example: $x=zeroes(20)->xlinvals(0,1); $y=(all abs($x-0.5)<0.2)?$x**2:$x; Thanks in advance Regards -- Dr. Guillermo P. Ortiz Electromagnetismo Aplicado Dto. Física, Facultad de Ciencias Exactas Universidad Nacional del Nordeste Avda Libertad 5460<https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, Campus UNNE. W3404AAS Corrientes, Argentina. (+54) 379-4424678 interno 4613 gortiz at unne edu ar |
From: Ed . <ej...@ho...> - 2025-01-21 22:40:41
|
Hi Luis, PDL isn't just an interactive environment. "Required" would be wrong. I use the interactive part very heavily (which isn't very surprising), and wouldn't want to use it without readline (which I have faced when debugging in a qemu environment on a weird architecture). I am not going to make any of the Term::* be "required" for PDL. I hope you understand. If it helps, the REPL script was installed, but not all of the components. It does sound like you're asking me to make a separate PDL::REPL repo where that stuff would live, but I don't want to do that. Best regards, Ed ________________________________ From: Luis Mochan <mo...@ic...> Sent: 21 January 2025 20:07 To: Ed . <ej...@ho...> Cc: perldl <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] pdl scripts Hi Ed, On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: > Hi Luis, > > That's a really good question! > > PDL's "requirements" (when you say e.g. cpanm PDL) are hard requirements for PDL to run: largely File::Map and File::Which. CPAN has a mechanism to "recommend" other modules, including Term::ReadKey. It has done so for a long time. cpanm can be told to install recommended modules. The doubt I have now is, should Term::ReadKey be recommended or should it be required? The problem is that the repl's were installed, but they didn't work without it. > The demos will be sparse... Ok, thanks. I'll pass that info to the students. Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Luis M. <mo...@ic...> - 2025-01-21 20:07:17
|
Hi Ed, On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: > Hi Luis, > > That's a really good question! > > PDL's "requirements" (when you say e.g. cpanm PDL) are hard requirements for PDL to run: largely File::Map and File::Which. CPAN has a mechanism to "recommend" other modules, including Term::ReadKey. It has done so for a long time. cpanm can be told to install recommended modules. The doubt I have now is, should Term::ReadKey be recommended or should it be required? The problem is that the repl's were installed, but they didn't work without it. > The demos will be sparse... Ok, thanks. I'll pass that info to the students. Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Guillermo P. O. <go...@ex...> - 2025-01-21 19:07:41
|
For instance, I am trying with $r, like below $r=(zeroes(2*$N+1,2*$N+1)->ndcoords-pdl($N,$N))/(2*$N+1) Regards El mar, 21 ene 2025 a las 14:39, Guillermo P. Ortiz (<go...@ex...>) escribió: > Yes Ed, you are right. > I want to perform different operations on $r > depending on its distance to a point $r0 in 2D. > Then, I guess that first, and because for further > manipulation, I decide to center $r-=$r0 in > such a point. > > Then in false code, > > if ( length ($r) < $a) > { return f($r)} > else > { return g($r) } > > where "length" I am not sure, but it could be inner($r,$r)->sqrt. > Maybe no ternary expression but some subroutine will be fine also. > > Regards > > > > > > > > > > > > > El mar, 21 ene 2025 a las 14:16, Ed . (<ej...@ho...>) escribió: > >> Hi Guillermo, >> >> That conditional will, for the case you've given, always be false, >> because it has values more than 0.2 away from 0.5. When you use all, you >> are asking a question about the entire ndarray, in other words for every >> single value in it. >> >> I believe that there's some real problem you're trying to solve, but I'm >> afraid I still have absolutely no idea what it is. Please help me help you! >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 21 January 2025 01:19 >> *To:* Ed . <ej...@ho...> >> *Cc:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* Re: [Pdl-devel] conditional inline >> >> Ok, Ed, >> That example did not work for me. >> The conditional results seems to be allways false. I mean, that it give >> $x also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 >> result. >> >> Regates >> >> >> >> El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...> escribió: >> >> Hi Guillermo, >> >> You may still be having a problem, but you have yet to tell us what it >> is. The code you sent works fine, including as many dimensions as you like >> (because all acts on the whole ndarray at once). >> >> If there's a problem in there, please share it :-) >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 20 January 2025 23:35 >> *To:* Ed . <ej...@ho...> >> *Cc:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* Re: [Pdl-devel] conditional inline >> >> Thanks Ed, >> Using ternary conditional expression >> I still have some problem with múltiple disensión case. >> See my example in message befare >> >> >> El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: >> >> Hi Guillermo, >> >> You can do that indeed, that's just Perl. If you wanted to do operations >> on a subset of that ndarray, then you'd do e.g. >> >> $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; >> >> An observation is that the above condition could be a bit shorter by >> using the recently-added approx_artol: (which would also mean it ran >> quicker) >> >> $pdl->approx_artol(0.5, 0.2) >> >> Best regards, >> Ed >> >> ------------------------------ >> *From:* Guillermo P. Ortiz <go...@ex...> >> *Sent:* 20 January 2025 19:39 >> *To:* pdl...@li... <pdl...@li...>; >> perldl <pdl...@li...> >> *Subject:* [Pdl-devel] conditional inline >> >> Hello ! >> >> I am not sure, but maybe It is possible to do with perl PDL something >> like this? >> >> $ndarray= condition on $ndarray ? assign when true : assign when false >> >> for example: >> >> $x=zeroes(20)->xlinvals(0,1); >> >> $y=(all abs($x-0.5)<0.2)?$x**2:$x; >> >> Thanks in advance >> >> Regards >> >> -- >> >> >> Dr. Guillermo P. Ortiz >> Electromagnetismo Aplicado >> Dto. Física, Facultad de Ciencias Exactas >> Universidad Nacional del Nordeste >> Avda Libertad 5460 >> <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, >> Campus UNNE. >> W3404AAS Corrientes, Argentina. >> (+54) 379-4424678 interno 4613 >> gortiz* at *unne edu ar >> >> |
From: Guillermo P. O. <go...@ex...> - 2025-01-21 17:39:20
|
Yes Ed, you are right. I want to perform different operations on $r depending on its distance to a point $r0 in 2D. Then, I guess that first, and because for further manipulation, I decide to center $r-=$r0 in such a point. Then in false code, if ( length ($r) < $a) { return f($r)} else { return g($r) } where "length" I am not sure, but it could be inner($r,$r)->sqrt. Maybe no ternary expression but some subroutine will be fine also. Regards El mar, 21 ene 2025 a las 14:16, Ed . (<ej...@ho...>) escribió: > Hi Guillermo, > > That conditional will, for the case you've given, always be false, because > it has values more than 0.2 away from 0.5. When you use all, you are > asking a question about the entire ndarray, in other words for every single > value in it. > > I believe that there's some real problem you're trying to solve, but I'm > afraid I still have absolutely no idea what it is. Please help me help you! > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 21 January 2025 01:19 > *To:* Ed . <ej...@ho...> > *Cc:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* Re: [Pdl-devel] conditional inline > > Ok, Ed, > That example did not work for me. > The conditional results seems to be allways false. I mean, that it give $x > also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 result. > > Regates > > > > El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...> escribió: > > Hi Guillermo, > > You may still be having a problem, but you have yet to tell us what it is. > The code you sent works fine, including as many dimensions as you like > (because all acts on the whole ndarray at once). > > If there's a problem in there, please share it :-) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 23:35 > *To:* Ed . <ej...@ho...> > *Cc:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* Re: [Pdl-devel] conditional inline > > Thanks Ed, > Using ternary conditional expression > I still have some problem with múltiple disensión case. > See my example in message befare > > > El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: > > Hi Guillermo, > > You can do that indeed, that's just Perl. If you wanted to do operations > on a subset of that ndarray, then you'd do e.g. > > $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; > > An observation is that the above condition could be a bit shorter by using > the recently-added approx_artol: (which would also mean it ran quicker) > > $pdl->approx_artol(0.5, 0.2) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 19:39 > *To:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* [Pdl-devel] conditional inline > > Hello ! > > I am not sure, but maybe It is possible to do with perl PDL something > like this? > > $ndarray= condition on $ndarray ? assign when true : assign when false > > for example: > > $x=zeroes(20)->xlinvals(0,1); > > $y=(all abs($x-0.5)<0.2)?$x**2:$x; > > Thanks in advance > > Regards > > -- > > > Dr. Guillermo P. Ortiz > Electromagnetismo Aplicado > Dto. Física, Facultad de Ciencias Exactas > Universidad Nacional del Nordeste > Avda Libertad 5460 > <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, > Campus UNNE. > W3404AAS Corrientes, Argentina. > (+54) 379-4424678 interno 4613 > gortiz* at *unne edu ar > > |
From: Ed . <ej...@ho...> - 2025-01-21 17:16:35
|
Hi Guillermo, That conditional will, for the case you've given, always be false, because it has values more than 0.2 away from 0.5. When you use all, you are asking a question about the entire ndarray, in other words for every single value in it. I believe that there's some real problem you're trying to solve, but I'm afraid I still have absolutely no idea what it is. Please help me help you! Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...> Sent: 21 January 2025 01:19 To: Ed . <ej...@ho...> Cc: pdl...@li... <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] conditional inline Ok, Ed, That example did not work for me. The conditional results seems to be allways false. I mean, that it give $x also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 result. Regates El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...<mailto:ej...@ho...>> escribió: Hi Guillermo, You may still be having a problem, but you have yet to tell us what it is. The code you sent works fine, including as many dimensions as you like (because all acts on the whole ndarray at once). If there's a problem in there, please share it :-) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...<mailto:go...@ex...>> Sent: 20 January 2025 23:35 To: Ed . <ej...@ho...<mailto:ej...@ho...>> Cc: pdl...@li...<mailto:pdl...@li...> <pdl...@li...<mailto:pdl...@li...>>; perldl <pdl...@li...<mailto:pdl...@li...>> Subject: Re: [Pdl-devel] conditional inline Thanks Ed, Using ternary conditional expression I still have some problem with múltiple disensión case. See my example in message befare El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...<mailto:ej...@ho...>> escribió: Hi Guillermo, You can do that indeed, that's just Perl. If you wanted to do operations on a subset of that ndarray, then you'd do e.g. $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; An observation is that the above condition could be a bit shorter by using the recently-added approx_artol: (which would also mean it ran quicker) $pdl->approx_artol(0.5, 0.2) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...<mailto:go...@ex...>> Sent: 20 January 2025 19:39 To: pdl...@li...<mailto:pdl...@li...> <pdl...@li...<mailto:pdl...@li...>>; perldl <pdl...@li...<mailto:pdl...@li...>> Subject: [Pdl-devel] conditional inline Hello ! I am not sure, but maybe It is possible to do with perl PDL something like this? $ndarray= condition on $ndarray ? assign when true : assign when false for example: $x=zeroes(20)->xlinvals(0,1); $y=(all abs($x-0.5)<0.2)?$x**2:$x; Thanks in advance Regards -- Dr. Guillermo P. Ortiz Electromagnetismo Aplicado Dto. Física, Facultad de Ciencias Exactas Universidad Nacional del Nordeste Avda Libertad 5460<https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, Campus UNNE. W3404AAS Corrientes, Argentina. (+54) 379-4424678 interno 4613 gortiz at unne edu ar |
From: Ed . <ej...@ho...> - 2025-01-21 17:13:23
|
Hi Luis, That's a really good question! PDL's "requirements" (when you say e.g. cpanm PDL) are hard requirements for PDL to run: largely File::Map and File::Which. CPAN has a mechanism to "recommend" other modules, including Term::ReadKey. It has done so for a long time. cpanm can be told to install recommended modules. The demos will be sparse until you install things that have demos. Those have sat with their demonstrated things since 2022, with 2.077. You can show off some of the demos by looking at them on the PDL website. You can find all known PDL demos using MetaCPAN: https://metacpan.org/search?size=500&q=pdl%3A%3Ademos One reason I deleted the DEPENDENCIES file was that it was so out of date, because it wasn't maintained. All of the available things that depend on PDL (and therefore are probably what you mean by "subsystems" can be found on MetaCPAN: https://metacpan.org/dist/PDL/requires?size=500 - they each have their dependencies expressed in their metadata, which is visible on the left-hand side of their pages on MetaCPAN (with the exception of PDL::GSL, but I'm hoping users can figure that one out), and PDL::LinearAlgebra. PDL::Modules/Index are indeed for the most part listing things that are in "main" PDL. It would be a bad idea to try to make that list the whole PDL-verse, and instead one should use MetaCPAN as shown. In particular, it's hard to know what to "suggest" in the terms you say - in order to achieve what? Best regards, Ed ________________________________ From: Luis Mochan <mo...@ic...> Sent: 20 January 2025 23:30 To: perldl <pdl...@li...>; perldl <pdl...@li...> Subject: [Pdl-devel] pdl scripts Hello, I started teaching about PDL to some students. The first step is building PDL. When I install PDL in my account in my old laptop, everything runs smoothly, but in order to be illustrative I made a new account for myself and built it there under a perlbrew installation. It was nice that the process went quite smoothly for myself, and also for the students after installing some missing libraries. However, the pdl script failed. Apparently, Term::ReadKey is required but was not installed automatically. I guess it has to be added as a dependency to Makefile.PL, but I'm not sure. Then, the list of demos was short. Running demo from my previous full installation I found a list of dependencies and after installing them, more demos appeared. In the old days there was a DEPENDENCIES or DEPENDENCY file listing all that was needed for the automatic installation of the many PDL subsystems. However, that file is gone. So my question is, how can a user/installer know what are the suggested subsystems to install and what are their dependencies? At least, what are the PDL subsystems that have a demo? There is PDL::Index and PDL::Modules, but it seems they list what is already installed, not what is available. Best regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB _______________________________________________ pdl-devel mailing list pdl...@li... https://lists.sourceforge.net/lists/listinfo/pdl-devel |
From: Luis M. <mo...@ic...> - 2025-01-21 01:47:25
|
Hello, I started teaching about PDL to some students. The first step is building PDL. When I install PDL in my account in my old laptop, everything runs smoothly, but in order to be illustrative I made a new account for myself and built it there under a perlbrew installation. It was nice that the process went quite smoothly for myself, and also for the students after installing some missing libraries. However, the pdl script failed. Apparently, Term::ReadKey is required but was not installed automatically. I guess it has to be added as a dependency to Makefile.PL, but I'm not sure. Then, the list of demos was short. Running demo from my previous full installation I found a list of dependencies and after installing them, more demos appeared. In the old days there was a DEPENDENCIES or DEPENDENCY file listing all that was needed for the automatic installation of the many PDL subsystems. However, that file is gone. So my question is, how can a user/installer know what are the suggested subsystems to install and what are their dependencies? At least, what are the PDL subsystems that have a demo? There is PDL::Index and PDL::Modules, but it seems they list what is already installed, not what is available. Best regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |
From: Guillermo P. O. <go...@ex...> - 2025-01-21 01:19:53
|
Ok, Ed, That example did not work for me. The conditional results seems to be allways false. I mean, that it give $x also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 result. Regates El El lun, 20 ene 2025 a la(s) 20:39, Ed . <ej...@ho...> escribió: > Hi Guillermo, > > You may still be having a problem, but you have yet to tell us what it is. > The code you sent works fine, including as many dimensions as you like > (because all acts on the whole ndarray at once). > > If there's a problem in there, please share it :-) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 23:35 > *To:* Ed . <ej...@ho...> > *Cc:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* Re: [Pdl-devel] conditional inline > > Thanks Ed, > Using ternary conditional expression > I still have some problem with múltiple disensión case. > See my example in message befare > > > El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: > > Hi Guillermo, > > You can do that indeed, that's just Perl. If you wanted to do operations > on a subset of that ndarray, then you'd do e.g. > > $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; > > An observation is that the above condition could be a bit shorter by using > the recently-added approx_artol: (which would also mean it ran quicker) > > $pdl->approx_artol(0.5, 0.2) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 19:39 > *To:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* [Pdl-devel] conditional inline > > Hello ! > > I am not sure, but maybe It is possible to do with perl PDL something > like this? > > $ndarray= condition on $ndarray ? assign when true : assign when false > > for example: > > $x=zeroes(20)->xlinvals(0,1); > > $y=(all abs($x-0.5)<0.2)?$x**2:$x; > > Thanks in advance > > Regards > > -- > > > Dr. Guillermo P. Ortiz > Electromagnetismo Aplicado > Dto. Física, Facultad de Ciencias Exactas > Universidad Nacional del Nordeste > Avda Libertad 5460 > <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, > Campus UNNE. > W3404AAS Corrientes, Argentina. > (+54) 379-4424678 interno 4613 > gortiz* at *unne edu ar > > |
From: Ed . <ej...@ho...> - 2025-01-20 23:39:56
|
Hi Guillermo, You may still be having a problem, but you have yet to tell us what it is. The code you sent works fine, including as many dimensions as you like (because all acts on the whole ndarray at once). If there's a problem in there, please share it :-) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...> Sent: 20 January 2025 23:35 To: Ed . <ej...@ho...> Cc: pdl...@li... <pdl...@li...>; perldl <pdl...@li...> Subject: Re: [Pdl-devel] conditional inline Thanks Ed, Using ternary conditional expression I still have some problem with múltiple disensión case. See my example in message befare El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...<mailto:ej...@ho...>> escribió: Hi Guillermo, You can do that indeed, that's just Perl. If you wanted to do operations on a subset of that ndarray, then you'd do e.g. $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; An observation is that the above condition could be a bit shorter by using the recently-added approx_artol: (which would also mean it ran quicker) $pdl->approx_artol(0.5, 0.2) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...<mailto:go...@ex...>> Sent: 20 January 2025 19:39 To: pdl...@li...<mailto:pdl...@li...> <pdl...@li...<mailto:pdl...@li...>>; perldl <pdl...@li...<mailto:pdl...@li...>> Subject: [Pdl-devel] conditional inline Hello ! I am not sure, but maybe It is possible to do with perl PDL something like this? $ndarray= condition on $ndarray ? assign when true : assign when false for example: $x=zeroes(20)->xlinvals(0,1); $y=(all abs($x-0.5)<0.2)?$x**2:$x; Thanks in advance Regards -- Dr. Guillermo P. Ortiz Electromagnetismo Aplicado Dto. Física, Facultad de Ciencias Exactas Universidad Nacional del Nordeste Avda Libertad 5460<https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, Campus UNNE. W3404AAS Corrientes, Argentina. (+54) 379-4424678 interno 4613 gortiz at unne edu ar |
From: Guillermo P. O. <go...@ex...> - 2025-01-20 23:35:54
|
Thanks Ed, Using ternary conditional expression I still have some problem with múltiple disensión case. See my example in message befare El El lun, 20 ene 2025 a la(s) 19:31, Ed . <ej...@ho...> escribió: > Hi Guillermo, > > You can do that indeed, that's just Perl. If you wanted to do operations > on a subset of that ndarray, then you'd do e.g. > > $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; > > An observation is that the above condition could be a bit shorter by using > the recently-added approx_artol: (which would also mean it ran quicker) > > $pdl->approx_artol(0.5, 0.2) > > Best regards, > Ed > > ------------------------------ > *From:* Guillermo P. Ortiz <go...@ex...> > *Sent:* 20 January 2025 19:39 > *To:* pdl...@li... <pdl...@li...>; > perldl <pdl...@li...> > *Subject:* [Pdl-devel] conditional inline > > Hello ! > > I am not sure, but maybe It is possible to do with perl PDL something > like this? > > $ndarray= condition on $ndarray ? assign when true : assign when false > > for example: > > $x=zeroes(20)->xlinvals(0,1); > > $y=(all abs($x-0.5)<0.2)?$x**2:$x; > > Thanks in advance > > Regards > > -- > > > Dr. Guillermo P. Ortiz > Electromagnetismo Aplicado > Dto. Física, Facultad de Ciencias Exactas > Universidad Nacional del Nordeste > Avda Libertad 5460 > <https://www.google.com/maps/search/Avda+Libertad+5460?entry=gmail&source=g>, > Campus UNNE. > W3404AAS Corrientes, Argentina. > (+54) 379-4424678 interno 4613 > gortiz* at *unne edu ar > |
From: Ed . <ej...@ho...> - 2025-01-20 22:31:54
|
Hi Guillermo, You can do that indeed, that's just Perl. If you wanted to do operations on a subset of that ndarray, then you'd do e.g. $pdl->where(($pdl-0.5)->abs < 0.2) *= 5; An observation is that the above condition could be a bit shorter by using the recently-added approx_artol: (which would also mean it ran quicker) $pdl->approx_artol(0.5, 0.2) Best regards, Ed ________________________________ From: Guillermo P. Ortiz <go...@ex...> Sent: 20 January 2025 19:39 To: pdl...@li... <pdl...@li...>; perldl <pdl...@li...> Subject: [Pdl-devel] conditional inline Hello ! I am not sure, but maybe It is possible to do with perl PDL something like this? $ndarray= condition on $ndarray ? assign when true : assign when false for example: $x=zeroes(20)->xlinvals(0,1); $y=(all abs($x-0.5)<0.2)?$x**2:$x; Thanks in advance Regards -- Dr. Guillermo P. Ortiz Electromagnetismo Aplicado Dto. Física, Facultad de Ciencias Exactas Universidad Nacional del Nordeste Avda Libertad 5460, Campus UNNE. W3404AAS Corrientes, Argentina. (+54) 379-4424678 interno 4613 gortiz at unne edu ar |
From: Guillermo P. O. <go...@ex...> - 2025-01-20 20:01:59
|
Hello ! I am not sure, but maybe It is possible to do with perl PDL something like this? $ndarray= condition on $ndarray ? assign when true : assign when false for example: $x=zeroes(20)->xlinvals(0,1); $y=(all abs($x-0.5)<0.2)?$x**2:$x; Thanks in advance Regards -- Dr. Guillermo P. Ortiz Electromagnetismo Aplicado Dto. Física, Facultad de Ciencias Exactas Universidad Nacional del Nordeste Avda Libertad 5460, Campus UNNE. W3404AAS Corrientes, Argentina. (+54) 379-4424678 interno 4613 gortiz* at *unne edu ar |
From: Luis M. <mo...@ic...> - 2025-01-14 02:04:32
|
Hi Ed, On Mon, Jan 13, 2025 at 07:05:38PM +0000, Ed . wrote: > Glad to hear! By the way, if it's only for the sake of that one function, would you like to add it to PDL::Ops, ideally called sqrt_upper, and with the Pars typespec of !real and complex-only datatypes? If you'd like to PR that, please do, else say and I'll add it myself. I just did. I didn't use the !real typespec, as the input could be any numeric type, though the output is complex. > I don't want to steal your thunder, but it does seem like an actually valuable little utility. I'm glad you find it so. For people that work with wave propagation it is more common to put a constrain on the imaginary part of complex square roots than on their real parts, though the usual library sqrt routines usually return the 'positive' square root, i.e., that with a positive real part. This has been source of headaches for many students and colleagues, and for unexpected unphysical results, such as optical reflectances greater than one, violating energy conservation. > By the way, would you like to also (or separately) PR a doc update to Inline::Pdlpp with how to use it with Inline::Module? Warning, I do think that using pptemplate is just better, but it may as well be there for completeness. I'll try that later. My approach worked but only with Perl < 5.40.0. I read somewhere that many packages have failed after 5.40.0 due to previously tolerated version errors, with messages that resemble what I got, but I didn't find where the error was actually located. Best regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | mo...@fi... /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB |