diff options
author | Joshua Shreve <j.a.shreve@gmail.com> | 2021-07-09 15:33:49 -0400 |
---|---|---|
committer | Joshua Shreve <j.a.shreve@gmail.com> | 2021-07-09 15:33:49 -0400 |
commit | eeccc3c8c73000775c138c0dc7ff2c662d43228a (patch) | |
tree | 5183c349c7919af35e41a31cf1159126a721cca2 /src/generate_configuration.py | |
parent | e3bf24d17cdbda9ace5dbcae257c5c856ef984d9 (diff) |
Fixed imports. Resolved issues with IDE root directories to allow scripts to operate independently.
Diffstat (limited to 'src/generate_configuration.py')
-rw-r--r-- | src/generate_configuration.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/generate_configuration.py b/src/generate_configuration.py index e5dd966..18dbee6 100644 --- a/src/generate_configuration.py +++ b/src/generate_configuration.py @@ -266,5 +266,17 @@ def save_config(): with open('run_config.json', mode='w') as fid: json.dump(shape_config, fid, indent=4) +def update_config(fname, fname_out=None): + if fname_out is None: + fname_out == "updated_config.json" + # Open existing config, update with any new parameters, and save to updated_config.json + with open(fname, mode='r') as fid: + last_shape_config = json.load(fid) + shape_config.update(last_shape_config) + + with open(fname_out, mode='w') as fid: + json.dump(shape_config, fid, indent=4) + + if __name__ == '__main__': save_config() |