Skip to content

Commit

Permalink
beat: create proj_dir only on init and clone, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hvasbath committed Aug 21, 2022
1 parent 10044fa commit 7d5dc4f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
15 changes: 10 additions & 5 deletions beat/apps/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def get_project_directory(args, options, nargs=1, popflag=False):


def process_common_options(options, project_dir):
util.ensuredir(project_dir)
utility.setup_logging(project_dir, options.loglevel, logfilename="BEAT_log.txt")


Expand Down Expand Up @@ -195,7 +194,9 @@ def cl_parse(command, args, setup=None, details=None):
add_common_options(parser)
(options, args) = parser.parse_args(args)
project_dir = get_project_directory(args, options, nargs_dict[command])
process_common_options(options, project_dir)

if command != "init":
process_common_options(options, project_dir)
return parser, options, args


Expand All @@ -215,6 +216,9 @@ def get_sampled_slip_variables(config):


def command_init(args):

command_str = "init"

def setup(parser):

parser.add_option(
Expand Down Expand Up @@ -331,6 +335,10 @@ def setup(parser):
name = args[0]
date = None

project_dir = pjoin(os.path.abspath(options.main_path), name)

util.ensuredir(project_dir)
process_common_options(options, project_dir)
return bconfig.init_config(
name,
date,
Expand Down Expand Up @@ -1477,9 +1485,6 @@ def setup(parser):
"To start calculations set --execute!" % datatype
)

if options.execute:
logger.info("%s GF calculations successful!" % datatype)

elif options.mode == ffi_mode_str:
from beat import ffi

Expand Down
4 changes: 2 additions & 2 deletions data/examples/MTQT_polarity/config_geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ polarity_config: !beat.PolarityConfig
- !beat.PolarityFitConfig
name: any_P
include: true
polarities_marker_path: ./Polarity_tutorial/polarity_markers_P.pf
polarities_marker_path: ./MTQT_polarity/polarity_markers_P.pf
blacklist:
- EO.KSM02
- PQ.NBC7
gf_config: !beat.PolarityGFConfig
store_superdir: /home/vasyurhm/BEATS/GF
store_superdir: ./MTQT_polarity
reference_model_idx: 0
n_variations:
- 0
Expand Down
14 changes: 7 additions & 7 deletions docs/examples/MTQT_polarity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ Optimization setup
For this setup we use the moment tensor parameterisation of the MTQTSource after [TapeTape2015]_.
This is defined in the *problem_config* (source specification)::

problem_config: !beat.ProblemConfig
mode: geometry
source_type: MTQTSource
stf_type: Triangular
n_sources: 1
datatypes:
- polarity
problem_config: !beat.ProblemConfig
mode: geometry
source_type: MTQTSource
stf_type: Triangular
n_sources: 1
datatypes:
- polarity

Finally, we need to configure *priors* and *hyperparameters*::

Expand Down

0 comments on commit 7d5dc4f

Please sign in to comment.