Skip to content

Commit

Permalink
Merge pull request #56 from pyiron/easy_import
Browse files Browse the repository at this point in the history
Simplify import
  • Loading branch information
jan-janssen authored Nov 14, 2023
2 parents bd74a0f + 567e5f5 commit d031104
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 38 deletions.
10 changes: 10 additions & 0 deletions atomistics/calculators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from atomistics.calculators.ase import evaluate_with_ase

try:
from atomistics.calculators.lammps import (
evaluate_with_lammps,
evaluate_with_lammps_library,
get_potential_dataframe,
)
except ImportError:
pass
9 changes: 9 additions & 0 deletions atomistics/workflows/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from atomistics.workflows.elastic.workflow import ElasticMatrixWorkflow
from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.workflows.langevin.workflow import LangevinWorkflow
from atomistics.workflows.phonons.workflow import PhonopyWorkflow
from atomistics.workflows.quasiharmonic.workflow import QuasiHarmonicWorkflow
from atomistics.workflows.structure_optimization.workflow import (
optimize_positions,
optimize_positions_and_volume,
)
4 changes: 2 additions & 2 deletions tests/test_elastic_emt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import numpy as np
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.elastic.workflow import ElasticMatrixWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import ElasticMatrixWorkflow


class TestElastic(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_elastic_gpaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import numpy as np
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.elastic.workflow import ElasticMatrixWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import ElasticMatrixWorkflow

try:
from gpaw import GPAW, PW
Expand Down
5 changes: 2 additions & 3 deletions tests/test_elastic_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
import numpy as np
import unittest

from atomistics.workflows.elastic.workflow import ElasticMatrixWorkflow
from atomistics.workflows.structure_optimization.workflow import optimize_positions_and_volume
from atomistics.workflows import ElasticMatrixWorkflow, optimize_positions_and_volume

try:
from atomistics.calculators.lammps import (
from atomistics.calculators import (
evaluate_with_lammps, get_potential_dataframe
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_evcurve_abinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from ase.units import Ry
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import EnergyVolumeCurveWorkflow


if shutil.which("abinit") is not None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_evcurve_emt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import numpy as np
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import EnergyVolumeCurveWorkflow


class TestEvCurve(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_evcurve_gpaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import numpy as np
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import EnergyVolumeCurveWorkflow


try:
Expand Down
5 changes: 2 additions & 3 deletions tests/test_evcurve_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import numpy as np
import unittest

from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.workflows.structure_optimization.workflow import optimize_positions_and_volume
from atomistics.workflows import EnergyVolumeCurveWorkflow, optimize_positions_and_volume


try:
from atomistics.calculators.lammps import (
from atomistics.calculators import (
evaluate_with_lammps, get_potential_dataframe
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_evcurve_qe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from ase.calculators.espresso import Espresso
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import EnergyVolumeCurveWorkflow


quantum_espresso_command = "pw.x"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_evcurve_siesta.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from ase.units import Ry
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.evcurve.workflow import EnergyVolumeCurveWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import EnergyVolumeCurveWorkflow


siesta_command = "siesta"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_langevin_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import numpy as np
import unittest

from atomistics.workflows.langevin.workflow import LangevinWorkflow
from atomistics.workflows import LangevinWorkflow


try:
from atomistics.calculators.lammps import (
from atomistics.calculators import (
evaluate_with_lammps_library, get_potential_dataframe, LammpsASELibrary
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_optimize_positions_emt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from ase.optimize import BFGS
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.structure_optimization.workflow import optimize_positions
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import optimize_positions


class TestOptimizePositionsEMT(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_optimize_positions_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import numpy as np
import unittest

from atomistics.workflows.structure_optimization.workflow import optimize_positions
from atomistics.workflows import optimize_positions

try:
from atomistics.calculators.lammps import (
from atomistics.calculators import (
evaluate_with_lammps, get_potential_dataframe
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_phonons_emt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from phonopy.units import VaspToTHz
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.phonons.workflow import PhonopyWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import PhonopyWorkflow


class TestPhonons(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_phonons_gpaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from phonopy.units import VaspToTHz
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.phonons.workflow import PhonopyWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import PhonopyWorkflow

try:
from gpaw import GPAW, PW
Expand Down
5 changes: 2 additions & 3 deletions tests/test_phonons_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
from phonopy.units import VaspToTHz
import unittest

from atomistics.workflows.phonons.workflow import PhonopyWorkflow
from atomistics.workflows.structure_optimization.workflow import optimize_positions_and_volume
from atomistics.workflows import PhonopyWorkflow, optimize_positions_and_volume

try:
from atomistics.calculators.lammps import (
from atomistics.calculators import (
evaluate_with_lammps, get_potential_dataframe
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_quasiharmonic_emt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from phonopy.units import VaspToTHz
import unittest

from atomistics.calculators.ase import evaluate_with_ase
from atomistics.workflows.quasiharmonic.workflow import QuasiHarmonicWorkflow
from atomistics.calculators import evaluate_with_ase
from atomistics.workflows import QuasiHarmonicWorkflow


class TestPhonons(unittest.TestCase):
Expand Down
5 changes: 2 additions & 3 deletions tests/test_quasiharmonic_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
from phonopy.units import VaspToTHz
import unittest

from atomistics.workflows.quasiharmonic.workflow import QuasiHarmonicWorkflow
from atomistics.workflows.structure_optimization.workflow import optimize_positions_and_volume
from atomistics.workflows import QuasiHarmonicWorkflow, optimize_positions_and_volume

try:
from atomistics.calculators.lammps import (
from atomistics.calculators import (
evaluate_with_lammps, get_potential_dataframe
)

Expand Down

0 comments on commit d031104

Please sign in to comment.