Installation#

pygeostat is compatible with Python 3.10 or newer and follows modern Python packaging standards.

Important

Minimum Python version: Python 3.10

For historical releases supporting older Python versions, see pygeostat v1.1.1.


Requirements#

Before installing pygeostat, ensure that you have:

  • Python 3.10+

  • pip (or a compatible Python package installer)

Generic Python installation instructions are intentionally omitted here. If you need help installing Python, see the official Python documentation.




Additional Software (CCG Members)#

CCG members have the option to install CCG/GSLIB software (executable files) to enable pygeostat scripting features. This can be done using the following function. While GSLIB executable files are available through a public repository, for CCG software a valid access token is required to download executables files from a private repository. The access token is available for CCG members at CCG knowledge base website.

pygeostat.utility.get_executable(source='gslib', access_token=None, clean=False)[source]

Gets a collection of executable files from a protected repository using an access token. Note that in order to use this function, git needs to be installed on the target computer.

Parameters:
  • source (str) – gslib or CCG as the source of software.

  • access_token (str) – An access token to authorize access to the target private repository for CCG software. Access token is available for CCG members and can be found at CCG knowledge base.

  • clean (bool) – Option to clean the executable directory prior to upload the files from the target private repository. Note that choosing this option will delete the existing executable files.

Examples

Installing GSLIB executable files

import pygeostat as gs
gs.get_executable(source='GSLIB')
user_guide/figures/GslibGetFiles.png

Installing CCG software

import pygeostat as gs
gs.get_executable(source='CCG', clean=True)
user_guide/figures/CcgGetFiles.png

Using the installed software

# Load example data included in pygeostat
data_file = gs.ExampleData('cluster')

# Initialize the Program object
nscore = gs.Program('nscore', getpar=True)

# Run normal score transformation
parstr = """ Parameters for NSCORE
             *********************
START OF PARAMETERS:
{datafile}                -  file with data
3  1  2  3                -  number of variables and columns
5                         -  column for weight, 0 if none
0                         -  column for category, 0 if none
0                         -  number of records if known, 0 if unknown
-1.0e21   1.0e21          -  trimming limits
0                         -transform using a reference distribution, 1=yes
../histsmth/histsmth.out  -file with reference distribution.
1   2   0                 -  columns for variable, weight, and category
101                       -maximum number of quantiles, 0 for all
{outfl}                   -file for output
{trnfl}                   -file for output transformation table
"""

pars = dict(datafile=data_file.flname,
            outfl = 'nscore.out',
            trnfl = 'nscore.trn')
nscore.run(parstr=parstr.format(**pars), liveoutput=True)