Skip to content

Commit b8c940b

Browse files
author
Guillaume Fraux
committed
Update to latest master
1 parent 7548389 commit b8c940b

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ authors = ["Guillaume Fraux <[email protected]>"]
55
build = "build.rs"
66

77
[dependencies]
8-
lumol = {git = "https://github.com/lumol-org/lumol", rev = "11503ea"}
9-
cpython = {git = "https://github.com/dgrunwald/rust-cpython/", rev = "1129131"}
8+
lumol-core = {git = "https://github.com/lumol-org/lumol", rev = "788c94e"}
9+
cpython = {git = "https://github.com/dgrunwald/rust-cpython/", rev = "4773d2e3"}
1010

1111
[lib]
1212
crate-type = ["cdylib"]

src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#![allow(non_upper_case_globals)]
2+
3+
py_exception!(lumol, LumolError);

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
#![allow(unknown_lints, clippy)]
2+
13
#[macro_use]
24
extern crate cpython;
35
extern crate lumol;
46

57
#[macro_use]
68
mod macros;
79
mod systems;
8-
9-
py_exception!(lumol, LumolError);
10+
mod error;
1011

1112
py_module_initializer!(lumol, initlumol, PyInit_lumol, |py, m| {
1213
try!(m.add(py, "__doc__", "Modern and extensible molecular simulation engine"));

src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def assert_raises(callable, *args, **kwargs):
2323
locals.set_item($py, stringify!($obj), $obj).unwrap();
2424

2525
let globals = PyDict::new($py);
26-
let error = $py.get_type::<::LumolError>();
26+
let error = $py.get_type::<$crate::error::LumolError>();
2727
globals.set_item($py, "LumolError", error).unwrap();
2828

2929
py_run!($py, globals, locals, ASSERT_RAISES_PY);
@@ -54,6 +54,6 @@ macro_rules! register {
5454

5555
macro_rules! raise {
5656
($py: ident, $args: expr) => ({
57-
Err(PyErr::new::<LumolError, _>($py, $args))
57+
Err(PyErr::new::<$crate::error::LumolError, _>($py, $args))
5858
});
5959
}

src/systems/particle.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
use cpython::{PyObject, PyErr, PyResult, PyTuple, ToPyObject, PythonObject};
22
use lumol;
3-
use lumol::Vector3D;
3+
use lumol::types::Vector3D;
44
use std::cell::RefCell;
55

6-
use LumolError;
7-
86
register!(|py, m| {
97
try!(m.add_class::<Particle>(py));
108
Ok(())
119
});
1210

1311
py_class!(class Particle |py| {
14-
data particle: RefCell<lumol::Particle>;
12+
data particle: RefCell<lumol::sys::Particle>;
1513
def __new__(_cls, name: &str) -> PyResult<Particle> {
16-
Particle::create_instance(py, RefCell::new(lumol::Particle::new(name)))
14+
Particle::create_instance(py, RefCell::new(lumol::sys::Particle::new(name)))
1715
}
1816

1917
def name(&self) -> PyResult<String> {

0 commit comments

Comments
 (0)