pymake.utils.usgsprograms module#

Utility functions to extract information for a target from the USGS application database. Available functionality includes:

  1. Get a list of available targets

  2. Get data for a specific target

  3. Get a dictionary with the data for all targets

  4. Get the current version of a target

  5. Get a list indicating if single and double precsion versions of the target application should be built

  6. Functions to load, update, and export a USGS-style “code.json” json file containing information in the USGS application database

A table listing the available pymake targets is included below:

Available pymake targets#

target

version

current

url

dirname

srcdir

standard_switch

double_switch

shared_object

mf6

6.5.0

True

MODFLOW-USGS/modflow6

mf6.5.0_linux

src

True

False

False

zbud6

6.5.0

True

MODFLOW-USGS/modflow6

mf6.5.0_linux

utils/zonebudget/src

True

False

False

libmf6

6.5.0

True

MODFLOW-USGS/modflow6

mf6.5.0_linux

srcbmi

True

False

True

mp7

7.2.001

True

https://water.usgs.gov/water-resources/software/MODPATH/modpath_7_2_001.zip

modpath_7_2_001

source

True

False

False

mt3dms

5.3.0

True

MODFLOW-USGS/mt3dms

mt3dms-2.0

true-binary

True

False

False

mt3dusgs

1.1.0

True

https://water.usgs.gov/water-resources/software/MT3D-USGS/mt3dusgs1.1.0.zip

mt3dusgs1.1.0

src

True

False

False

vs2dt

3.3

True

https://water.usgs.gov/water-resources/software/VS2DI/vs2dt3_3.zip

vs2dt3_3

include

True

False

False

triangle

1.6

True

MODFLOW-USGS/triangle

triangle-1.0

src

True

False

False

gridgen

1.0.02

True

https://water.usgs.gov/water-resources/software/GRIDGEN/gridgen.1.0.02.zip

gridgen.1.0.02

src

True

False

False

crt

1.3.1

True

https://water.usgs.gov/ogw/CRT/CRT_1.3.1.zip

CRT_1.3.1

SOURCE

True

False

False

sutra

3.0

True

https://water.usgs.gov/water-resources/software/sutra/SUTRA_3_0_0.zip

SutraSuite

SUTRA_3_0/source

True

False

False

mf2000

1.19.01

True

https://water.usgs.gov/nrp/gwsoftware/modflow2000/mf2k1_19_01.tar.gz

mf2k.1_19

src

True

False

False

mf2005

1.12.00

True

MODFLOW-USGS/mf2005

MF2005.1_12u

src

True

False

False

mfusg

1.5

True

https://water.usgs.gov/water-resources/software/MODFLOW-USG/mfusg1_5.zip

mfusg1_5

src

True

False

False

zonbudusg

1.5

True

https://water.usgs.gov/water-resources/software/MODFLOW-USG/mfusg1_5.zip

mfusg1_5

src/zonebudusg

True

False

False

swtv4

4.00.05

True

https://water.usgs.gov/water-resources/software/SEAWAT/swt_v4_00_05.zip

swt_v4_00_05

source

False

True

False

mp6

6.0.1

True

https://water.usgs.gov/water-resources/software/MODPATH/modpath.6_0_01.zip

modpath.6_0

src

True

False

False

mflgr

2.0.0

True

https://water.usgs.gov/ogw/modflow-lgr/modflow-lgr-v2.0.0/mflgrv2_0_00.zip

mflgr.2_0

src

True

False

False

zonbud3

3.01

True

https://water.usgs.gov/water-resources/software/ZONEBUDGET/zonbud3_01.exe

Zonbud.3_01

Src

True

False

False

mfnwt1.1.4

1.1.4

False

https://water.usgs.gov/water-resources/software/MODFLOW-NWT/MODFLOW-NWT_1.1.4.zip

MODFLOW-NWT_1.1.4

src

True

False

False

mfnwt

1.3.0

True

https://water.usgs.gov/water-resources/software/MODFLOW-NWT/MODFLOW-NWT_1.3.0.zip

MODFLOW-NWT

src

True

False

False

mfusg_gsi

2.3.0

True

https://www.gsienv.com/wp-content/uploads/2024/03/USG-Transport_Version-2.3.0.zip

USGT-v2-3-0-Source

.

True

False

False

mf6dev

6.6.0.dev0

False

MODFLOW-USGS/modflow6

modflow6-develop

src

True

False

False

zbud6dev

6.6.0.dev0

False

MODFLOW-USGS/modflow6

modflow6-develop

utils/zonebudget/src

True

False

False

libmf6dev

6.6.0.dev0

False

MODFLOW-USGS/modflow6

modflow6-develop

srcbmi

True

False

True

class dotdict[source]#

Bases: dict

dot.notation access to dictionary attributes.

class usgs_program_data[source]#

Bases: object

USGS program database class.

static export_json(fpth='code.json', appdir=None, prog_data=None, current=False, update=True, write_markdown=False, partial_json=False, zip_path=None, verbose=False)[source]#

Export USGS program data as a json file.

Parameters:
  • fpth (str) – Path for the json file to be created. Default is “code.json”

  • appdir (str) – path for code.json. Overides code.json path defined in fpth. Default is None.

  • prog_data (dict) – User-specified program database. If prog_data is None, it will be created from the USGS program database

  • current (bool) – If False, all USGS program targets are listed. If True, only USGS program targets that are defined as current are listed. Default is False.

  • update (bool) – If True, existing targets in the user-specified program database with values in the USGS program database. If False, existing targets in the user-specified program database will not be updated. Default is True.

  • write_markdown (bool) – If True, write markdown file that includes the target name, version, and the last-modified date of the download asset (url). Default is False.

  • partial_json (bool) – Create a partial code.json based on targets in the parent path for the code.json file. Default is False.

  • zip_path (str) – Zip code.json into zip_path. (default is None)

  • verbose (bool) – boolean for verbose output to terminal

static get_keys(current=False)[source]#

Get target keys from the USGS program database.

Parameters:

current (bool) – If False, all USGS program targets are listed. If True, only USGS program targets that are defined as current are listed. Default is False.

Returns:

keys – list of USGS program targets

Return type:

list

static get_precision(key)[source]#

Get the dictionary for a specified target.

Parameters:

key (str) – Target USGS program

Returns:

precision – List

Return type:

list

static get_program_dict()[source]#

Get the complete USGS program database.

Returns:

program_dict – Dictionary with USGS program attributes for all targets

Return type:

dict

static get_target(key)[source]#

Get the dictionary for a specified target.

Parameters:

key (str) – Target USGS program that may have a path and an extension

Returns:

program_dict – Dictionary with USGS program attributes for the specified key

Return type:

dict

static get_version(key)[source]#

Get the current version of the specified target.

Parameters:

key (str) – Target USGS program

Returns:

version – current version of the specified target

Return type:

str

static list_json(fpth='code.json')[source]#

List an existing code json file.

Parameters:

fpth (str) – Path for the json file to be listed. Default is “code.json”

static list_targets(current=False)[source]#

Print a list of the available USGS program targets.

Parameters:

current (bool) – If False, all USGS program targets are listed. If True, only USGS program targets that are defined as current are listed. Default is False.

static load_json(fpth='code.json')[source]#

Load an existing code json file. Basic error checking is done to make sure the file contains the correct keys.

Parameters:

fpth (str) – Path for the json file to be created. Default is “code.json”

Returns:

json_dict – Valid USGS program database

Return type:

dict

static update_json(fpth='code.json', temp_dict=None)[source]#

UPDATE an existing code json file.

Parameters:
  • fpth (str) – Path for the json file to be listed. Default is “code.json”

  • temp_dict (dict) – Dictionary with USGS program data for a target