Skip to content

Commit 07114e3

Browse files
Implement high level import (#65)
* Implement high level import * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 23d393b commit 07114e3

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ in those files, without depending on `pyiron_atomistics`. Furthermore, it is not
1212
Using the `get_dataclass()` function of the built-in converter:
1313
```python
1414
from h5io_browser import read_dict_from_hdf
15-
from pyiron_dataclasses.v1.converter import get_dataclass
15+
from pyiron_dataclasses import get_dataclass_v1
1616

1717
job_classes = get_dataclass(
1818
job_dict=read_dict_from_hdf(

pyiron_dataclasses/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import pyiron_dataclasses._version
2+
from pyiron_dataclasses.v1.converter import get_dataclass as get_dataclass_v1
23

34
__version__ = pyiron_dataclasses._version.__version__
5+
__all__ = ["get_dataclass_v1"]

tests/test_pyiron_atomistics_live.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from h5io_browser import read_dict_from_hdf
44
from pint import UnitRegistry
55

6-
from pyiron_dataclasses.v1.converter import get_dataclass
6+
from pyiron_dataclasses import get_dataclass_v1
77

88
try:
99
from pyiron_atomistics import Project
@@ -44,7 +44,7 @@ def test_sphinx_calc_minimize(self):
4444
recursive=True,
4545
slash="ignore",
4646
)
47-
job_sphinx = get_dataclass(job_dict[job.job_name])
47+
job_sphinx = get_dataclass_v1(job_dict[job.job_name])
4848
self.assertEqual(
4949
job_sphinx.calculation_output.generic.energy_tot[-1],
5050
-228.78315943858593 * ureg.eV,
@@ -61,7 +61,7 @@ def test_sphinx_calc_static(self):
6161
recursive=True,
6262
slash="ignore",
6363
)
64-
job_sphinx = get_dataclass(job_dict[job.job_name])
64+
job_sphinx = get_dataclass_v1(job_dict[job.job_name])
6565
self.assertEqual(
6666
job_sphinx.calculation_output.generic.energy_tot[-1],
6767
-228.78316094884508 * ureg.eV,
@@ -79,7 +79,7 @@ def test_lammps_calc_static(self):
7979
recursive=True,
8080
slash="ignore",
8181
)
82-
job_lammps = get_dataclass(job_dict[job.job_name])
82+
job_lammps = get_dataclass_v1(job_dict[job.job_name])
8383
self.assertEqual(
8484
job_lammps.calculation_output.generic.energy_tot[-1],
8585
-13.4486826111902 * ureg.eV,
@@ -97,7 +97,7 @@ def test_lammps_calc_md(self):
9797
recursive=True,
9898
slash="ignore",
9999
)
100-
job_lammps = get_dataclass(job_dict[job.job_name])
100+
job_lammps = get_dataclass_v1(job_dict[job.job_name])
101101
self.assertEqual(len(job_lammps.calculation_output.generic.energy_tot), 11)
102102

103103
def test_lammps_calc_minimize(self):
@@ -112,7 +112,7 @@ def test_lammps_calc_minimize(self):
112112
recursive=True,
113113
slash="ignore",
114114
)
115-
job_lammps = get_dataclass(job_dict[job.job_name])
115+
job_lammps = get_dataclass_v1(job_dict[job.job_name])
116116
self.assertEqual(
117117
job_lammps.calculation_output.generic.energy_tot[-1],
118118
-13.4486826111902 * ureg.eV,
@@ -130,7 +130,7 @@ def test_murnaghan_lammps(self):
130130
recursive=True,
131131
slash="ignore",
132132
)
133-
job_murn = get_dataclass(job_dict[murn.job_name])
133+
job_murn = get_dataclass_v1(job_dict[murn.job_name])
134134
self.assertEqual(
135135
job_murn.calculation_output.equilibrium_bulk_modulus,
136136
81.0404454580153,

tests/test_pyiron_atomistics_static.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
from h5io_browser import read_dict_from_hdf
55
from pint import UnitRegistry
66

7-
from pyiron_dataclasses.v1.converter import (
8-
get_dataclass,
9-
)
7+
from pyiron_dataclasses import get_dataclass_v1
108

119

1210
class TestPyironAtomisticsStatic(TestCase):
@@ -29,14 +27,14 @@ def test_all(self):
2927
)[hdf5_file.split(".")[0]]
3028
if hdf5_file in ["sx.h5", "lmp.h5", "vasp.h5"]:
3129
self.assertEqual(
32-
get_dataclass(
30+
get_dataclass_v1(
3331
job_dict=job_dict
3432
).calculation_output.generic.energy_tot[-1],
3533
energy_dict[hdf5_file],
3634
)
3735
elif hdf5_file == "murn.h5":
3836
self.assertEqual(
39-
get_dataclass(
37+
get_dataclass_v1(
4038
job_dict=job_dict
4139
).calculation_output.equilibrium_bulk_modulus,
4240
81.04044545801592,

0 commit comments

Comments
 (0)