Skip to content

Commit 5af05b3

Browse files
committed
initial commit
0 parents  commit 5af05b3

File tree

16 files changed

+760
-0
lines changed

16 files changed

+760
-0
lines changed

.github/workflows/black.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This workflow is used to check the differences and find conflict markers or whitespace errors
2+
3+
name: Black
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: psf/black@stable
16+
with:
17+
options: "--check --diff"
18+
src: ./${{ github.event.repository.name }}

.github/workflows/deploy.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow is used to upload and deploy a new release to PyPi
2+
# Based on https://github.com/pypa/gh-action-pypi-publish
3+
4+
name: PyPi Release
5+
6+
on:
7+
push:
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
14+
runs-on: ubuntu-latest
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/${{ github.event.repository.name }}
18+
permissions:
19+
id-token: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Build
23+
shell: bash -l {0}
24+
run: |
25+
pip install versioneer[toml]==0.29
26+
python setup.py sdist bdist_wheel
27+
- name: Publish distribution 📦 to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.6.8
4+
hooks:
5+
- id: ruff
6+
name: ruff lint
7+
args: ["--select", "I", "--fix"]
8+
files: ^pyiron_dataclasses/
9+
- id: ruff-format
10+
name: ruff format

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at pyiron@mpie.de. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2018, Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include LICENSE

pyiron_dataclasses/__init__.py

Whitespace-only changes.

pyiron_dataclasses/v1/__init__.py

Whitespace-only changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from dataclasses import dataclass
2+
from typing import List, Optional, Union
3+
4+
5+
@dataclass
6+
class CalculateMolecularDynamics:
7+
temperature: float
8+
pressure: Optional[Union[float, List[float]]]
9+
n_ionic_steps: int
10+
time_step: float
11+
n_print: int
12+
temperature_damping_timescale: float
13+
pressure_damping_timescale: float
14+
seed: Optional[int]
15+
tloop: Optional[float]
16+
initial_temperature: Optional[float]
17+
langevin: bool
18+
delta_temp: Optional[float]
19+
delta_press: Optional[float]
20+
21+
22+
@dataclass
23+
class CalculateMinimize:
24+
ionic_energy_tolerance: float
25+
ionic_force_tolerance: float
26+
e_tol: Optional[float]
27+
f_tol: Optional[float]
28+
max_iter: int
29+
pressure: Optional[Union[float, List[float]]]
30+
n_print: int
31+
style: str

pyiron_dataclasses/v1/generic.py

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
from dataclasses import dataclass
2+
import numpy as np
3+
from typing import Optional, List
4+
5+
6+
@dataclass
7+
class DensityOfStates:
8+
energies: str
9+
int_densities: str
10+
tot_densities: str
11+
12+
13+
@dataclass
14+
class ElectronicStructure:
15+
efermi: float
16+
eig_matrix: np.ndarray
17+
k_points: np.ndarray
18+
k_weights: np.ndarray
19+
occ_matrix: np.ndarray
20+
dos: DensityOfStates
21+
22+
23+
@dataclass
24+
class OutputGenericDFT:
25+
energy_free: np.ndarray
26+
energy_int: np.ndarray
27+
energy_zero: np.ndarray
28+
scf_energy_free: np.ndarray
29+
scf_energy_int: np.ndarray
30+
scf_energy_zero: np.ndarray
31+
cbm_list: Optional[np.ndarray]
32+
e_fermi_list: Optional[np.ndarray]
33+
final_magmoms: Optional[np.ndarray]
34+
magnetization: Optional[np.ndarray]
35+
n_elect: Optional[float]
36+
n_valence: Optional[dict]
37+
potentiostat_output: Optional[np.ndarray]
38+
bands_k_weights: Optional[np.ndarray]
39+
kpoints_cartesian: Optional[np.ndarray]
40+
bands_e_fermi: Optional[np.ndarray]
41+
bands_occ: Optional[np.ndarray]
42+
bands_eigen_values: Optional[np.ndarray]
43+
scf_convergence: Optional[List[bool]]
44+
scf_dipole_mom: Optional[np.ndarray]
45+
scf_computation_time: Optional[np.ndarray]
46+
valence_charges: Optional[np.ndarray]
47+
vbm_list: Optional[np.ndarray]
48+
bands: Optional[ElectronicStructure]
49+
scf_energy_band: Optional[np.ndarray]
50+
scf_electronic_entropy: Optional[np.ndarray]
51+
scf_residue: Optional[np.ndarray]
52+
computation_time: Optional[np.ndarray]
53+
energy_band: Optional[np.ndarray]
54+
electronic_entropy: Optional[np.ndarray]
55+
residue: Optional[np.ndarray]
56+
57+
58+
@dataclass
59+
class GenericOutput:
60+
cells: np.ndarray # N_steps * 3 *3 [Angstrom]
61+
energy_pot: np.ndarray # N_steps [eV]
62+
energy_tot: np.ndarray # N_steps [eV]
63+
forces: np.ndarray # N_steps * N_atoms * 3 [eV/Angstrom]
64+
positions: np.ndarray # N_steps * N_atoms * 3 [Angstrom]
65+
volume: np.ndarray # N_steps
66+
indices: Optional[np.ndarray] # N_steps * N_atoms
67+
natoms: Optional[np.ndarray] # N_steps
68+
pressures: Optional[np.ndarray] # N_steps * 3 * 3
69+
steps: Optional[np.ndarray] # N_steps
70+
stresses: Optional[np.ndarray] # N_steps
71+
temperature: Optional[np.ndarray] # N_steps
72+
unwrapped_positions: Optional[np.ndarray] # N_steps * N_atoms * 3 [Angstrom]
73+
velocities: Optional[np.ndarray] # N_steps * N_atoms * 3 [Angstrom/fs]
74+
dft: Optional[OutputGenericDFT]
75+
elastic_constants: Optional[np.ndarray]
76+
77+
78+
@dataclass
79+
class ChargeDensity:
80+
total: np.ndarray
81+
82+
83+
@dataclass
84+
class Server:
85+
user: str
86+
host: str
87+
run_mode: str
88+
cores: int
89+
threads: int
90+
new_h5: bool
91+
accept_crash: bool
92+
run_time: int # [seconds]
93+
structure_id: Optional[int]
94+
memory_limit: Optional[str]
95+
queue: Optional[str]
96+
qid: Optional[int]
97+
98+
99+
@dataclass
100+
class Executable:
101+
version: str
102+
name: str
103+
operation_system_nt: bool
104+
executable: Optional[str]
105+
mpi: bool
106+
accepted_return_codes: List[int]
107+
108+
109+
@dataclass
110+
class GenericDict:
111+
restart_file_list: list
112+
restart_file_dict: dict
113+
exclude_nodes_hdf: list
114+
exclude_groups_hdf: list
115+
116+
117+
@dataclass
118+
class Interactive:
119+
interactive_flush_frequency: int
120+
interactive_write_frequency: int
121+
122+
123+
@dataclass
124+
class GenericInput:
125+
calc_mode: str
126+
structure: str
127+
fix_symmetry: Optional[bool]
128+
k_mesh_spacing: Optional[float]
129+
k_mesh_center_shift: Optional[np.ndarray]
130+
reduce_kpoint_symmetry: Optional[bool]
131+
restart_for_band_structure: Optional[bool]
132+
path_name: Optional[str]
133+
n_path: Optional[str]
134+
fix_spin_constraint: Optional[bool]
135+
max_iter: Optional[int]
136+
temperature: Optional[float]
137+
n_ionic_steps: Optional[int]
138+
n_print: Optional[int]
139+
temperature_damping_timescale: Optional[float]
140+
pressure_damping_timescale: Optional[float]
141+
time_step: Optional[int]
142+
143+
144+
@dataclass
145+
class Units:
146+
length: str
147+
mass: str
148+
149+
150+
@dataclass
151+
class Cell:
152+
cell: np.ndarray # 3 * 3 [Angstrom]
153+
pbc: np.ndarray # 3
154+
155+
156+
@dataclass
157+
class Structure:
158+
dimension: int
159+
indices: np.array
160+
info: dict
161+
positions: np.ndarray # N_atoms * 3 [Angstrom]
162+
species: List[str]
163+
cell: Cell
164+
units: Units

0 commit comments

Comments
 (0)