Skip to content

Commit 5697df0

Browse files
Add Readme (#2)
* Add Readme * black * fix CI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * more fixes * fix project --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 58c35ba commit 5697df0

File tree

12 files changed

+235
-197
lines changed

12 files changed

+235
-197
lines changed

.github/workflows/format_black.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will checkout the branch of the PR, apply black formatting and commit the result to the PR. Does not work for forks.
2+
3+
name: Format black
4+
5+
on:
6+
pull_request:
7+
types: [labeled]
8+
9+
jobs:
10+
build:
11+
if: contains(github.event.pull_request.labels.*.name, 'format_black' )
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
17+
ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR
18+
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
19+
- name: format black
20+
uses: psf/black@stable
21+
with:
22+
options: ""
23+
src: "./${{ github.event.repository.name }}"
24+
- name: commit
25+
run: |
26+
git config --local user.email "pyiron@mpie.de"
27+
git config --local user.name "pyiron-runner"
28+
git commit -m "Format black" -a
29+
- name: push
30+
uses: ad-m/github-push-action@master
31+
with:
32+
github_token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }}
33+
branch: ${{ github.event.pull_request.head.ref }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2018, Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
3+
Copyright (c) 2024, Jan Janssen
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Dataclasses for pyiron
2+
The `pyiron_dataclasses` module provides a series of [dataclasses](https://docs.python.org/3/library/dataclasses.html)
3+
for the `pyiron` workflow framework. It can load HDF5 files created by `pyiron_atomistics` and read the content stored
4+
in those files, without depending on `pyiron_atomistics`. Furthermore, it is not fixed to a single version of
5+
`pyiron_atomistics` but rather matches multiple versions of `pyiron_atomistics` to the same API version of
6+
`pyiron_dataclasses`.
7+
8+
## Usage
9+
Using the `get_dataclass()` function of the built-in converter:
10+
```python
11+
from h5io_browser import read_dict_from_hdf
12+
from pyiron_dataclasses.v1.converter import get_dataclass
13+
14+
job_classes = get_dataclass(
15+
job_dict=read_dict_from_hdf(
16+
file_name=job.project_hdf5.file_name,
17+
h5_path="/",
18+
recursive=True,
19+
slash='ignore',
20+
)[job.job_name]
21+
)
22+
job_classes
23+
```
24+
25+
## Supported Versions
26+
### Version 1 - `v1`
27+
Supported versions of `pyiron_atomistics`:
28+
* `0.6.13`
29+
* `0.6.12`

pyiron_dataclasses/v1/atomistic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from dataclasses import dataclass
2+
from typing import List, Optional
3+
24
import numpy as np
3-
from typing import Optional, List
5+
46
from pyiron_dataclasses.v1.dft import OutputGenericDFT
57

68

0 commit comments

Comments
 (0)