Code Monkey home page Code Monkey logo

gxpy's Issues

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>

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

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.

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.

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.

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.

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
  

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

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.

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.

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

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

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.