Skip to content

GMT_PAD_DEFAULT doesn't exist in libgmt: Possible upstream GMT_GET_Enum API Change  #222

Description

@akshmakov

Feedback or description of feature requested

After upgrading from gmt 6.0.0_r20005 to 6.0.0_r20469 of upstream trunk gmt library, and every commit since, gmt-python stopped functioning (import fails with CLIB Error). I understand these are development commits, I am maintaining some images with cutting edge builds of gmt for test purposes. I have done due diligence to verify it isn't other incompatabilities, or build errors. This is a change in behavior from previous versions of GMT which I have tested with development versions of gmt-python

It appears an API change may been introduced in r20437. An API Pointer has been added to the function signature, this may contribute to the error. GMT_PAD_DEFAULT was moved from a pre processor constant to enum in Revision 18648 and gmt-python was updated to accommodate this change at some point

Before and after docker images are available. for verification nc5ng/gmt:6.0.0_r20005-python (Functioning) and nc5ng/gmt:6.0.0_r20469-python (Broken). docker hub link

note: these have slightly different versions of gmt-python, but I have downgraded/upgraded to verify and it is not due to gmt-python.

Are you willing to help implement and maintain this bug? Yes if guidance is provided

Full code that generated the error

import gmt

Full error message

/usr/local/lib/python3.5/dist-packages/gmt/__init__.py in <module>()
     26 
     27 # Start our global modern mode session
---> 28 _begin()
     29 # Tell Python to run _end when shutting down
     30 _atexit.register(_end)

/usr/local/lib/python3.5/dist-packages/gmt/session_management.py in begin()
     15     """
     16     prefix = 'gmt-python-session'
---> 17     with LibGMT() as lib:
     18         lib.call_module('begin', prefix)
     19 

/usr/local/lib/python3.5/dist-packages/gmt/clib/core.py in __enter__(self)
    128         Start the GMT session and keep the session argument.
    129         """
--> 130         self.current_session = self.create_session('gmt-python-session')
    131         return self
    132 

/usr/local/lib/python3.5/dist-packages/gmt/clib/core.py in create_session(self, session_name)
    170         # print function.
    171         print_func = None
--> 172         padding = self.get_constant('GMT_PAD_DEFAULT')
    173         session_type = self.get_constant('GMT_SESSION_EXTERNAL')
    174         session = c_create_session(session_name.encode(), padding,

/usr/local/lib/python3.5/dist-packages/gmt/clib/core.py in get_constant(self, name)
    237         if value is None or value == -99999:
    238             raise GMTCLibError(
--> 239                 "Constant '{}' doesn't exits in libgmt.".format(name))
    240 
    241         return value
   GMTCLibError: Constant 'GMT_PAD_DEFAULT' doesn't exits in libgmt.

System information

  • Operating system: Ubuntu 16.04.5 (Docker Image)
  • Python installation (Anaconda, system, ETS): python3 from ubuntu repository
  • Version of GMT: Tested 6.0.0_r20005 (works) and 6.0.0_r20471 (broken) and 6.0.0_r20469 (broken)
  • Version of Python: 3.5.1-3
  • Version of this package: 0.1a3, 0.1a3+112.gefabb47 and `0.1a3+79.gf979f02'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions