Code Monkey home page Code Monkey logo

gxpy's Introduction

Geosoft GX for Python Repository

This is the repository for Seequent's Geosoft GX Developer support for Python development. Refer to the documentation for more information.

GX Developer documentation

From release 9.6, tutorials for various subjects are available as Jupyter Notebooks, and are added as subjects are developed. See the following github page for what is currently available:

https://github.com/GeosoftInc/gxpy/tree/master/examples/jupyter_notebooks/Tutorials (Select the branch that matches the GX Developer version you are working with.)

If you are new to GX Developer, refer to the GX Developer tutorial that is documented as part of the 9.3 release.

Python Packages

Also see the Geosoft organization on Github for the other programming language specific repos.

Quick Start

Configuration

See Python Configuration Menu to install a Python menu that simplifies Python configuration for an Oasis montaj installation.

To update an existing Python installation, load the Python menu from your User Menus and select Python > Configure Python... > update geosoft package.

If you encounter problems due to a non-standard installation you can also update Python manually (see below). 

Manual Configuration

Uninstall Geosoft from Python, then install version 2024.1 as follows (you must have the Geosoft Desktop 2024.1 platform installed).

pip uninstall geosoft
pip install geosoft

Or, alternately:

pip install geosoft --upgrade

Version Compatibility

The base GX API, which is exposed to Python by the geosoft.gxapi module, is consistent across versions. This means that earlier versions of geosoft.pxpy will work with Geosoft Desktop 2024.1. While we recommend that older scripts be updated to conform to the 2024.1 API, should you need support for multiple versions of geosoft.gxpy you can create separate Anaconda Python environments for each version. For example, you might create an environment 'py35_gx91' for Python 3.5 and the GX API version 9.1, 'py36_gx92' for Python 3.6 and GX Developer 9.2 and 'py36_gx96' for GX Developer 9.6. If you do not depend on earlier versions of the GX Developer Python API it is best to use only the most recently released API.

Version 2024.1 supports Python 3.8, 3.9, 3.10, 3.11 and 3.12. If you need Python 3.4 support, install geosoft version 9.2.1, which will work with both Geosoft Desktop versions 9.2 and 9.5, but will not contain any methods and classes introduced since version 9.2. If you need Python 3.5 support, install geosoft version 9.5, which will work with both Geosoft Desktop and redistributable versions 9.5 and 9.6, but will not contain any methods and classes introduced since version 9.6.

License

Any source code found here are released under the BSD 2-clause license. Core functionality exposed by the GX API may have additional license implications. For more information consult the License page in the GX Developer Wiki

gxpy's People

Contributors

charlieqc avatar danielhochman4 avatar ericroma avatar geotpop avatar ianneilmacleod avatar serban-seeq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gxpy's Issues

gxpy.vox class based on gxapi.GXVOX.

  • vox and vox_display classes
  • Jupyter notebook example
  • Fix TODO: cell size calculator in gxpy.vox is inconsistent with Geosoft.
  • Pull VOX from master to 9.3.1 branch

GXVOX assert on exit when creating a new vox

Code:

import geosoft.gxpy.gx as gx
import geosoft.gxpy.voxset as gxvox
gx = gx.GXpy()
with gxvox.Voxset.new("test_new", dimension=(35, 50, 12), temp=True) as vox:
    print(vox.nx, vox.ny, vox.nz) # print to show we got here

Call to GXMVU.path_plot() just stops

@jbgeosoft

See commit 6ead822

Seems that an error may be raised but is being lost, or there is something seriously wrong in the API interface. I have run from command line with nosetests test_gdb.py, and in PyCharm and the behaviour is the same. It just stops/exits with no messages at all. GX close is never called, so Python is not exiting normally:

From PyCharm:

GX open
...........
Process finished with exit code 95867

From command line:

C:\Development\github\gxpy\geosoft\gxpy\tests>nosetests test_gdb.py
...........
C:\Development\github\gxpy\geosoft\gxpy\tests>

Weirdness in base.py and pack_map

33991b0
Uncomment line 51 in test_vox_display.py and the test will fail unable to access the geosoft_voxel file. But the next line is fine, and it too access this file, so there is some kind of weirdness in packing the file.

Contour licence error appears as a GXError warning

c:\development\github\gxpy\geosoft\gxapi\GXMVU.py in contour(cls, mview, con, grid)
    610         **License:** `Geosoft End-User License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-GeosoftDesktopLicense>`_
    611         """
--> 612         gxapi_cy.WrapMVU._contour(GXContext._get_tls_geo(), mview, con.encode(), grid.encode())
    613 
    614 

gxapi_cy.pyx in gxapi_cy.WrapMVU._contour()

gxapi_cy.pyx in gxapi_cy._raise_on_gx_errors()

GXError: 23 of the original 39 zones have been removed from the original equal-area ITR because they are redundant. This is usually the result of highly skewed (e.g. single-valued) data.

Add cython support for 2D and 3D data types

In order to support vector voxels I need VV read/write support for GS_FLOAT2D, GS_FLOAT3D, GS_DOUBLE2D, GS_DOUBLE3D. These are missing from the current gxapi_cy_extend.pyx.

I modified the get_array_data_vv(), but we need to extend the GXVV.get_data_np()/set_data_np functions to accept a dimension argument for dimensions 2 and 3 as numpy does not have these vector dtypes.

see also gxpy.utility.gx_dtype_dimension() and dtype_gx_dimension(), which are the utility functions to translate between Geosoft and numpy types with the addition of dimension.

Creating a VOXD in 9.3.1 fails, works in 9.4

import os
import numpy as np
import geosoft.gxapi as gxapi
import geosoft.gxpy as gxpy
import geosoft.gxpy.vox as gxvox

os.environ['GEOSOFT_TEST_MODE'] = '1'
os.environ['GEOSOFT_TESTSYSTEM_MODE'] = '1'

# set to use 9.3.1
os.environ['GX_GEOSOFT_BIN_PATH'] = 'C:\\Program Files\\Geosoft\\Desktop Applications 9\\bin'

# set to use 9.4
# os.environ['GX_GEOSOFT_BIN_PATH'] = 'C:\\Program Files\\Geosoft\\Desktop Applications 9 - Testing\\bin'

gxc = gxpy.gx.GXpy(log=print)
data = np.zeros(3 * 4 * 6).reshape((6, 4, 3))
with gxvox.Vox.new("test_new", data=data, temp=True) as vox:
    gxvoxd = gxapi.GXVOXD.create(vox.gxvox, '', 0, gxapi.rDUMMY)
    gxvoxd = None
  

GVMVU.contour has wrong scale plotting to a 3DV.

a4c64c8

at line 855 in group.py we call GXMVU.contour. For a 2D view the scaling of line detail (thickness, annotation height etc) is as expected. For 3D views the scale is wrong - to my eye it seems stuck at a scale of 1000, which is the default map scale when the "data" view is open. In a 3DV there is only one view, the "3D" view and this is the "data" view. Since the view is open calling GetMapScale will return 1000, which I suspect is the problem. Internally I think it should be getting the scale from the view. Just a thought.

GMSYS has become GM-'GX-SYS'

From Tom: I discovered that a couple of “GM-SYS” entries were replaced by “GM- GXSYS <geosoft.gxapi.GXSYS>” in this file, which I’ve corrected. This seems like it may be a derived file, so I am not sure whether these are the only changes to be made. The history of this file does not show when these changes were made.

Invalid gxapi constant formating

gxapi.IMG_QUERY_rCOMPRESSION_RATIO should be gxapi.IMG_QUERY_COMPRESSION_RATIO. Note the 'r' before COMPRESSION. This is just one example of the problematic pattern in gxapi.

New GXVOX asserts on exit

  • fixed and verified in 9.4
  • verified in 9.3.1 RC
  • update known issues

Code:

import geosoft.gxpy.gx as gx
import geosoft.gxpy.vox as gxvox
import numpy as np
gx = gx.GXpy()
data = np.zeros(3 * 4 * 6).reshape((6, 4, 3))
with gxvox.Vox.new("test_new", data=data, temp=True) as vox:
    print(vox.nx, vox.ny, vox.nz) # print to show we got here

abort_930_126_2017_11_29_07_43_22.log

Assertion when running a test is lost in PyCharm

When Geosoft asserts during a test the program immediately stops, as expected, but the abort log is lost. The PyCharm behaviour does not help identify the source of the bug:

Process finished with exit code 95867

Replaces #41

GMSYS has become GM-'GX-SYS'

From Tom: I discovered that a couple of “GM-SYS” entries were replaced by “GM- GXSYS <geosoft.gxapi.GXSYS>” in this file, which I’ve corrected. This seems like it may be a derived file, so I am not sure whether these are the only changes to be made. The history of this file does not show when these changes were made.

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.