Skip to content

Commit

Permalink
feat: Use pyo3-log to pass log output from Rust to Python.
Browse files Browse the repository at this point in the history
  • Loading branch information
jetuk committed Feb 10, 2024
1 parent c19b37b commit a05733d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ ndarray = "0.15.3"
polars = { version = "0.37.0", features = ["lazy", "rows", "ndarray"] }
pyo3-polars = "0.11.1"
pyo3 = { version = "0.20.2" }
tracing = "0.1"
pyo3-log = "0.9.0"
tracing = { version ="0.1", features = ["log"] }
csv = "1.1"
hdf5 = { version="0.8.1" }
hdf5-sys = { version="0.8.1", features=["static"] }
Expand Down
1 change: 1 addition & 0 deletions pywr-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ categories = ["science", "simulation"]
[dependencies]
pyo3 = { workspace = true }
pyo3-polars = { workspace = true }
pyo3-log = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
time = { workspace = true, features = ["serde", "serde-well-known", "serde-human-readable", "macros"] }
Expand Down
2 changes: 2 additions & 0 deletions pywr-python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ fn build_highs_settings(kwargs: Option<&PyDict>) -> PyResult<HighsSolverSettings
/// A Python module implemented in Rust.
#[pymodule]
fn pywr(_py: Python, m: &PyModule) -> PyResult<()> {
pyo3_log::init();

m.add_class::<Schema>()?;
m.add_class::<Model>()?;

Expand Down

0 comments on commit a05733d

Please sign in to comment.