-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the gmt.clib package #210
Conversation
Separate the functions for finding libgmt.
I'm still not entirely happy with the virtual file mechanics. It would make a lot more sense for the virtual file to be its own class but that doesn't match with the way GMT does things. For one, it would need the current |
@seisman I made some changes to the |
Should be GMT_IS_OUTPUT instead of GMT_OUTPUT. Also update some docstrings that were missed in the #210 refactor PR.
Should be GMT_IS_OUTPUT instead of GMT_OUTPUT. Also update some docstrings that were missed in the #210 refactor PR.
* Add registration (r) to common options * Set valid GMT data mode as GMT_IS_OUTPUT Should be GMT_IS_OUTPUT instead of GMT_OUTPUT. Also update some docstrings that were missed in the #210 refactor PR. * Simplify grid region extent calculation * Refactor virtualfile_from_grid and dataarray_to_matrix to use accessor * Fix tests where virtual grid had wrong region, registration and gtype * Expect failures from two grdview tests that used wrong coordinate system * Fix test_grdimage_over_dateline by using gridline instead of pixel reg * Flip grid array left right in xarray instead of in numpy * Test with a grid that does not reach the North Pole Values go from latitude 89S to 89N. Avoids the `grdimage [INFORMATION]: 359 (of 361) inconsistent grid values at North pole.` message. * Try just running test_grdimage_over_dateline first before other tests * Say why we need to run test_grdimage_over_dateline before other tests * Register the custom runfirst pytest marker
A much needed refactor of the
gmt.clib
package.LibGMT
toSession
because that is what it actually is (the GMT API session).clib.core
toclib.session
and break upclib.utils
intoclib.loading
(functions for loading libgmt) andclib.conversion
(functions that handle the ctypes conversions from numpy, etc).*_to_vfile
tovirtualfile_from_*
create
anddestroy
methods now set the session pointer (Session.session_pointer
), which simplifies the__enter__
and__exit__
methods.Session.get_constant
is now implemented asSession.__getitem__
so getting a constant is now much shorter:self["GMT_IS_MATRIX"]
.