Skip to content

Commit

Permalink
fix abspath
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed Nov 2, 2023
1 parent 695b7e7 commit 0f2bd31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ai2_kit/feat/catalysis/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ def gen_lammps_config(self, work_dir: str = './', out_dir = './'):
'system_file': file_picker({'init_path': './'}),
'out_dir': {**file_picker(), 'default': out_dir },
'dp_models': {
'enum': [{'children': [], 'label': os.path.relpath(f, work_dir), 'value': f} for f in sorted(dp_model_files)]
'enum': [{'children': [], 'label': os.path.relpath(f, work_dir), 'value': os.path.abspath(f)} for f in sorted(dp_model_files)]
},
'ensemble': {
'enum': [{'children': [], 'label': e.upper(), 'value': e} for e in ensembles]
},
}}}, quiet=True)

form = Formily(schema, options={
"modal_props": {"title": "Provision AIMD Task", "width": "60vw","style": {"max-width": "800px"}, "styles": {"body": {"max-height": "70vh", "overflow-y": "auto"}}}
"modal_props": {"title": "Provision LAMMPS Task", "width": "60vw","style": {"max-width": "800px"}, "styles": {"body": {"max-height": "70vh", "overflow-y": "auto"}}}
}, default_value=self.lammps_value)
form.display()
async def _task():
Expand All @@ -159,7 +159,7 @@ async def _task():
def inspect_deepmd_output(self, work_dir: str):
pattern = os.path.join(work_dir, '*/iters-*/train-deepmd/tasks/*' )
dirs = glob.glob(pattern)
options = [(os.path.relpath(d, work_dir), d) for d in sorted(dirs)]
options = [(os.path.relpath(d, work_dir), os.path.abspath(d)) for d in sorted(dirs)]
fig_ax = plt.subplots(1, 2, figsize=(12, 4), constrained_layout=True)
def _task(dir_path):
display_lcurve(os.path.join(dir_path, 'lcurve.out'), fig_ax=fig_ax)
Expand All @@ -168,7 +168,7 @@ def _task(dir_path):
def inspect_lammps_output(self, work_dir: str):
pattern = os.path.join(work_dir, '*/iters-*/explore-lammps/tasks/*')
dirs = glob.glob(pattern)
options = [(os.path.relpath(d, work_dir), d) for d in sorted(dirs)]
options = [(os.path.relpath(d, work_dir), os.path.abspath(d)) for d in sorted(dirs)]
fig_ax = plt.subplots(1, 2, figsize=(12, 4), constrained_layout=True)
def _task(dir_path):
inspect_lammps_output(dir_path, fig_ax=fig_ax)
Expand Down

0 comments on commit 0f2bd31

Please sign in to comment.