# ExPreSS
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).
## Functionality
As below:
- Extract structural information, material properties and from simulation data
- Serialize extracted information according to ESSE/EDC
- Support for multiple simulation engines, including:
- [VASP](#links)
- [Quantum ESPRESSO](#links)
- others, to be added
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/).
## Architecture
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.
![ExPreSS](https://user-images.githubusercontent.com/10528238/53124591-9958e700-3510-11e9-9222-3aedacfd7943.png)
### Parsers
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.
### Properties
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).
### Extractors
Extractors are classes that are composed with the parsers to extract raw data from the corresponding sources such as text or XML.
## Installation
ExPreSS can be installed as a Python package either via PyPi or the repository as below.
#### PyPi
```bash
pip install express
```
#### Repository
0. Install [git-lfs](https://help.github.com/articles/installing-git-large-file-storage/) in order to pull the files stored on Git LFS.
1. Clone repository:
```bash
git clone git@github.com:Exabyte-io/exabyte-express.git
```
2. Install [virtualenv](https://virtualenv.pypa.io/en/stable/) using [pip](https://pip.pypa.io/en/stable/) if not already present:
```bash
pip install virtualenv
```
3. Create virtual environment and install required packages:
```bash
cd exabyte-express
virtualenv venv
source venv/bin/activate
export GIT_LFS_SKIP_SMUDGE=1
pip install -e PATH_TO_EXPRESS_REPOSITORY
```
## Usage
### Extract Total Energy
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.
```python
import json
from express import ExPrESS
kwargs = {
"work_dir": "./tests/fixtures/espresso/test-001",
"stdout_file": "./tests/fixtures/espresso/test-001/pw-scf.out"
}
express_ = ExPrESS("espresso", **kwargs)
print json.dumps(express_.property("total_energy"), indent=4)
```
### Extract Relaxed Structure
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.
```python
import json
from express import ExPrESS
kwargs = {
"work_dir": "./tests/fixtures/vasp/test-001",
"stdout_file": "./tests/fixtures/vasp/test-001/vasp.out"
}
express_ = ExPrESS("vasp", **kwargs)
print json.dumps(express_.property("material", is_final_structure=True), indent=4)
```
### Extract Structure from Input
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.
```python
import json
from express import ExPrESS
with open("./tests/fixtures/vasp/test-001/POSCAR") as f:
poscar = f.read()
kwargs = {
"structure_string": poscar,
"structure_format": "poscar"
}
express_ = ExPrESS("structure", **kwargs)
print json.dumps(express_.property("material"), indent=4)
with open("./tests/fixtures/espresso/test-001/pw-scf.in") as f:
pwscf_input = f.read()
kwargs = {
"structure_string": pwscf_input,
"structure_format": "espresso-in"
}
express_ = ExPrESS("structure", **kwargs)
print json.dumps(express_.property("material"), indent=4)
```
## Tests
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).
### Unit Tests
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.
### Integration Tests
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.
### Run Tests
Run the following command to run the tests.
```bash
sh run-tests.sh
```
## Contribution
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).
## TODO list
Desirable features for implementation:
- Add support for other properties
- Add support for other types of applications, parsers and extractors
- other (TBA)
## Links
1. [Exabyte Source of Schemas and Examples (ESSE), Github Repository](https://github.com/exabyte-io/exabyte-esse)
1. [Vienna Ab-initio Simulation Package (VASP), official website](https://cms.mpi.univie.ac.at/vasp/)
1. [Quantum ESPRESSO, Official Website](https://www.quantum-espresso.org/)
没有合适的资源?快使用搜索试试~ 我知道了~
PyPI 官网下载 | express-py-2.3.2.tar.gz
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 11 浏览量
2022-01-11
05:34:48
上传
评论
收藏 37KB GZ 举报
温馨提示
共72个文件
py:64个
txt:4个
pkg-info:2个
资源来自pypi官网。 资源全名:express-py-2.3.2.tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
express-py-2.3.2.tar.gz (72个子文件)
express-py-2.3.2
PKG-INFO 522B
express
properties
convergence
electronic.py 492B
__init__.py 0B
ionic.py 472B
utils.py 813B
material.py 6KB
non_scalar
bandgaps.py 6KB
two_dimensional_plot
potential_profile.py 518B
reaction_energy_profile.py 455B
band_structure.py 2KB
density_of_states.py 766B
__init__.py 811B
phonon_dispersions.py 567B
charge_density_profile.py 507B
phonon_dos.py 497B
__init__.py 272B
atomic_constraints.py 510B
atomic_forces.py 574B
stress_tensor.py 499B
symmetry.py 577B
total_energy_contributions.py 533B
magnetic_moments.py 506B
__init__.py 1KB
workflow.py 9KB
scalar
fermi_energy.py 347B
elemental_ratio.py 512B
volume.py 294B
density.py 298B
total_force.py 313B
surface_energy.py 260B
p_norm.py 640B
total_energy.py 326B
__init__.py 489B
reaction_energy_barrier.py 417B
pressure.py 302B
zero_point_energy.py 334B
__init__.py 3KB
settings.py 4KB
parsers
exabyteml.py 1KB
formats
xml.py 590B
__init__.py 0B
txt.py 2KB
utils.py 424B
structure.py 8KB
mixins
exabyteml.py 561B
electronic.py 6KB
__init__.py 0B
ionic.py 9KB
reciprocal.py 828B
__init__.py 547B
settings.py 1KB
apps
vasp
formats
xml.py 14KB
__init__.py 0B
txt.py 10KB
parser.py 8KB
__init__.py 0B
settings.py 3KB
espresso
formats
xml.py 7KB
__init__.py 0B
txt.py 29KB
parser.py 9KB
__init__.py 0B
settings.py 6KB
__init__.py 0B
express_py.egg-info
PKG-INFO 522B
requires.txt 99B
SOURCES.txt 3KB
top_level.txt 8B
dependency_links.txt 1B
setup.cfg 38B
setup.py 814B
README.md 7KB
共 72 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- [其他类别]256色BMP图片验证码识别脚本_validpic.rar
- 微信小程序设计(含源代码+解释文档)之简单demo.zip
- 微信小程序设计(含源代码+解释文档)之o2o行业.zip
- ixchariot-endpoints-apk
- 数码管闪烁_单片机C语言实例(纯C语言源代码).zip
- matlab基于IEEE802.11a协议,OFDM加高斯白噪声的符号定时同步
- 数学建模与数学实验课件14讲含源程序_第8讲 最短路问题.zip
- matlab用于HDB3的编解码,用matlab仿真,有完整的程序.zip
- [影音娱乐]冰冰音乐程序商业版_bbyy.rar
- OpenGL 3D立方体多纹理贴图.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功