Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strict check simplify jdata #951

Merged
merged 2 commits into from
Oct 3, 2022
Merged
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
12 changes: 4 additions & 8 deletions dpgen/simplify/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@

from dpgen import dlog
from dpgen import SHORT_CMD
from dpgen.util import sepline, expand_sys_str
from dpgen.util import sepline, expand_sys_str, normalize
from distutils.version import LooseVersion
from dpgen.dispatcher.Dispatcher import Dispatcher, _split_tasks, make_dispatcher, make_submission
from dpgen.generator.run import make_train, run_train, post_train, run_fp, post_fp, fp_name, model_devi_name, train_name, train_task_fmt, sys_link_fp_vasp_pp, make_fp_vasp_incar, make_fp_vasp_kp, make_fp_vasp_cp_cvasp, data_system_fmt, model_devi_task_fmt, fp_task_fmt
# TODO: maybe the following functions can be moved to dpgen.util
from dpgen.generator.lib.utils import log_iter, make_iter_name, create_path, record_iter
from dpgen.generator.lib.gaussian import make_gaussian_input
from dpgen.remote.decide_machine import convert_mdata
from .arginfo import simplify_jdata_arginfo


picked_data_name = "data.picked"
Expand Down Expand Up @@ -413,13 +414,8 @@ def run_iter(param_file, machine_file):
with open(machine_file, 'r') as fp:
mdata = json.load(fp)

if jdata.get('pretty_print', False):
fparam = SHORT_CMD+'_' + \
param_file.split('.')[0]+'.'+jdata.get('pretty_format', 'json')
dumpfn(jdata, fparam, indent=4)
fmachine = SHORT_CMD+'_' + \
machine_file.split('.')[0]+'.'+jdata.get('pretty_format', 'json')
dumpfn(mdata, fmachine, indent=4)
jdata_arginfo = simplify_jdata_arginfo()
jdata = normalize(jdata_arginfo, jdata)

if mdata.get('handlers', None):
if mdata['handlers'].get('smtp', None):
Expand Down