Coder Social home page Coder Social logo

Comments (6)

jdkloe avatar jdkloe commented on May 22, 2024

I have disabled the inverse hammer projection test in the rpm build for fedora, and after this all remaining tests run fine for rawhide (upcoming fedora 24). This one will have proj version 4.9.2
For fedora 23, which has proj version 4.9.1, there are 2 failing tests related to the hammer projection (both for python2 and python3). See the details in this log file:
https://kojipkgs.fedoraproject.org//work/tasks/1374/12551374/build.log
I guess this also is related to the missing inverse hammer in these proj versions.

The output for the failing tests is:
Trying:
p = Proj(proj='hammer') # hammer proj and inverse
Expecting nothing


File "/builddir/build/BUILDROOT/pyproj-1.9.5.1-1.fc23.x86_64/usr/lib64/python3.4/site-packages/pyproj/init.py", line 324, in pyproj.Proj.new
Failed example:
p = Proj(proj='hammer') # hammer proj and inverse
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.4/doctest.py", line 1318, in run
compileflags, 1), test.globs)
File "<doctest pyproj.Proj.__new
[20]>", line 1, in
p = Proj(proj='hammer') # hammer proj and inverse
File "/builddir/build/BUILDROOT/pyproj-1.9.5.1-1.fc23.x86_64/usr/lib64/python3.4/site-packages/pyproj/init.py", line 355, in new
return _proj.Proj.new(self, projstring)
File "_proj.pyx", line 84, in _proj.Proj.cinit (_proj.c:1156)
raise RuntimeError(pj_strerrno(err))
RuntimeError: b'major axis or radius = 0 or not given'
Trying:
x,y = p(-30,40)
Expecting nothing
ok
Trying:
'x=%12.3f y=%12.3f' % (x,y)
Expecting:
'x=-2711575.083 y= 4395506.619'


File "/builddir/build/BUILDROOT/pyproj-1.9.5.1-1.fc23.x86_64/usr/lib64/python3.4/site-packages/pyproj/init.py", line 326, in pyproj.Proj.new
Failed example:
'x=%12.3f y=%12.3f' % (x,y)
Expected:
'x=-2711575.083 y= 4395506.619'
Got:
'x=16013975.139 y=19338537.497'

from pyproj.

micahcochran avatar micahcochran commented on May 22, 2024

One option would be to move these inverse hammer tests to unittest and skip it the inverse hammer tests when ran like so:
python unittests/test.py --skip-inv-hammer

That would allow package maintainers to be able to ensure the rest of the functionality stays in the package. It would retain the useful unittest.

from pyproj.

jdkloe avatar jdkloe commented on May 22, 2024

Yes, that would be a nice option (if the plan is to move all tests to the unittests anyway).
A more general concern I think is that it seems possible to have undefined inverse projections in proj. I have no detailed knowledge of the proj source code, but if more projections exist without their inverse, then this may trigger the same problem. First step would be to add unittests for all projections, and their inverse I think.

from pyproj.

micahcochran avatar micahcochran commented on May 22, 2024

It appears 21 projections currently in PROJ.4 have no inverse function.

I've used unittests to test that bug fixes remain fixed. Unittest does have the ability to skip test if certain conditions aren't right.

from pyproj.

jdkloe avatar jdkloe commented on May 22, 2024

Yes, and I see devel version of proj has added a check for NULL pointer of P->inv and P->fwd in the source files pj_inv.c and pj_fwd.c. These checks are present in the bundled c-code but not in proj releases 4.9.1 and 4.9.2. This will cause segmentation faults if the pyproj module is build without bundles sources with these proj versions. I just tested, and for example the 'airy' projection also shows this segmentation fault.

from pyproj.

micahcochran avatar micahcochran commented on May 22, 2024

PR #44 was merged, which fixed this issue. The repository no longer has this issue. Closing.

from pyproj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.