Skip to content

Commit

Permalink
Sync with 2022.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
serban-seeq committed Jul 4, 2022
1 parent 4c5e759 commit 7e4a59f
Show file tree
Hide file tree
Showing 20 changed files with 614 additions and 28 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you encounter problems due to a non-standard installation you can also update

### Manual Configuration ###

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

```
pip uninstall geosoft
Expand All @@ -42,9 +42,9 @@ 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 2021.2. While we recommend that older scripts be updated to conform to the 2021.2 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 2021.2. 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.
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 2022.1. While we recommend that older scripts be updated to conform to the 2022.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 ___'py36_gx20212'___ for Python 3.6 and the GX API version 2021.2 or ___'py37_gx20221'___ for Python 3.7 and GX Developer 2022.1. 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.

Vesion 2021.2 supports Python 3.6, 3.7, 3.8 and 3.9.
Vesion 2022.1 supports Python 3.6, 3.7, 3.8 and 3.9.
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.

Expand Down
11 changes: 11 additions & 0 deletions docs/GXTRANSFORMLAYER.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.. _GXTRANSFORMLAYER:


GXTRANSFORMLAYER class
==================================

.. autoclass:: geosoft.gxapi.GXTRANSFORMLAYER
:members:


2 changes: 1 addition & 1 deletion geosoft/gxapi/GXDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def set_chan_width(self, chan, width):

def set_ipj(self, ch1, ch2, ipj):
"""
Set a `GXREG <geosoft.gxapi.GXREG>` object into a symbol
Set an `GXIPJ <geosoft.gxapi.GXIPJ>` object into a pair of (X, Y) channels
:param ch1: X channel
:param ch2: Y channel
Expand Down
26 changes: 26 additions & 0 deletions geosoft/gxapi/GXDCOL.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,32 @@ def update_zone_transform_type(self, index, transformType):



def update_zone_transform_parameters(self, index):
"""
Recalculate the layer's ITR, based on the current type of the `GXDCOL <geosoft.gxapi.GXDCOL>`. Launches anappropriate zone transform type parameter GUI based on the current selection.
:param index: Index of layer
:type index: int
:returns: 0 - Ok
1 - Cancel
:rtype: int
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
**Limitations:** May not be available while executing a command line program.
**Note:** The transform type assumed is the current transform type for the `GXDCOL <geosoft.gxapi.GXDCOL>`. The dialogs
to enter parameters are shown for Linear, Log, Normal and Equal.
"""
ret_val = self._update_zone_transform_parameters(index)
return ret_val




def get_layer_statistics(self, index):
"""
Get a `GXST <geosoft.gxapi.GXST>` filled with layer statistics
Expand Down
26 changes: 26 additions & 0 deletions geosoft/gxapi/GXDU.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,32 @@ def avg_azimuth(cls, db, precision, azimuth):



@classmethod
def average_spacing(cls, db, line, xCh, yCh):
"""
Returns the average spacing along a line.
This is a simple average of the individual point separations after dummies are removed.
Returns DUMMY if there are fewer than two valid locations.
:param db: Database
:param line: Line handle
:param xCh: X channel [`DB_LOCK_READONLY <geosoft.gxapi.DB_LOCK_READONLY>`]
:param yCh: Y channel [`DB_LOCK_READONLY <geosoft.gxapi.DB_LOCK_READONLY>`]
:type db: GXDB
:type line: int
:type xCh: int
:type yCh: int
:rtype: float
.. versionadded:: 2022.1
**License:** `Geosoft End-User License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-end-user-lic>`_
"""
ret_val = gxapi_cy.WrapDU._average_spacing(GXContext._get_tls_geo(), db, line, xCh, yCh)
return ret_val



@classmethod
def base_data(cls, db, line, in_ch, time_ch, out_ch, tb):
"""
Expand Down
45 changes: 45 additions & 0 deletions geosoft/gxapi/GXEDOC.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,51 @@ def un_load_verify(cls, name, verify, type):



# Obsolete



def copy(self, output):
"""
Copies a managed document to another document.
:param output: Name of output document
:type output: str
:rtype: bool
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
**Limitations:** May not be available while executing a command line program.
**Note:** Copies a managed document to another document.
"""
ret_val = self._copy(output.encode())
return ret_val




def save(self):
"""
Save the managed document.
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
**Limitations:** May not be available while executing a command line program.
**Note:** Save the managed document
"""
self._save()






### endblock ClassImplementation
### block ClassExtend
Expand Down
21 changes: 21 additions & 0 deletions geosoft/gxapi/GXMAP.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,27 @@ def get_data_proj(self):



def dataset_file_path_list(self, lst):
"""
Get a list of all dataset file paths in this map.
:param lst: List to hold the paths. Paths may be up to 2080 characters in length.
:type lst: GXLST
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
.. seealso::
`GXLST <geosoft.gxapi.GXLST>` class.
"""
self._dataset_file_path_list(lst)






### endblock ClassImplementation
### block ClassExtend
Expand Down
81 changes: 78 additions & 3 deletions geosoft/gxapi/GXMVIEW.py
Original file line number Diff line number Diff line change
Expand Up @@ -4341,9 +4341,29 @@ def get_folder_items_3d(self, parent_guid):



def get_folder_items_2d(self, parent_name):
"""
Get the list of key-value pairs representing the name(key) and the type(value) of all children in the specified parent folders in the `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param parent_name: Parent folder name, or empty string for root MVIEW
:type parent_name: str
:rtype: GXLST
.. versionadded:: 9.10
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
**Note:** Returns name/type pairs. Types can be 'Folder', 'Group' or 'Unknown'
"""
ret_val = self._get_folder_items_2d(parent_name.encode())
return GXLST(ret_val)




def add_folder_3d(self, name, parent_guid, guid):
"""
Add a folder to the `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
Add a 3DView folder to the `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param name: Folder name
:param parent_guid: Folder parent GUID, or empty string for parent `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
Expand All @@ -4362,9 +4382,28 @@ def add_folder_3d(self, name, parent_guid, guid):



def add_folder_2d(self, name, parent_name):
"""
Add a Map folder to the `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param name: Folder name
:param parent_name: Parent folder name, or empty string for root `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:type name: str
:type parent_name: str
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._add_folder_2d(name.encode(), parent_name.encode())





def move_group_to_folder_3d(self, guid, group):
"""
Add group to a folder in `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
Add group to a 3DView folder in `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param guid: Folder parent GUID, or empty string for parent `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param group: Group number
Expand All @@ -4381,9 +4420,28 @@ def move_group_to_folder_3d(self, guid, group):



def move_group_to_folder_2d(self, parent_name, group):
"""
Add group to a Map folder in `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param parent_name: Parent folder name, or empty string for root `GXMVIEW <geosoft.gxapi.GXMVIEW>`.
:param group: Group number
:type parent_name: str
:type group: int
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._move_group_to_folder_2d(parent_name.encode(), group)





def delete_folder_3d(self, guid):
"""
Delete a folder.
Delete a Map folder.
:param guid: Folder GUID.
:type guid: str
Expand All @@ -4398,6 +4456,23 @@ def delete_folder_3d(self, guid):



def delete_folder_2d(self, name):
"""
Delete a 3DView folder.
:param name: Folder name.
:type name: str
.. versionadded:: 2022.1
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._delete_folder_2d(name.encode())





def find_group_by_guid(self, guid):
"""
Find a Group by name.
Expand Down
Loading

0 comments on commit 7e4a59f

Please sign in to comment.