Browse Source

ids: various fixes (core, app, test)

pull/6/head
mmetz 6 days ago
parent
commit
f22e74bad7
  1. 7
      src/apps/ids.py
  2. 6
      src/si/ids/core.py
  3. 9
      test/si/test_ids.py

7
src/apps/ids.py

@ -120,7 +120,12 @@ def command_init(args):
if args.rundir is None:
raise IDSError('running directoy needs to be given')
IDSRunner.init(rundir=args.rundir, force=args.force)
fns = IDSRunner.init(rundir=args.rundir, force=args.force)
logger.info('(1) configure settings in config file e.g.:\n %s'
% '\n '.join(fns))
logger.info('(2) run "ids go <config_file>" in directory: "%s"'
% args.rundir)
def command_go(args):

6
src/si/ids/core.py

@ -187,11 +187,15 @@ class IDSRunner(Object):
os.makedirs(rundir)
os.makedirs(op.join(rundir, 'config'))
fns = [op.join(rundir, 'config', 'idsconfig_example.conf')]
runner = cls()
runner.config.dump(
filename=op.join(rundir, 'config', 'idsconfig_example.conf'),
filename=fns[0],
header=True)
return fns
def _prepare_ids_dir(self):
dirs = \
[self.waveformdir, self.gnssdir, self.insardir, self.faultdir] + \

9
test/si/test_ids.py

@ -4,11 +4,6 @@ import unittest
import os
import os.path as op
import numpy as num
from pyrocko import moment_tensor as pmt, util as putil
from ewrica.io import ids as ids_io
from ewrica.si import ids as ids_si
from ewrica.si.ids.config import IDSConfigFull
km = 1e3
@ -28,7 +23,7 @@ class TargetTest(unittest.TestCase):
conf = IDSConfigFull.example()
prefix = conf.path_prefix
target = conf.waveform_conf.waveform_targets[0]
target = conf.waveform_config.waveform_targets[0]
assert target.blocklist_paths == [
op.join(prefix, p) for p in target.blocklist_paths__]
@ -42,7 +37,7 @@ class WaveformTargetTest(unittest.TestCase):
conf = IDSConfigFull.example()
conf.path_prefix = ''
target = conf.waveform_conf.waveform_targets[0]
target = conf.waveform_config.waveform_targets[0]
stations = ['AB.CDE', 'FG.HI']
with tempfile.NamedTemporaryFile(

Loading…
Cancel
Save