Skip to content

Commit 7130e78

Browse files
committed
add cubic, user_defined and fmt to feos
1 parent 1974cb7 commit 7130e78

2 files changed

Lines changed: 39 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
[package]
22
name = "feos"
33
version = "0.1.0"
4+
authors = ["Gernot Bauer <bauer@itt.uni-stuttgart.de>", "Philipp Rehner <rehner@itt.uni-stuttgart.de>"]
45
edition = "2018"
56

6-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
[lib]
8+
crate-type = ["cdylib"]
79

810
[dependencies]
11+
quantity = "0.3"
12+
feos-core = { git = "https://github.com/feos-org/feos-core", branch = "main" }
13+
feos-dft = { git = "https://github.com/feos-org/feos-dft", branch = "main", features = ["python", "openblas-system"] }
14+
15+
[dependencies.pyo3]
16+
version = "0.14"
17+
features = ["extension-module", "abi3", "abi3-py36"]

src/lib.rs

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
1-
#[cfg(test)]
2-
mod tests {
3-
#[test]
4-
fn it_works() {
5-
assert_eq!(2 + 2, 4);
6-
}
1+
use feos_core::python::{PyInit_cubic, PyInit_user_defined};
2+
use feos_dft::python::PyInit_feos_dft;
3+
use pyo3::prelude::*;
4+
use pyo3::wrap_pymodule;
5+
use quantity::python::PyInit_quantity;
6+
7+
#[pymodule]
8+
pub fn feos(py: Python<'_>, m: &PyModule) -> PyResult<()> {
9+
m.add_wrapped(wrap_pymodule!(quantity))?;
10+
11+
m.add_wrapped(wrap_pymodule!(user_defined))?;
12+
m.add_wrapped(wrap_pymodule!(cubic))?;
13+
14+
m.add_wrapped(wrap_pymodule!(feos_dft))?;
15+
16+
py.run(
17+
"\
18+
import sys
19+
sys.modules['feos.si'] = quantity
20+
21+
sys.modules['feos.user_defined'] = user_defined
22+
sys.modules['feos.cubic'] = cubic
23+
24+
sys.modules['feos.fmt'] = feos_dft
25+
",
26+
None,
27+
Some(m.dict()),
28+
)?;
29+
Ok(())
730
}

0 commit comments

Comments
 (0)