Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^6: Imagecat - show color images in a terminal ('Memoization' for PDL)

by etj (Priest)
on Feb 03, 2024 at 03:36 UTC ( [id://11157493]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Imagecat - show color images in a terminal ('Memoization' for PDL)
in thread Imagecat - show color images in a terminal

Further investigation of what I agree are bugs. I was already aware of issues with dataflow and clump, thanks to the progenitor of PDL, the mighty Karl Glazebrook himself. See https://sourceforge.net/p/pdl/mailman/message/58730063/ for my initial thoughts, though since that email, I've made decent progress in tracking that down, and am just about at the stage where I think I've fixed the 3rd point in my list there (deliberately doing it in that order). That's involved finding subtle behaviours that downstream modules, especially Data::Frame, rely on, but weren't in the main-PDL tests (they are now).

Here is the test I've constructed from your cases above. Interestingly, only the [0,1] case (don't physicalise the clump-ee, and mutate the clump-ee rather than the original) works perfectly, as you note above. Also interestingly, my first go at this using $pdl->flat->unpdl produced different results from $pdl->unpdl.

for ([0,0], [0,1], [1,0], [1,1]) { my ($phys_clump, $mutate_orig) = @$_; my $orig = zeroes 3,2,1; my $clump = $orig->clump(1,2); $clump->make_physvaffine if $phys_clump; ($mutate_orig ? $orig : $clump) .= 3; my $got = $orig->unpdl; is_deeply $got, [[[(3)x3],[(3)x3]]], "phys_clump=$phys_clump mutate_ +orig=$mutate_orig orig" or diag explain $got; $got = $clump->unpdl; is_deeply $got, [[(3)x3],[(3)x3]], "phys_clump=$phys_clump mutate_or +ig=$mutate_orig clump" or diag explain $got; $got = $clump->uniqvec->unpdl; is_deeply $got, [[(3)x3]], "phys_clump=$phys_clump mutate_orig=$muta +te_orig uniqvec" or diag explain $got; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11157493]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2025-07-20 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.