Menu

#394 demo cartography fails

normal
closed-fixed
None
5
2015-08-18
2015-08-14
No

Testing the demos in the latest PDL-2.013 release, the cartography demo resulted in a crash.
Investigating, the problem is in the Demos/Cartography_demo.pm file where the map and
graticule are generated/loaded:

### Get the vector coastline map (and a lon/lat grid), and load the Earth
### RGB daytime image -- both of these are built-in to the module. The
### coastline map is a set of (X,Y,Pen) vectors.
$coast = earth_coast() -> glue( 1, graticule(15,1) );
print "Coastline data are a collection of vectors:  ", 
   join("x",$coast->dims),"\n";

Yielding the error:

OOPS!!! Something went wrong, please make a bug report!: PDL: PDL::Primitive::append(a,b,c):
Parameter 'b': Mismatched implicit thread dimension 0: size 3 vs. 2
There are 3 PDLs in the expression; 1 thread dim....

The problem arises because graticule() returns 2 pdls in list context but
one of shape [3,N] for scalar context. Scalar context must be forced for
the thread dimensions to match:

 $coast = earth_coast() -> glue( 1, scalar(graticule(15,1)) );

Discussion

  • Derek Lamb

    Derek Lamb - 2015-08-14

    Serendipitous timing. I just saw my email about this from April, and had JUST figured that the scalar context bit when I saw your post. Good work.

     
  • mohawk

    mohawk - 2015-08-16

    "Milestone: critical"? Does this mean no other progress can happen with PDL until this issue is resolved?

    There needs to be tests of the Demos just like of the substantive code, but more than that; there needs to be the great split so that the cartography stuff is in its own distro and can be fixed and released in its own time.

     
  • mohawk

    mohawk - 2015-08-16

    Further tracking of this issue needs to take place on its Github location: https://github.com/PDLPorters/pdl/issues/137

     
  • Chris Marshall

    Chris Marshall - 2015-08-16
    • Group: critical --> normal
     
  • Derek Lamb

    Derek Lamb - 2015-08-18
    • status: open --> closed-fixed
     

Log in to post a comment.