From 426752a57410aa1467c7464d862a83092a899475 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Fri, 17 Nov 2023 09:45:09 +0100 Subject: [PATCH] Merge LAMMPS classes in one module --- atomistics/calculators/lammps/__init__.py | 5 +++++ .../calculators/{lammps.py => lammps/calculator.py} | 9 +-------- .../{lammps_potentials.py => lammps/potential.py} | 7 +++++++ 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 atomistics/calculators/lammps/__init__.py rename atomistics/calculators/{lammps.py => lammps/calculator.py} (94%) rename atomistics/calculators/{lammps_potentials.py => lammps/potential.py} (97%) diff --git a/atomistics/calculators/lammps/__init__.py b/atomistics/calculators/lammps/__init__.py new file mode 100644 index 00000000..cc2c1f06 --- /dev/null +++ b/atomistics/calculators/lammps/__init__.py @@ -0,0 +1,5 @@ +from atomistics.calculators.lammps.calculator import ( + evaluate_with_lammps, + evaluate_with_lammps_library, +) +from atomistics.calculators.lammps.potential import get_potential_dataframe diff --git a/atomistics/calculators/lammps.py b/atomistics/calculators/lammps/calculator.py similarity index 94% rename from atomistics/calculators/lammps.py rename to atomistics/calculators/lammps/calculator.py index 65eae009..28d9f20c 100644 --- a/atomistics/calculators/lammps.py +++ b/atomistics/calculators/lammps/calculator.py @@ -5,7 +5,7 @@ from jinja2 import Template from pylammpsmpi import LammpsASELibrary -from atomistics.calculators.lammps_potentials import ( +from atomistics.calculators.lammps.potential import ( update_potential_paths, view_potentials, ) @@ -159,10 +159,3 @@ def _run_simulation(structure, potential_dataframe, input_template, lmp): lmp.interactive_lib_command(l) return lmp - - -def get_potential_dataframe(structure, resource_path): - return update_potential_paths( - df_pot=view_potentials(structure=structure, resource_path=resource_path), - resource_path=resource_path, - ) diff --git a/atomistics/calculators/lammps_potentials.py b/atomistics/calculators/lammps/potential.py similarity index 97% rename from atomistics/calculators/lammps_potentials.py rename to atomistics/calculators/lammps/potential.py index c270080f..1cb15713 100644 --- a/atomistics/calculators/lammps_potentials.py +++ b/atomistics/calculators/lammps/potential.py @@ -287,3 +287,10 @@ def update_potential_paths(df_pot, resource_path): config_lst.append(potential_commands) df_pot["Config"] = config_lst return df_pot + + +def get_potential_dataframe(structure, resource_path): + return update_potential_paths( + df_pot=view_potentials(structure=structure, resource_path=resource_path), + resource_path=resource_path, + )