Closed mattwthompson closed 3 years ago
This logic is dependent on the forcefield_files
arg, but I think it should use all_files_to_load
variable, since it always gets populated in this code. In the name=oplsaa
case, the forcefield_files
var is never populated, but the all_files_to_load
var DOES get populated. In the other two cases, the forcefield_files
var gets populated, but so does the all_files_to_load
var.
If you replace those lines with all_files_to_load
(:530,538s/forcefield_files/all_files_to_load/g
), the metadata will be parsed in all 3 cases, but all will return List[str]
and not str
. I think changing those 7 lines a possible, quick-fix solution to this metadata parsing issue
if isinstance(all_files_to_load, str):
self._version = self._parse_version_number(all_files_to_load)
self._name = self._parse_name(all_files_to_load)
elif isinstance(all_files_to_load, list):
self._version = [
self._parse_version_number(f) for f in all_files_to_load
]
self._name = [self._parse_name(f) for f in all_files_to_load]
Bug summary
Metadata is not consistently being parsed when force field files are loaded. See this thread and some comments before and after it. This blocks #433 and any future metadata additions.
Code to reproduce the behavior
In:
Out:
Software versions
python -c "import foyer; print(foyer.version)"
) 0.9.1python --version
)? 3.9.5