Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the names of the calculations so that they are consistent. #68

Merged
merged 3 commits into from
Apr 6, 2023
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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ result, calc_node = run_get_node(builder)
$ verdi process list -D desc -a -l 1
PK Created Process label Process State Process status
---- --------- ---------------- --------------- ----------------
2480 32s ago ForceCalculation Finished [0]
2480 32s ago LammpsForceCalculation Finished [0]

Total results: 1

Expand All @@ -168,7 +168,7 @@ Inputs PK Type
---------- ---- ------------------
code 1351 Code
parameters 2479 Dict
potential 2478 EmpiricalPotential
potential 2478 LammpsEmpiricalPotential
structure 2477 StructureData

Outputs PK Type
Expand All @@ -185,7 +185,7 @@ calc_node.outputs.results.attributes

```python
{'parser_version': '0.4.0b3',
'parser_class': 'ForceParser',
'parser_class': 'LammpsForceParser',
'errors': [],
'warnings': '',
'distance_units': 'Angstroms',
Expand Down Expand Up @@ -264,7 +264,7 @@ Inputs PK Type
---------- ---- ------------------
code 1344 Code
parameters 2485 Dict
potential 2478 EmpiricalPotential
potential 2478 LammpsEmpiricalPotential
structure 2477 StructureData

Outputs PK Type
Expand All @@ -282,7 +282,7 @@ calc_node.outputs.results.attributes

```python
{'parser_version': '0.4.0b3',
'parser_class': 'OptimizeParser',
'parser_class': 'LammpsOptimizeParser',
'errors': [],
'warnings': '',
'stress_units': 'bars',
Expand Down Expand Up @@ -342,7 +342,7 @@ result, calc_node = run_get_node(builder)
$ verdi process list -D desc -a -l 1
PK Created Process label Process State Process status
---- --------- --------------- --------------- ----------------
2493 12s ago MdCalculation ⏹ Finished [0]
2493 12s ago LammpsMdCalculation ⏹ Finished [0]

Total results: 1

Expand All @@ -366,7 +366,7 @@ Inputs PK Type
---------- ---- ------------------
code 1540 Code
parameters 2492 Dict
potential 2478 EmpiricalPotential
potential 2478 LammpsEmpiricalPotential
structure 2477 StructureData

Outputs PK Type
Expand All @@ -384,7 +384,7 @@ calc_node.outputs.results.attributes

```python
{'parser_version': '0.4.0b3',
'parser_class': 'MdParser',
'parser_class': 'LammpsMdParser',
'errors': [],
'warnings': '',
'time_units': 'picoseconds',
Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/calculations/lammps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np

from aiida_lammps.common.generate_structure import generate_lammps_structure
from aiida_lammps.data.potential import EmpiricalPotential
from aiida_lammps.data.potential import LammpsEmpiricalPotential


class BaseLammpsCalculation(CalcJob):
Expand Down Expand Up @@ -40,7 +40,7 @@ def define(cls, spec):
)
spec.input(
"potential",
valid_type=EmpiricalPotential,
valid_type=LammpsEmpiricalPotential,
help="lammps potential",
)
spec.input(
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/calculations/lammps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from aiida_lammps.data.trajectory import LammpsTrajectory


class BaseLammpsCalculation(CalcJob):
class LammpsBaseCalculation(CalcJob):
"""
A basic plugin for performing calculations in ``LAMMPS`` using aiida.

Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/calculations/lammps/force.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from aiida_lammps.validation import validate_against_schema


class ForceCalculation(BaseLammpsCalculation):
class LammpsForceCalculation(BaseLammpsCalculation):
"""Calculation of a single point in LAMMPS, to obtain the energy of the system."""

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/calculations/lammps/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from aiida_lammps.validation import validate_against_schema


class MdCalculation(BaseLammpsCalculation):
class LammpsMdCalculation(BaseLammpsCalculation):
"""Calculation of a single MD stage in LAMMPS."""

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/calculations/lammps/md_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from aiida_lammps.validation import validate_against_schema


class MdMultiCalculation(BaseLammpsCalculation):
class LammpsMdMultiCalculation(BaseLammpsCalculation):
"""Run a multi-stage molecular dynamic simulation."""

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/calculations/lammps/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from aiida_lammps.validation import validate_against_schema


class OptimizeCalculation(BaseLammpsCalculation):
class LammpsOptimizeCalculation(BaseLammpsCalculation):
"""Calculation for the optimization of the structure in LAMMPS."""

@classmethod
Expand Down Expand Up @@ -147,7 +147,7 @@ def validate_parameters(param_data, potential_object) -> bool:
:param param_data: input parameters for the optimization calculations
:type param_data: orm.Dict
:param potential_object: LAMMPS potential
:type potential_object: EmpiricalPotential
:type potential_object: LammpsEmpiricalPotential
:raises InputValidationError: if there is no parameters data passed
:raises InputValidationError: if the units of the parameters and
the potential are different.
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/common/raw_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def read_log_file(logdata_txt, compute_stress=False):
found_end = True
elif "Total wall time:" in line:
data_dict["total_wall_time"] = line.split()[-1]
# These are handled in LAMMPSBaseParser.add_warnings_and_errors
# These are handled in LammpsBaseParser.add_warnings_and_errors
# if line.strip().startswith("WARNING"):
# data_dict.setdefault("warnings", []).append(line.strip())
# if line.strip().startswith("ERROR"):
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/data/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from aiida.plugins.entry_point import get_entry_point_names, load_entry_point


class EmpiricalPotential(Data):
class LammpsEmpiricalPotential(Data):
"""
Store the empirical potential data
"""
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/parsers/lammps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)


class LAMMPSBaseParser(Parser):
class LammpsBaseParser(Parser):
"""Abstract Base Parser for LAMMPS, supplying common methods."""

def __init__(self, node):
Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/parsers/lammps/force.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from aiida_lammps.common.parse_trajectory import iter_trajectories
from aiida_lammps.common.raw_parsers import get_units_dict
from aiida_lammps.parsers.lammps.base import LAMMPSBaseParser
from aiida_lammps.parsers.lammps.base import LammpsBaseParser


class ForceParser(LAMMPSBaseParser):
class LammpsForceParser(LammpsBaseParser):
"""Parser for LAMMPS single point energy calculation."""

def __init__(self, node):
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/parsers/lammps/lammps_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from aiida_lammps.data.trajectory import LammpsTrajectory


class LAMMPSBaseParser(Parser):
class LammpsBaseParser(Parser):
"""
Base parser for LAMMPS calculations.

Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/parsers/lammps/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from aiida_lammps.common.raw_parsers import convert_units, get_units_dict
from aiida_lammps.data.trajectory import LammpsTrajectory
from aiida_lammps.parsers.lammps.base import LAMMPSBaseParser
from aiida_lammps.parsers.lammps.base import LammpsBaseParser


class MdParser(LAMMPSBaseParser):
class LammpsMdParser(LammpsBaseParser):
"""Parser for LAMMPS MD calculations."""

def __init__(self, node):
Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/parsers/lammps/md_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

from aiida_lammps.common.raw_parsers import convert_units, get_units_dict
from aiida_lammps.data.trajectory import LammpsTrajectory
from aiida_lammps.parsers.lammps.base import LAMMPSBaseParser
from aiida_lammps.parsers.lammps.base import LammpsBaseParser


class MdMultiParser(LAMMPSBaseParser):
class LammpsMdMultiParser(LammpsBaseParser):
"""Parser for LAMMPS MDMulti calculations."""

def __init__(self, node):
Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/parsers/lammps/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

from aiida_lammps.common.raw_parsers import get_units_dict
from aiida_lammps.data.trajectory import LammpsTrajectory
from aiida_lammps.parsers.lammps.base import LAMMPSBaseParser
from aiida_lammps.parsers.lammps.base import LammpsBaseParser


class OptimizeParser(LAMMPSBaseParser):
class LammpsOptimizeParser(LammpsBaseParser):
"""Parser for LAMMPS optimization calculation."""

def __init__(self, node):
Expand Down
4 changes: 2 additions & 2 deletions examples/launch_lammps_force_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from aiida.plugins import CalculationFactory
import numpy as np

from aiida_lammps.data.potential import EmpiricalPotential
from aiida_lammps.data.potential import LammpsEmpiricalPotential

if __name__ == "__main__":

Expand Down Expand Up @@ -81,7 +81,7 @@

# setup nodes
inputs.structure = structure
inputs.potential = EmpiricalPotential(
inputs.potential = LammpsEmpiricalPotential(
type=potential["pair_style"], data=potential["data"]
)

Expand Down
4 changes: 2 additions & 2 deletions examples/launch_lammps_md_si.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from aiida.plugins import CalculationFactory
import numpy as np

from aiida_lammps.data.potential import EmpiricalPotential
from aiida_lammps.data.potential import LammpsEmpiricalPotential

if __name__ == "__main__":

Expand Down Expand Up @@ -83,7 +83,7 @@

# setup nodes
inputs.structure = structure
inputs.potential = EmpiricalPotential(
inputs.potential = LammpsEmpiricalPotential(
type=potential["pair_style"], data=potential["data"]
)

Expand Down
4 changes: 2 additions & 2 deletions examples/launch_lammps_optimization_fe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from aiida.plugins import CalculationFactory
import numpy as np

from aiida_lammps.data.potential import EmpiricalPotential
from aiida_lammps.data.potential import LammpsEmpiricalPotential

if __name__ == "__main__":

Expand Down Expand Up @@ -87,7 +87,7 @@

# setup nodes
inputs.structure = structure
inputs.potential = EmpiricalPotential(
inputs.potential = LammpsEmpiricalPotential(
type=potential["pair_style"], data=potential["data"]
)

Expand Down
4 changes: 2 additions & 2 deletions examples/launch_lammps_optimization_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from aiida.plugins import CalculationFactory
import numpy as np

from aiida_lammps.data.potential import EmpiricalPotential
from aiida_lammps.data.potential import LammpsEmpiricalPotential

if __name__ == "__main__":

Expand Down Expand Up @@ -101,7 +101,7 @@

# setup nodes
inputs.structure = structure
inputs.potential = EmpiricalPotential(
inputs.potential = LammpsEmpiricalPotential(
type=potential["pair_style"], data=potential["data"]
)

Expand Down
4 changes: 2 additions & 2 deletions examples/launch_lammps_optimization_lj.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from aiida.plugins import CalculationFactory
import numpy as np

from aiida_lammps.data.potential import EmpiricalPotential
from aiida_lammps.data.potential import LammpsEmpiricalPotential

if __name__ == "__main__":

Expand Down Expand Up @@ -88,7 +88,7 @@

# setup nodes
inputs.structure = structure
inputs.potential = EmpiricalPotential(
inputs.potential = LammpsEmpiricalPotential(
type=potential["pair_style"], data=potential["data"]
)

Expand Down
24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ docs = [
]

[project.entry-points."aiida.calculations"]
"lammps.base" = "aiida_lammps.calculations.lammps.base:BaseLammpsCalculation"
"lammps.combinate" = "aiida_lammps.calculations.lammps.combinate:CombinateCalculation"
"lammps.force" = "aiida_lammps.calculations.lammps.force:ForceCalculation"
"lammps.md" = "aiida_lammps.calculations.lammps.md:MdCalculation"
"lammps.md.multi" = "aiida_lammps.calculations.lammps.md_multi:MdMultiCalculation"
"lammps.optimize" = "aiida_lammps.calculations.lammps.optimize:OptimizeCalculation"
"lammps.base" = "aiida_lammps.calculations.lammps.base:LammpsBaseCalculation"
"lammps.combinate" = "aiida_lammps.calculations.lammps.combinate:LammpsCombinateCalculation"
"lammps.force" = "aiida_lammps.calculations.lammps.force:LammpsForceCalculation"
"lammps.md" = "aiida_lammps.calculations.lammps.md:LammpsMdCalculation"
"lammps.md.multi" = "aiida_lammps.calculations.lammps.md_multi:LammpsMdMultiCalculation"
"lammps.optimize" = "aiida_lammps.calculations.lammps.optimize:LammpsOptimizeCalculation"

[project.entry-points."aiida.parsers"]
"lammps.base" = "aiida_lammps.parsers.lammps.lammps_parser:LAMMPSBaseParser"
"lammps.force" = "aiida_lammps.parsers.lammps.force:ForceParser"
"lammps.md" = "aiida_lammps.parsers.lammps.md:MdParser"
"lammps.md.multi" = "aiida_lammps.parsers.lammps.md_multi:MdMultiParser"
"lammps.optimize" = "aiida_lammps.parsers.lammps.optimize:OptimizeParser"
"lammps.base" = "aiida_lammps.parsers.lammps.lammps_parser:LammpsBaseParser"
"lammps.force" = "aiida_lammps.parsers.lammps.force:LammpsForceParser"
"lammps.md" = "aiida_lammps.parsers.lammps.md:LammpsMdParser"
"lammps.md.multi" = "aiida_lammps.parsers.lammps.md_multi:LammpsMdMultiParser"
"lammps.optimize" = "aiida_lammps.parsers.lammps.optimize:LammpsOptimizeParser"

[project.entry-points."aiida.data"]
"lammps.potential" = "aiida_lammps.data.potential:EmpiricalPotential"
"lammps.potential" = "aiida_lammps.data.potential:LammpsEmpiricalPotential"
"lammps.lammps_potential" = "aiida_lammps.data.lammps_potential:LammpsPotentialData"
"lammps.trajectory" = "aiida_lammps.data.trajectory:LammpsTrajectory"

Expand Down
10 changes: 5 additions & 5 deletions tests/test_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ def test_lammps_base(


def test_lammps_base_script(generate_calc_job, aiida_local_code_factory):
"""Test the ``BaseLammpsCalculation`` with the ``script`` input."""
from aiida_lammps.calculations.lammps.base import BaseLammpsCalculation
"""Test the ``LammpsBaseCalculation`` with the ``script`` input."""
from aiida_lammps.calculations.lammps.base import LammpsBaseCalculation

inputs = {
"code": aiida_local_code_factory("lammps.base", "bash"),
Expand Down Expand Up @@ -722,7 +722,7 @@ def test_lammps_base_script(generate_calc_job, aiida_local_code_factory):

inputs["script"] = script
tmp_path, calc_info = generate_calc_job("lammps.base", inputs)
assert (tmp_path / BaseLammpsCalculation._INPUT_FILENAME).read_text() == content
assert (tmp_path / LammpsBaseCalculation._INPUT_FILENAME).read_text() == content


@pytest.mark.lammps_call
Expand Down Expand Up @@ -897,8 +897,8 @@ def test_lammps_base_settings_invalid(generate_calc_job, aiida_local_code_factor


def test_lammps_base_settings(generate_calc_job, aiida_local_code_factory):
"""Test the ``BaseLammpsCalculation`` with the ``settings`` input."""
from aiida_lammps.calculations.lammps.base import BaseLammpsCalculation
"""Test the ``LammpsBaseCalculation`` with the ``settings`` input."""
from aiida_lammps.calculations.lammps.base import LammpsBaseCalculation

inputs = {
"code": aiida_local_code_factory("lammps.base", "bash"),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_calculations/test_force_process_eam_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ results:
etotal: -8.2
temp: 0.0
force_units: eV/Angstrom
parser_class: ForceParser
parser_class: LammpsForceParser
units_style: metal
Loading