Skip to content

Commit

Permalink
Minor change in test setups
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan C. Rivenaes authored and Jan C. Rivenaes committed Jan 15, 2018
1 parent 5d9383d commit fb6aebf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
Empty file added .projectile
Empty file.
2 changes: 1 addition & 1 deletion tests/test_grid3d_average_map1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
xtg = XTGeoDialog()
logger = xtg.basiclogger(__name__)

if not xtg._testsetup():
if not xtg.testsetup():
sys.exit(-9)

td = xtg.tmpdir
Expand Down
2 changes: 1 addition & 1 deletion tests/test_grid3d_hc_thickness1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
xtg = XTGeoDialog()
logger = xtg.basiclogger(__name__)

if not xtg._testsetup():
if not xtg.testsetup():
sys.exit(-9)

td = xtg.tmpdir
Expand Down
2 changes: 1 addition & 1 deletion tests/test_grid3d_hc_thickness2.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
xtg = XTGeoDialog()
logger = xtg.basiclogger(__name__)

if not xtg._testsetup():
if not xtg.testsetup():
sys.exit(-9)

td = xtg.tmpdir
Expand Down
10 changes: 10 additions & 0 deletions xtgeo_grid3d_map_apps/_compute_avg.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ def get_avg(config, specd, propd, dates, zonation, zoned):

logger.debug('Flags of xmap is {}'.format(xmap.values.flags))
xtg.say('Mapping ...')
xtg.say('### yes')
if len(propd) == 0 or len(zoned) == 0:
raise RuntimeError('The dictionary <propd> or <zoned> is zero. Stop')

for zname, zrange in zoned.items():

logger.info('ZNAME and ZRANGE are {}: {}'.format(zname, zrange))
xtg.say('### ZNAME and ZRANGE are {}: {}'.format(zname, zrange))
usezonation = zonation
usezrange = zrange

Expand Down Expand Up @@ -74,6 +78,7 @@ def get_avg(config, specd, propd, dates, zonation, zoned):
continue

# first map the ACTNUM; to be used as mask for output
xtg.say('### Make avgs ...')
logger.debug('np flags before ...{}'.format(xmap.values.flags))
xmap.avg_from_3dprop(xprop=specd['ixc'],
yprop=specd['iyc'],
Expand All @@ -83,10 +88,13 @@ def get_avg(config, specd, propd, dates, zonation, zoned):
zone_minmax=[usezrange, usezrange])

logger.debug('np flags after gridding...{}'.format(xmap.values.flags))
xtg.say('### Make avgs ... DONE')

# raise SystemExit
for propname, pvalues in propd.items():

xtg.say('### propname{}'.format(propname))

xmap.avg_from_3dprop(xprop=specd['ixc'],
yprop=specd['iyc'],
mprop=pvalues,
Expand Down Expand Up @@ -167,6 +175,8 @@ def _avg_filesettings(config, zname, pname, mode='root'):
# with '~~', then back again...
pname = pname.replace(delim, '~~').replace('-', '_').replace('~~', delim)

print('PNAME: ', pname)

if config['output']['tag']:
tag = config['output']['tag'] + '_'
else:
Expand Down
4 changes: 2 additions & 2 deletions xtgeo_grid3d_map_apps/_get_grid_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ def import_data(config, appname, gfile, initlist,
for prop in tmp.props:
logger.info('Append prop: {}'.format(prop))
restobjects.append(prop)
except Exception:
raise SystemExit('Fatal error')
except Exception as message:
raise SystemExit(message)
else:
logger.info('Works further...')
for prop in tmp.props:
Expand Down

0 comments on commit fb6aebf

Please sign in to comment.