Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion autotest/t009_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,20 @@

def get_example_dirs():
exclude_dirs = ['Keating', 'Keating_UZF']
exdirs = [o for o in os.listdir(expth)

upd = pymake.usgs_program_data()

# exclude additional directories based on version of codes
# MODFLOW-NWT
ver = upd.get_version('mfnwt')
if ver == '1.2.0':
exclude_dirs += ['UZT_NonLin',
'UZT_Disp_Lamb01_TVD',
'UZT_Disp_Lamb1',
'UZT_Disp_Lamb10']

# create list of example directories to test
exdirs = [o for o in sorted(os.listdir(expth))
if os.path.isdir(os.path.join(expth, o)) and
o not in exclude_dirs]
return exdirs
Expand Down
7 changes: 4 additions & 3 deletions autotest/t999_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ def is_exe(fpath):

def test_latest_version():
version = pymake.repo_latest_version()
test_version = '3.0'
test_version = '4.0'
msg = 'returned version ({}) '.format(version) + \
'is not equal to defined version ({})'.format(test_version)
assert version == test_version, msg
'is not greater than or equal to ' + \
'defined version ({})'.format(test_version)
assert float(version) >= float(test_version), msg
return


Expand Down
20 changes: 20 additions & 0 deletions pymake/usgsprograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,26 @@ def get_precision(key):
precision.append(True)
return precision

@staticmethod
def get_version(key):
"""
Get the current version of the specified target

Parameters
----------
key : str
Target USGS program

Returns
-------
version : str
current version of the specified target


"""
target = usgs_program_data().get_target(key)
return target.version

@staticmethod
def list_targets(current=False):
"""
Expand Down