Skip to content

Commit

Permalink
Rename classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Dec 13, 2023
1 parent aecbe21 commit 2098773
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions atomistics/calculators/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_stress(self):
return self.structure.get_stress(voigt=False)


ASEStaticOutput = OutputStatic(
ASEOutputStatic = OutputStatic(
forces=ASEExecutor.get_forces,
energy=ASEExecutor.get_energy,
stress=ASEExecutor.get_stress,
Expand Down Expand Up @@ -81,7 +81,7 @@ def calc_static_with_ase(
ase_calculator,
quantities=OutputStatic.fields(),
):
return ASEStaticOutput.get(
return ASEOutputStatic.get(
ASEExecutor(ase_structure=structure, ase_calculator=ase_calculator), *quantities
)

Expand Down
12 changes: 6 additions & 6 deletions atomistics/calculators/lammps/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
LAMMPS_RUN,
LAMMPS_MINIMIZE_VOLUME,
)
from atomistics.calculators.lammps.output import LammpsMDOutput, LammpsStaticOutput
from atomistics.calculators.lammps.output import LammpsOutputMolecularDynamics, LammpsOutputStatic

if TYPE_CHECKING:
from ase import Atoms
Expand Down Expand Up @@ -113,7 +113,7 @@ def calc_static_with_lammps(
structure,
potential_dataframe,
lmp=None,
quantities=LammpsStaticOutput.fields(),
quantities=LammpsOutputStatic.fields(),
**kwargs,
):
template_str = LAMMPS_THERMO_STYLE + "\n" + LAMMPS_THERMO + "\n" + LAMMPS_RUN
Expand All @@ -127,7 +127,7 @@ def calc_static_with_lammps(
lmp=lmp,
**kwargs,
)
result_dict = LammpsStaticOutput.get(lmp_instance, *quantities)
result_dict = LammpsOutputStatic.get(lmp_instance, *quantities)
lammps_shutdown(lmp_instance=lmp_instance, close_instance=lmp is None)
return result_dict

Expand All @@ -144,7 +144,7 @@ def calc_molecular_dynamics_nvt_with_lammps(
seed=4928459,
dist="gaussian",
lmp=None,
quantities=LammpsMDOutput.fields(),
quantities=LammpsOutputMolecularDynamics.fields(),
**kwargs,
):
init_str = (
Expand Down Expand Up @@ -201,7 +201,7 @@ def calc_molecular_dynamics_npt_with_lammps(
seed=4928459,
dist="gaussian",
lmp=None,
quantities=LammpsMDOutput.fields(),
quantities=LammpsOutputMolecularDynamics.fields(),
**kwargs,
):
init_str = (
Expand Down Expand Up @@ -259,7 +259,7 @@ def calc_molecular_dynamics_nph_with_lammps(
seed=4928459,
dist="gaussian",
lmp=None,
quantities=LammpsMDOutput.fields(),
quantities=LammpsOutputMolecularDynamics.fields(),
**kwargs,
):
init_str = (
Expand Down
8 changes: 4 additions & 4 deletions atomistics/calculators/lammps/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pylammpsmpi import LammpsASELibrary

from atomistics.calculators.lammps.potential import validate_potential_dataframe
from atomistics.calculators.lammps.output import LammpsMDOutput
from atomistics.calculators.lammps.output import LammpsOutputMolecularDynamics


def lammps_run(structure, potential_dataframe, input_template=None, lmp=None, **kwargs):
Expand Down Expand Up @@ -41,19 +41,19 @@ def lammps_calc_md_step(
lmp_instance,
run_str,
run,
quantities=LammpsMDOutput.fields(),
quantities=LammpsOutputMolecularDynamics.fields(),
):
run_str_rendered = Template(run_str).render(run=run)
lmp_instance.interactive_lib_command(run_str_rendered)
return LammpsMDOutput.get(lmp_instance, *quantities)
return LammpsOutputMolecularDynamics.get(lmp_instance, *quantities)


def lammps_calc_md(
lmp_instance,
run_str,
run,
thermo,
quantities=LammpsMDOutput.fields(),
quantities=LammpsOutputMolecularDynamics.fields(),
):
results_lst = [
lammps_calc_md_step(
Expand Down
4 changes: 2 additions & 2 deletions atomistics/calculators/lammps/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from pylammpsmpi import LammpsASELibrary


LammpsStaticOutput = OutputStatic(
LammpsOutputStatic = OutputStatic(
forces=LammpsASELibrary.interactive_forces_getter,
energy=LammpsASELibrary.interactive_energy_pot_getter,
stress=LammpsASELibrary.interactive_pressures_getter,
)
LammpsMDOutput = OutputMolecularDynamics(
LammpsOutputMolecularDynamics = OutputMolecularDynamics(
positions=LammpsASELibrary.interactive_positions_getter,
cell=LammpsASELibrary.interactive_cells_getter,
forces=LammpsASELibrary.interactive_forces_getter,
Expand Down
4 changes: 2 additions & 2 deletions atomistics/calculators/qe.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_stress(self):
return self.parser.stress


QEStaticOutput = OutputStatic(
QuantumEspressoOutputStatic = OutputStatic(
forces=QEStaticParser.get_forces,
energy=QEStaticParser.get_energy,
stress=QEStaticParser.get_stress,
Expand Down Expand Up @@ -210,7 +210,7 @@ def calc_static_with_qe(
call_qe_via_ase_command(
calculation_name=calculation_name, working_directory=working_directory
)
return QEStaticOutput.get(QEStaticParser(filename=output_file_name), *quantities)
return QuantumEspressoOutputStatic.get(QEStaticParser(filename=output_file_name), *quantities)


@as_task_dict_evaluator
Expand Down

0 comments on commit 2098773

Please sign in to comment.