Bug in gxpy.gdb

MarcAVallee Posts: 9 Calcite Rank Badge
edited February 2023 in GeoStudio
I noticed that geosoft.gxpy.gdb.read_line() does not work properly on 9.3. It makes the application crash. I had to revert to 9.2 and everything works properly. I am using Python 3.5.2.


  • IanMacLeod
    IanMacLeod Posts: 382 Fluorite Rank Badge
    edited December 2017
    Hi @MarcVallée , Please send a sample of the code that crashes if you can, and the symptoms of the crash. It would also be useful to have the database in case the problem is related to the database.

    If you (or anyone) needs to debug things like this yourself you might find the gdb tests helpful. All the tests at https://github.com/GeosoftInc/gxpy/blob/9.3/geosoft/gxpy/tests/test_gdb.py pass, and of course must pass for us to release. The tests have very high coverage, but it is possible that a particular database presents a situation we have not foreseen.

    We really do not advise going back to an earlier version as it is better for us to get to the bottom of the issue, and we can likely provide an alternative approach. Once we can duplicate this problem we can fix it, or address the situation and add it to the tests, which improves the API for everyone.

    Note that the benefit of read_line() is that it reads and resamples everything in a line, which may be appropriate for a simple database. There may be a problematic channel, so a better pattern is to read only the channels you want using read_channel() or read_channel_vv().

    Thanks for your help.
    Geosoft logo
  • IanMacLeod
    In case people are following this thread. We have worked with Marc but we cannot yet duplicate his symptom, which occurs when running his script from inside PyCharm. Python exits prematurely reporting an unknown program error.

    Please let us know if you have a similar problem.

    See also: https://github.com/GeosoftInc/gxpy#quick-start for details about updating your Python Geosoft package.
    Geosoft logo
  • MarcAVallee
    Please find below some details about this bug. I am attaching image files of a simple application that mixes matplotlib, filedialog, and geosoft GX, like:

    import sys
    import matplotlib
    from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
    import geosoft.gxpy as gxpy
    import geosoft.gxpy.gdb as gxdb
    from matplotlib.figure import Figure
    import tkinter as Tk
    from tkinter import filedialog

    If I select the geosoft through a menu like:
    gdbfilename = filedialog.askopenfilename(title="Select GDB",
    filetypes=(("GBD files", "*.gdb"), ("all files", "*.*")))
    the application does not run in Pycharm and give the Error message illustrated. Similarly, I have an error in Anaconda (see attached). However, if I simply replace the previous line by:
    # gdbfilename = filedialog.askopenfilename(title="Select GDB",
    # filetypes=(("GBD files", "*.gdb"), ("all files", "*.*")))
    gdbfilename = "VTEM.gdb"
    everything works ok like illustrated on the Correct output image.

    I can provide the *.py and the *.gdb file on request. However, they are not accepted by this post.
  • IanMacLeod
    IanMacLeod Posts: 382 Fluorite Rank Badge
    edited May 2018
    @MarcAVallee when we looked at this some time ago it seemed to be a conflict between tkinter, Pycharm and Geosoft, and we have not been able to come back to this due to other priorities.

    You do trigger a Geosoft assertion, based on the "Error from Anaconda.JPG" image. Please click the [Report] button and send this to my personal e-mail, which you have. This may give us an idea of a work-around strategy.
    Geosoft logo
  • MarcVallée
    This seems to disappear with Geosoft 9.4.
This discussion has been closed.