diff --git a/Cargo.lock b/Cargo.lock index 4ecd4cf6..64f82e8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1182,6 +1182,21 @@ dependencies = [ "tabled", ] +[[package]] +name = "medmodels-python" +version = "0.4.4" +dependencies = [ + "bincode", + "chrono", + "medmodels", + "numpy", + "polars", + "pyo3", + "pyo3-polars", + "rayon", + "serde", +] + [[package]] name = "medmodels-utils" version = "0.4.4" @@ -2091,15 +2106,9 @@ dependencies = [ name = "py-medmodels" version = "0.4.4" dependencies = [ - "bincode", - "chrono", "medmodels", - "numpy", - "polars", + "medmodels-python", "pyo3", - "pyo3-polars", - "rayon", - "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c8647a5a..f2260919 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,11 @@ hashbrown = { version = "0.14.5", features = ["serde"] } serde = { version = "1.0.203", features = ["derive"] } polars = { version = "0.48.1", features = ["polars-io", "dtype-full"] } chrono = { version = "0.4.38", features = ["serde"] } +pyo3 = { version = "0.24", features = ["chrono", "extension-module"] } rayon = "1.10.0" medmodels = { version = "0.4.4", path = "crates/medmodels" } medmodels-core = { version = "0.4.4", path = "crates/medmodels-core" } medmodels-utils = { version = "0.4.4", path = "crates/medmodels-utils" } +medmodels-python = { version = "0.4.4", path = "crates/medmodels-python" } py-medmodels = { version = "0.4.4", path = "crates/py-medmodels" } diff --git a/crates/medmodels-python/Cargo.toml b/crates/medmodels-python/Cargo.toml new file mode 100644 index 00000000..7cf2fda7 --- /dev/null +++ b/crates/medmodels-python/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "medmodels-python" +version = { workspace = true } +description = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +license = { workspace = true } +readme = "../../README.md" + +[dependencies] +medmodels = { workspace = true } + +polars = { workspace = true } +chrono = { workspace = true } +serde = { workspace = true } +rayon = { workspace = true } +pyo3 = { workspace = true } + +pyo3-polars = "0.21.0" +numpy = "0.24.0" +bincode = "1.3.3" diff --git a/crates/py-medmodels/src/gil_hash_map.rs b/crates/medmodels-python/src/gil_hash_map.rs similarity index 100% rename from crates/py-medmodels/src/gil_hash_map.rs rename to crates/medmodels-python/src/gil_hash_map.rs diff --git a/crates/medmodels-python/src/lib.rs b/crates/medmodels-python/src/lib.rs new file mode 100644 index 00000000..ffbcf147 --- /dev/null +++ b/crates/medmodels-python/src/lib.rs @@ -0,0 +1,5 @@ +#![recursion_limit = "256"] + +pub mod gil_hash_map; +pub mod medrecord; +pub mod prelude; diff --git a/crates/py-medmodels/src/medrecord/attribute.rs b/crates/medmodels-python/src/medrecord/attribute.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/attribute.rs rename to crates/medmodels-python/src/medrecord/attribute.rs diff --git a/crates/py-medmodels/src/medrecord/datatype.rs b/crates/medmodels-python/src/medrecord/datatype.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/datatype.rs rename to crates/medmodels-python/src/medrecord/datatype.rs diff --git a/crates/py-medmodels/src/medrecord/errors.rs b/crates/medmodels-python/src/medrecord/errors.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/errors.rs rename to crates/medmodels-python/src/medrecord/errors.rs diff --git a/crates/py-medmodels/src/medrecord/mod.rs b/crates/medmodels-python/src/medrecord/mod.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/mod.rs rename to crates/medmodels-python/src/medrecord/mod.rs diff --git a/crates/py-medmodels/src/medrecord/overview.rs b/crates/medmodels-python/src/medrecord/overview.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/overview.rs rename to crates/medmodels-python/src/medrecord/overview.rs diff --git a/crates/py-medmodels/src/medrecord/querying/attributes.rs b/crates/medmodels-python/src/medrecord/querying/attributes.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/querying/attributes.rs rename to crates/medmodels-python/src/medrecord/querying/attributes.rs diff --git a/crates/py-medmodels/src/medrecord/querying/edges.rs b/crates/medmodels-python/src/medrecord/querying/edges.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/querying/edges.rs rename to crates/medmodels-python/src/medrecord/querying/edges.rs diff --git a/crates/py-medmodels/src/medrecord/querying/mod.rs b/crates/medmodels-python/src/medrecord/querying/mod.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/querying/mod.rs rename to crates/medmodels-python/src/medrecord/querying/mod.rs diff --git a/crates/py-medmodels/src/medrecord/querying/nodes.rs b/crates/medmodels-python/src/medrecord/querying/nodes.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/querying/nodes.rs rename to crates/medmodels-python/src/medrecord/querying/nodes.rs diff --git a/crates/py-medmodels/src/medrecord/querying/values.rs b/crates/medmodels-python/src/medrecord/querying/values.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/querying/values.rs rename to crates/medmodels-python/src/medrecord/querying/values.rs diff --git a/crates/py-medmodels/src/medrecord/schema.rs b/crates/medmodels-python/src/medrecord/schema.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/schema.rs rename to crates/medmodels-python/src/medrecord/schema.rs diff --git a/crates/py-medmodels/src/medrecord/traits.rs b/crates/medmodels-python/src/medrecord/traits.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/traits.rs rename to crates/medmodels-python/src/medrecord/traits.rs diff --git a/crates/py-medmodels/src/medrecord/value.rs b/crates/medmodels-python/src/medrecord/value.rs similarity index 100% rename from crates/py-medmodels/src/medrecord/value.rs rename to crates/medmodels-python/src/medrecord/value.rs diff --git a/crates/py-medmodels/src/prelude.rs b/crates/medmodels-python/src/prelude.rs similarity index 94% rename from crates/py-medmodels/src/prelude.rs rename to crates/medmodels-python/src/prelude.rs index 0db3914f..f59f82c6 100644 --- a/crates/py-medmodels/src/prelude.rs +++ b/crates/medmodels-python/src/prelude.rs @@ -2,6 +2,9 @@ pub use crate::medrecord::{ datatype::{ PyAny, PyBool, PyDateTime, PyDuration, PyFloat, PyInt, PyNull, PyOption, PyString, PyUnion, }, + overview::{ + PyAttributeOverview, PyEdgeGroupOverview, PyGroupOverview, PyNodeGroupOverview, PyOverview, + }, querying::{ attributes::{ PyEdgeAttributesTreeGroupOperand, PyEdgeAttributesTreeOperand, @@ -34,6 +37,7 @@ pub use crate::medrecord::{ PyNodeSingleValueWithIndexGroupOperand, PyNodeSingleValueWithIndexOperand, PyNodeSingleValueWithoutIndexGroupOperand, PyNodeSingleValueWithoutIndexOperand, }, + PyMatchMode, }, schema::{PyAttributeDataType, PyAttributeType, PyGroupSchema, PySchema, PySchemaType}, PyMedRecord, diff --git a/crates/py-medmodels/Cargo.toml b/crates/py-medmodels/Cargo.toml index 4897f2d4..efc6b88f 100644 --- a/crates/py-medmodels/Cargo.toml +++ b/crates/py-medmodels/Cargo.toml @@ -13,13 +13,6 @@ crate-type = ["cdylib"] [dependencies] medmodels = { workspace = true } +medmodels-python = { workspace = true } -polars = { workspace = true } -chrono = { workspace = true } -serde = { workspace = true } -rayon = { workspace = true } - -pyo3 = { version = "0.24", features = ["chrono", "extension-module"] } -pyo3-polars = "0.21.0" -numpy = "0.24.0" -bincode = "1.3.3" +pyo3 = { workspace = true } diff --git a/crates/py-medmodels/src/lib.rs b/crates/py-medmodels/src/lib.rs index 463f7561..4e880a72 100644 --- a/crates/py-medmodels/src/lib.rs +++ b/crates/py-medmodels/src/lib.rs @@ -1,56 +1,7 @@ #![recursion_limit = "256"] -pub mod gil_hash_map; -pub mod medrecord; -pub mod prelude; - -use crate::medrecord::{ - overview::{ - PyAttributeOverview, PyEdgeGroupOverview, PyGroupOverview, PyNodeGroupOverview, PyOverview, - }, - querying::PyMatchMode, -}; use medmodels::core::medrecord::overview::DEFAULT_TRUNCATE_DETAILS; -use medrecord::{ - datatype::{ - PyAny, PyBool, PyDateTime, PyDuration, PyFloat, PyInt, PyNull, PyOption, PyString, PyUnion, - }, - querying::{ - attributes::{ - PyEdgeAttributesTreeGroupOperand, PyEdgeAttributesTreeOperand, - PyEdgeMultipleAttributesWithIndexGroupOperand, - PyEdgeMultipleAttributesWithIndexOperand, PyEdgeMultipleAttributesWithoutIndexOperand, - PyEdgeSingleAttributeWithIndexGroupOperand, PyEdgeSingleAttributeWithIndexOperand, - PyEdgeSingleAttributeWithoutIndexGroupOperand, - PyEdgeSingleAttributeWithoutIndexOperand, PyNodeAttributesTreeGroupOperand, - PyNodeAttributesTreeOperand, PyNodeMultipleAttributesWithIndexGroupOperand, - PyNodeMultipleAttributesWithIndexOperand, PyNodeMultipleAttributesWithoutIndexOperand, - PyNodeSingleAttributeWithIndexGroupOperand, PyNodeSingleAttributeWithIndexOperand, - PyNodeSingleAttributeWithoutIndexGroupOperand, - PyNodeSingleAttributeWithoutIndexOperand, - }, - edges::{ - EdgeOperandGroupDiscriminator, PyEdgeGroupOperand, PyEdgeIndexGroupOperand, - PyEdgeIndexOperand, PyEdgeIndicesGroupOperand, PyEdgeIndicesOperand, PyEdgeOperand, - }, - nodes::{ - NodeOperandGroupDiscriminator, PyEdgeDirection, PyNodeGroupOperand, - PyNodeIndexGroupOperand, PyNodeIndexOperand, PyNodeIndicesGroupOperand, - PyNodeIndicesOperand, PyNodeOperand, - }, - values::{ - PyEdgeMultipleValuesWithIndexGroupOperand, PyEdgeMultipleValuesWithIndexOperand, - PyEdgeMultipleValuesWithoutIndexOperand, PyEdgeSingleValueWithIndexGroupOperand, - PyEdgeSingleValueWithIndexOperand, PyEdgeSingleValueWithoutIndexGroupOperand, - PyEdgeSingleValueWithoutIndexOperand, PyNodeMultipleValuesWithIndexGroupOperand, - PyNodeMultipleValuesWithIndexOperand, PyNodeMultipleValuesWithoutIndexOperand, - PyNodeSingleValueWithIndexGroupOperand, PyNodeSingleValueWithIndexOperand, - PyNodeSingleValueWithoutIndexGroupOperand, PyNodeSingleValueWithoutIndexOperand, - }, - }, - schema::{PyAttributeDataType, PyAttributeType, PyGroupSchema, PySchema, PySchemaType}, - PyMedRecord, -}; +use medmodels_python::prelude::*; use pyo3::prelude::*; #[pymodule] @@ -64,7 +15,7 @@ fn _medmodels(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; - m.add_class::()?; + m.add_class::()?; m.add_class::()?; m.add_class::()?;