simulation-alg 0.1.4__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/Cargo.lock +2 -2
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/Cargo.toml +1 -1
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/PKG-INFO +1 -1
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/pyproject.toml +1 -1
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/simulation.pyi +6 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/src/graph/hypergraph.rs +10 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/.github/workflows/ci.yml +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/.gitignore +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/.gitmodules +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/LICENSE +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/README.md +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/hyper-simulation.log +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/python/__init__.py +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/requirements.txt +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/src/graph/mod.rs +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/src/graph/networkx_graph.rs +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/src/lib.rs +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/src/utils.rs +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/tests/test_hyper_simulation.py +0 -0
- {simulation_alg-0.1.4 → simulation_alg-0.1.5}/tests/test_simulation.py +0 -0
|
@@ -188,9 +188,9 @@ dependencies = [
|
|
|
188
188
|
|
|
189
189
|
[[package]]
|
|
190
190
|
name = "graph-simulation"
|
|
191
|
-
version = "0.1.
|
|
191
|
+
version = "0.1.14"
|
|
192
192
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
193
|
-
checksum = "
|
|
193
|
+
checksum = "b87bfc6e277b4022afe3108e71a374642b0aaceb42ea3dbeedfdd2aeb5e6ea59"
|
|
194
194
|
dependencies = [
|
|
195
195
|
"bincode",
|
|
196
196
|
"env_logger",
|
|
@@ -70,3 +70,9 @@ class Hypergraph:
|
|
|
70
70
|
"""
|
|
71
71
|
Hyper simulation.
|
|
72
72
|
"""
|
|
73
|
+
|
|
74
|
+
@staticmethod
|
|
75
|
+
def soft_hyper_simulation(query: 'Hypergraph', data: 'Hypergraph', l_match_fn: Callable[[Hyperedge, Hyperedge], dict[int, set[int]]]) -> dict[int, set[int]]:
|
|
76
|
+
"""
|
|
77
|
+
Hyper simulation.
|
|
78
|
+
"""
|
|
@@ -134,6 +134,16 @@ impl Hypergraph {
|
|
|
134
134
|
.map(|(k, v)| (k.id(), v.into_iter().map(|n| n.id()).collect()))
|
|
135
135
|
.collect()
|
|
136
136
|
}
|
|
137
|
+
|
|
138
|
+
#[staticmethod]
|
|
139
|
+
pub fn soft_hyper_simulation(query: PyRef<Hypergraph>, data: PyRef<Hypergraph>, l_match_fn: Py<PyAny>) -> HashMap<usize, HashSet<usize>> {
|
|
140
|
+
let mut l_match = LMatchImpl::from(l_match_fn);
|
|
141
|
+
let sim = HyperSimulation::get_soft_simulation_naive(&*query, &*data, &mut l_match);
|
|
142
|
+
// Convert HashMap<&Node, HashSet<&Node>> to HashMap<usize, HashSet<usize>>
|
|
143
|
+
sim.into_iter()
|
|
144
|
+
.map(|(k, v)| (k.id(), v.into_iter().map(|n| n.id()).collect()))
|
|
145
|
+
.collect()
|
|
146
|
+
}
|
|
137
147
|
}
|
|
138
148
|
|
|
139
149
|
impl Display for Node {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|