You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-70Lines changed: 76 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -5,76 +5,37 @@
5
5
6
6
Exabyte Property Extractor, Sourcer, Serializer (ExPreSS) is a Python package to extract material- and simulation-related properties and serialize them according to the Exabyte Data Convention (EDC) outlined in [Exabyte Source of Schemas and Examples (ESSE)](https://github.com/Exabyte-io/exabyte-esse).
7
7
8
-
## Functionality
8
+
## 1. Overview
9
9
10
-
As below:
10
+
The following Functionality is supported:
11
11
12
12
- Extract structural information, material properties and from simulation data
13
-
- Serialize extracted information according to ESSE/EDC
13
+
- Serialize extracted information according to [ESSE](#links) data standard
14
14
- Support for multiple simulation engines, including:
15
15
-[VASP](#links)
16
16
-[Quantum ESPRESSO](#links)
17
+
-[JARVIS](#links)
17
18
- others, to be added
18
19
19
20
The package is written in a modular way easy to extend for additional applications and properties of interest. Contributions can be in the form of additional [functionality](#todo-list) and [bug/issue reports](https://help.github.com/articles/creating-an-issue/).
20
21
21
-
## Architecture
22
-
23
-
The following diagram presents the package architecture. The package provides an [interface](express/__init__.py) to extract properties in EDC format. Inside the interface `Property` classes are initialized with a `Parser` (Vasp, Espresso, or Structure) depending on the given parameters through the parser factory. Each `Property` class implements required calls to `Parser` functions listed in these [Mixins Classes](express/parsers/mixins) to extract raw data either from the textual files, XML files or input files in string format and implements a serializer to form the final property according to the EDC format.
As explained above, ExPreSS parsers are responsible for extracting raw data from different sources such as data on the disk and provide the raw data to properties classes. In order to make sure all parsers implement the same interfaces and abstract properties classes from the parsers implementations, a set a [Mixin Classes](express/parsers/mixins) are provided which should be mixed with the parsers. The parsers must implement Mixins' abstract methods at the time of inheritance.
30
-
31
-
### Properties
32
-
33
-
ExPreSS properties classes are responsible to form the properties based on the raw data provided by the parsers and serialize the property according to EDC. A list of supported properties are available in [here](express/settings.py).
34
-
35
-
### Extractors
36
-
37
-
Extractors are classes that are composed with the parsers to extract raw data from the corresponding sources such as text or XML.
38
-
39
-
## Installation
22
+
## 2. Installation
40
23
41
24
ExPreSS can be installed as a Python package either via PyPi or the repository as below.
42
25
43
-
####PyPi
26
+
###2.1. From PyPi
44
27
45
28
```bash
46
-
pip install express
29
+
pip install express-py
47
30
```
48
31
49
-
#### Repository
32
+
###2.2. From GitHub repository
50
33
51
-
0. Install [git-lfs](https://help.github.com/articles/installing-git-large-file-storage/) in order to pull the files stored on Git LFS.
2. Install [virtualenv](https://virtualenv.pypa.io/en/stable/) using [pip](https://pip.pypa.io/en/stable/) if not already present:
60
-
61
-
```bash
62
-
pip install virtualenv
63
-
```
64
-
65
-
3. Create virtual environment and install required packages:
66
-
67
-
```bash
68
-
cd exabyte-express
69
-
virtualenv venv
70
-
source venv/bin/activate
71
-
export GIT_LFS_SKIP_SMUDGE=1
72
-
pip install -e PATH_TO_EXPRESS_REPOSITORY
73
-
```
74
-
75
-
## Usage
76
-
77
-
### Extract Total Energy
38
+
### 3.1. Extract Total Energy
78
39
79
40
The following example demonstrates how to initialize an ExPreSS class instance to extract and serialize total energy produced in a Quantum ESPRESSO calculation. The full path to the calculation directory (`work_dir`) and the file containing standard output (`stdout_file`) are required to be passed as arguments to the underlying Espresso parser.
In this example the final structure of a VASP calculation is extracted and is serialized to a material. The final structure is extracted from the `CONTCAR` file located in the calculation directory (`work_dir`). `is_final_structure=True` argument should be passed to the [Material Property](express/properties/material.py) class to let it know to extract final structure.
data = handler.property("material", is_final_structure=True, **kwargs)
76
+
print(json.dumps(data, indent=4))
114
77
115
78
```
116
79
117
-
### Extract Structure from Input
80
+
### 3.3. Extract Structure from input file
118
81
119
82
One can use [StructureParser](express/parsers/structure.py) to extract materials from POSCAR or PW input files. Please note that `StructureParser` class only works with strings and not files and therefore the input files should be read first and then passed to the parser.
3. Install [virtualenv](https://virtualenv.pypa.io/en/stable/) using [pip](https://pip.pypa.io/en/stable/) if not already present:
124
+
```bash
125
+
pip install virtualenv
126
+
```
127
+
4. Create virtual environment and install required packages:
128
+
```bash
129
+
cd express
130
+
virtualenv venv
131
+
source venv/bin/activate
132
+
export GIT_LFS_SKIP_SMUDGE=1
133
+
pip install -e PATH_TO_EXPRESS_REPOSITORY
134
+
```
135
+
136
+
### 4.2. Tests
151
137
152
138
There are two types of tests in ExPreSS: unit and integration, implemented in [Python Unit Testing Framework](https://docs.python.org/2/library/unittest.html).
153
139
154
-
### Unit Tests
140
+
#### 4.2.1. Unit Tests
155
141
156
142
Unit tests are used to assert properties are serialized according to EDC. Properties classes are initialized with mocked parser data and then are serialized to assert functionality.
157
143
158
-
### Integration Tests
144
+
#### 4.2.2. Integration Tests
159
145
160
146
Parsers functionality is tested through integration tests. The parsers are initialized with the configuration specified in the [Tests Manifest](./tests/manifest.yaml) and then the functionality is asserted.
161
147
162
-
### Run Tests
148
+
#### 4.2.3. Running Tests
163
149
164
150
> Note that the CI tests are run using a github action in`.github`, and not using the script below, so there could be discrepancies.
165
151
166
-
Run the following commands to run the tests.
152
+
Run the following commands to run the tests ("unit" tests only in this case).
The following diagram presents the package architecture. The package provides an [interface](express/__init__.py) to extract properties in EDC format. Inside the interface `Property` classes are initialized with a `Parser` (Vasp, Espresso, or Structure) depending on the given parameters through the parser factory. Each `Property` class implements required calls to `Parser` functions listed in these [Mixins Classes](express/parsers/mixins) to extract raw data either from the textual files, XML files or input files in string format and implements a serializer to form the final property according to the EDC format.
As explained above, ExPreSS parsers are responsible for extracting raw data from different sources such as data on the disk and provide the raw data to properties classes. In order to make sure all parsers implement the same interfaces and abstract properties classes from the parsers implementations, a set a [Mixin Classes](express/parsers/mixins) are provided which should be mixed with the parsers. The parsers must implement Mixins' abstract methods at the time of inheritance.
167
+
168
+
### 5.2. Properties
169
+
170
+
ExPreSS properties classes are responsible to form the properties based on the raw data provided by the parsers and serialize the property according to EDC. A list of supported properties are available in [here](express/settings.py).
171
+
172
+
### 5.3. Extractors
173
+
174
+
Extractors are classes that are composed with the parsers to extract raw data from the corresponding sources such as text or XML.
175
+
176
+
177
+
## 6. Contribution
174
178
175
179
This repository is an [open-source](LICENSE.md) work-in-progress and we welcome contributions. We suggest forking this repository and introducing the adjustments there. The changes in the fork can further be considered for merging into this repository as explained in [GitHub Standard Fork and Pull Request Workflow](https://gist.github.com/Chaser324/ce0505fbed06b947d962).
176
180
177
-
## TODO list
181
+
182
+
## 7. TODO list
178
183
179
184
Desirable features for implementation:
180
185
@@ -187,3 +192,4 @@ Desirable features for implementation:
187
192
1. [Excellent Source of Schemas and Examples (ESSE), Github Repository](https://github.com/exabyte-io/esse)
188
193
1. [Vienna Ab-initio Simulation Package (VASP), official website](https://cms.mpi.univie.ac.at/vasp/)
189
194
1. [Quantum ESPRESSO, Official Website](https://www.quantum-espresso.org/)
0 commit comments