Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.11
python: python3.9

ci:
autoupdate_schedule: quarterly
Expand Down
28 changes: 14 additions & 14 deletions sevenn/train/dataload.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def parse_fileline(line):
structure_list_file.close()

structures_dict = {}
info_dct = {'data_from': 'user_OUTCAR'}
# info_dct = {'data_from': 'user_OUTCAR'}
for title, file_lines in raw_str_dict.items():
stct_lists = []
for file_line in file_lines:
Expand All @@ -436,11 +436,11 @@ def parse_fileline(line):
# TODO: support
# negative index
raise ValueError('Negative index is not supported yet')

info_dct_f = {
**info_dct,
'file': os.path.abspath(expanded_filename),
}
# info commented out (conflict with else clause)
# info_dct_f = {
# **info_dct,
# 'file': os.path.abspath(expanded_filename),
# }
for idx, o in enumerate(it_atoms):
try:
it_atoms = islice(
Expand All @@ -451,26 +451,26 @@ def parse_fileline(line):
# negative index
raise ValueError('Negative index is not supported yet')

info_dct_f = {
**info_dct,
'file': os.path.abspath(expanded_filename),
}
# info_dct_f = {
# **info_dct,
# 'file': os.path.abspath(expanded_filename),
# }
for idx, o in enumerate(it_atoms):
try:
istep = index.start + idx * index.step # type: ignore
# istep = index.start + idx * index.step # type: ignore
atoms = o.build()
atoms.info = {**info_dct_f, 'ionic_step': istep}.copy()
# atoms.info = {**info_dct_f, 'ionic_step': istep}.copy()
except TypeError: # it is not slice of ionic steps
atoms = o.build()
atoms.info = info_dct_f.copy()
# atoms.info = info_dct_f.copy()
stct_lists.append(atoms)
f_stream.close()
else:
stct_lists += ase.io.read(
expanded_filename,
index=index_expr,
parallel=False,
)
f_stream.close()
structures_dict[title] = stct_lists
return {k: _set_atoms_y(v) for k, v in structures_dict.items()}

Expand Down