differt-core 0.0.12__tar.gz → 0.0.13__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.
- {differt_core-0.0.12 → differt_core-0.0.13}/Cargo.lock +1 -1
- {differt_core-0.0.12 → differt_core-0.0.13}/PKG-INFO +1 -4
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/Cargo.toml +1 -1
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/README.md +0 -3
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/rt/graph.rs +51 -23
- {differt_core-0.0.12 → differt_core-0.0.13}/Cargo.toml +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/LICENSE.md +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/benches/bench_main.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/benches/benchmarks/graph_iterators.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/benches/benchmarks/mod.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/__init__.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/geometry/triangle_mesh.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/rt/__init__.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/rt/graph.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/scene/sionna.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/scene/triangle_scene.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/geometry/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/geometry/triangle_mesh.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/py.typed +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/rt/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/rt/graph.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/scene/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/scene/sionna.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/scene/triangle_scene.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/geometry/mod.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/geometry/triangle_mesh.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/lib.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/rt/mod.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/scene/mod.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/scene/sionna.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/src/scene/triangle_scene.rs +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/tests/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/tests/benchmarks/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/tests/benchmarks/conftest.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/tests/benchmarks/test_graph.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/tests/rt/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/differt-core/tests/rt/test_graph.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/pyproject.toml +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/__init__.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/geometry/triangle_mesh.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/rt/__init__.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/rt/graph.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/scene/sionna.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/scene/triangle_scene.pyi +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/geometry/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/geometry/triangle_mesh.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/py.typed +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/rt/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/rt/graph.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/scene/__init__.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/scene/sionna.py +0 -0
- {differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/scene/triangle_scene.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: differt-core
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Classifier: Programming Language :: Python :: 3
|
|
5
5
|
Classifier: Programming Language :: Python :: 3.9
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -31,7 +31,6 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
|
31
31
|
[![Latest Release][pypi-version-badge]][pypi-version-url]
|
|
32
32
|
[![Python version][pypi-python-version-badge]][pypi-version-url]
|
|
33
33
|
[![Documentation][documentation-badge]][documentation-url]
|
|
34
|
-
[![Codecov][codecov-badge]][codecov-url]
|
|
35
34
|
|
|
36
35
|
</div>
|
|
37
36
|
|
|
@@ -54,6 +53,4 @@ are shared with the
|
|
|
54
53
|
[pypi-python-version-badge]: https://img.shields.io/pypi/pyversions/DiffeRT-core?color=orange
|
|
55
54
|
[documentation-badge]: https://readthedocs.org/projects/differt/badge/?version=latest
|
|
56
55
|
[documentation-url]: https://differt.readthedocs.io/latest/?badge=latest
|
|
57
|
-
[codecov-badge]: https://codecov.io/gh/jeertmans/DiffeRT-core/branch/main/graph/badge.svg?token=8P4DY9JCE4
|
|
58
|
-
[codecov-url]: https://codecov.io/gh/jeertmans/DiffeRT-core
|
|
59
56
|
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
[![Latest Release][pypi-version-badge]][pypi-version-url]
|
|
10
10
|
[![Python version][pypi-python-version-badge]][pypi-version-url]
|
|
11
11
|
[![Documentation][documentation-badge]][documentation-url]
|
|
12
|
-
[![Codecov][codecov-badge]][codecov-url]
|
|
13
12
|
|
|
14
13
|
</div>
|
|
15
14
|
|
|
@@ -32,5 +31,3 @@ are shared with the
|
|
|
32
31
|
[pypi-python-version-badge]: https://img.shields.io/pypi/pyversions/DiffeRT-core?color=orange
|
|
33
32
|
[documentation-badge]: https://readthedocs.org/projects/differt/badge/?version=latest
|
|
34
33
|
[documentation-url]: https://differt.readthedocs.io/latest/?badge=latest
|
|
35
|
-
[codecov-badge]: https://codecov.io/gh/jeertmans/DiffeRT-core/branch/main/graph/badge.svg?token=8P4DY9JCE4
|
|
36
|
-
[codecov-url]: https://codecov.io/gh/jeertmans/DiffeRT-core
|
|
@@ -133,7 +133,7 @@ pub mod complete {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/// Return an iterator over all paths of length ``depth``
|
|
136
|
-
/// from node ``
|
|
136
|
+
/// from node ``from_`` to node ``to``.
|
|
137
137
|
///
|
|
138
138
|
/// .. note::
|
|
139
139
|
///
|
|
@@ -174,7 +174,7 @@ pub mod complete {
|
|
|
174
174
|
/// from\_ (int): The node index to find the paths from.
|
|
175
175
|
/// to (int): The node index to find the paths to.
|
|
176
176
|
/// depth (int): The number of nodes to include in each path.
|
|
177
|
-
/// include_from_and_to (bool): Whether to include or not ``
|
|
177
|
+
/// include_from_and_to (bool): Whether to include or not ``from_``
|
|
178
178
|
/// and ``to`` nodes in the output paths. If set to
|
|
179
179
|
/// :py:data:`False`, the output paths will include
|
|
180
180
|
/// ``depth - 2`` nodes.
|
|
@@ -194,13 +194,13 @@ pub mod complete {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/// Return an array of all paths of length ``depth``
|
|
197
|
-
/// from node ``
|
|
197
|
+
/// from node ``from_`` to node ``to``.
|
|
198
198
|
///
|
|
199
199
|
/// Args:
|
|
200
200
|
/// from\_ (int): The node index to find the paths from.
|
|
201
201
|
/// to (int): The node index to find the paths to.
|
|
202
202
|
/// depth (int): The number of nodes to include in each path.
|
|
203
|
-
/// include_from_and_to (bool): Whether to include or not ``
|
|
203
|
+
/// include_from_and_to (bool): Whether to include or not ``from_``
|
|
204
204
|
/// and ``to`` nodes in the output paths. If set to
|
|
205
205
|
/// :py:data:`False`, the output paths will include
|
|
206
206
|
/// ``depth - 2`` nodes.
|
|
@@ -224,14 +224,14 @@ pub mod complete {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/// Return an iterator over all paths of length ``depth``
|
|
227
|
-
/// from node ``
|
|
227
|
+
/// from node ``from_`` to node ``to``, grouped in chunks of
|
|
228
228
|
/// size of max. ``chunk_size``.
|
|
229
229
|
///
|
|
230
230
|
/// Args:
|
|
231
231
|
/// from\_ (int): The node index to find the paths from.
|
|
232
232
|
/// to (int): The node index to find the paths to.
|
|
233
233
|
/// depth (int): The number of nodes to include in each path.
|
|
234
|
-
/// include_from_and_to (bool): Whether to include or not ``
|
|
234
|
+
/// include_from_and_to (bool): Whether to include or not ``from_``
|
|
235
235
|
/// and ``to`` nodes in the output paths. If set to
|
|
236
236
|
/// :py:data:`False`, the output paths will include
|
|
237
237
|
/// ``depth - 2`` nodes.
|
|
@@ -301,9 +301,6 @@ pub mod complete {
|
|
|
301
301
|
|
|
302
302
|
let mut visited = Vec::with_capacity(depth);
|
|
303
303
|
let mut counter = Vec::with_capacity(depth);
|
|
304
|
-
visited.push(from);
|
|
305
|
-
counter.push(graph.num_nodes); // num_nodes means we visited all
|
|
306
|
-
// first nodes, because first not is fixed
|
|
307
304
|
|
|
308
305
|
let paths_count = 0;
|
|
309
306
|
let paths_total_count = match depth.cmp(&2) {
|
|
@@ -361,6 +358,14 @@ pub mod complete {
|
|
|
361
358
|
},
|
|
362
359
|
};
|
|
363
360
|
|
|
361
|
+
if paths_total_count > 0 {
|
|
362
|
+
// Avoid visiting any node if no path exists
|
|
363
|
+
visited.push(from);
|
|
364
|
+
counter.push(graph.num_nodes);
|
|
365
|
+
// `num_nodes` means we visited all
|
|
366
|
+
// first nodes, because the first node is fixed
|
|
367
|
+
}
|
|
368
|
+
|
|
364
369
|
Self {
|
|
365
370
|
graph,
|
|
366
371
|
to,
|
|
@@ -609,19 +614,20 @@ pub mod directed {
|
|
|
609
614
|
graph.into()
|
|
610
615
|
}
|
|
611
616
|
|
|
612
|
-
/// Insert two additional nodes in the graph:
|
|
617
|
+
/// Insert two additional nodes in the graph: ``from_`` and ``to``.
|
|
618
|
+
///
|
|
619
|
+
/// The nodes satisfy the following conditions:
|
|
613
620
|
///
|
|
614
|
-
/// -
|
|
615
|
-
///
|
|
616
|
-
///
|
|
617
|
-
/// node.
|
|
621
|
+
/// - ``from_`` is connected to every other node in the graph;
|
|
622
|
+
/// - and ``to`` is an `endpoint`, where every other node is connected
|
|
623
|
+
/// to this node.
|
|
618
624
|
///
|
|
619
|
-
/// If ``direct_path`` is :py:data:`True`, then the ``
|
|
620
|
-
/// connected to the ``to`` node.
|
|
625
|
+
/// If ``direct_path`` is :py:data:`True`, then the ``from_`` node is
|
|
626
|
+
/// also connected to the ``to`` node.
|
|
621
627
|
///
|
|
622
628
|
/// Args:
|
|
623
629
|
/// direct_path (bool): Whether to create a direction connection
|
|
624
|
-
/// between ``
|
|
630
|
+
/// between ``from_`` and ``to`` nodes.
|
|
625
631
|
///
|
|
626
632
|
/// Return:
|
|
627
633
|
/// tuple[int, int]:
|
|
@@ -654,13 +660,13 @@ pub mod directed {
|
|
|
654
660
|
}
|
|
655
661
|
|
|
656
662
|
/// Return an iterator over all paths of length ``depth``
|
|
657
|
-
/// from node ``
|
|
663
|
+
/// from node ``from_`` to node ``to``.
|
|
658
664
|
///
|
|
659
665
|
/// Args:
|
|
660
666
|
/// from\_ (int): The node index to find the paths from.
|
|
661
667
|
/// to (int): The node index to find the paths to.
|
|
662
668
|
/// depth (int): The number of nodes to include in each path.
|
|
663
|
-
/// include_from_and_to (bool): Whether to include or not ``
|
|
669
|
+
/// include_from_and_to (bool): Whether to include or not ``from_``
|
|
664
670
|
/// and ``to`` nodes in the output paths. If set to
|
|
665
671
|
/// :py:data:`False`, the output paths will include
|
|
666
672
|
/// ``depth - 2`` nodes.
|
|
@@ -680,13 +686,13 @@ pub mod directed {
|
|
|
680
686
|
}
|
|
681
687
|
|
|
682
688
|
/// Return an array of all paths of length ``depth``
|
|
683
|
-
/// from node ``
|
|
689
|
+
/// from node ``from_`` to node ``to``.
|
|
684
690
|
///
|
|
685
691
|
/// Args:
|
|
686
692
|
/// from\_ (int): The node index to find the paths from.
|
|
687
693
|
/// to (int): The node index to find the paths to.
|
|
688
694
|
/// depth (int): The number of nodes to include in each path.
|
|
689
|
-
/// include_from_and_to (bool): Whether to include or not ``
|
|
695
|
+
/// include_from_and_to (bool): Whether to include or not ``from_``
|
|
690
696
|
/// and ``to`` nodes in the output paths. If set to
|
|
691
697
|
/// :py:data:`False`, the output paths will include
|
|
692
698
|
/// ``depth - 2`` nodes.
|
|
@@ -710,14 +716,14 @@ pub mod directed {
|
|
|
710
716
|
}
|
|
711
717
|
|
|
712
718
|
/// Return an iterator over all paths of length ``depth``
|
|
713
|
-
/// from node ``
|
|
719
|
+
/// from node ``from_`` to node ``to``, grouped in chunks of
|
|
714
720
|
/// size of max. ``chunk_size``.
|
|
715
721
|
///
|
|
716
722
|
/// Args:
|
|
717
723
|
/// from\_ (int): The node index to find the paths from.
|
|
718
724
|
/// to (int): The node index to find the paths to.
|
|
719
725
|
/// depth (int): The number of nodes to include in each path.
|
|
720
|
-
/// include_from_and_to (bool): Whether to include or not ``
|
|
726
|
+
/// include_from_and_to (bool): Whether to include or not ``from_``
|
|
721
727
|
/// and ``to`` nodes in the output paths. If set to
|
|
722
728
|
/// :py:data:`False`, the output paths will include
|
|
723
729
|
/// ``depth - 2`` nodes.
|
|
@@ -1029,6 +1035,28 @@ mod tests {
|
|
|
1029
1035
|
assert_eq!(got, expected);
|
|
1030
1036
|
}
|
|
1031
1037
|
|
|
1038
|
+
#[rstest]
|
|
1039
|
+
#[case(0, 2, 0, 1, 1)] // One path of depth 2 [0, 1]
|
|
1040
|
+
#[case(0, 2, 0, 0, 0)] // No path of depth 2 (because can't be [0, 0])
|
|
1041
|
+
#[case(4, 2, 0, 1, 1)] // One path of depth 2 [0, 1]
|
|
1042
|
+
#[case(1, 3, 1, 2, 1)] // One path of depth 3 [1, 0, 2]
|
|
1043
|
+
#[case(0, 1, 0, 1, 0)] // No path of depth 1
|
|
1044
|
+
#[case(0, 2, 0, 1, 1)] // One path of depth 2
|
|
1045
|
+
#[case(0, 3, 0, 1, 0)] // No path of depth 3
|
|
1046
|
+
#[case(0, 4, 0, 1, 0)] // No path of depth 4
|
|
1047
|
+
fn test_complete_graph_edge_cases(
|
|
1048
|
+
#[case] num_nodes: usize,
|
|
1049
|
+
#[case] depth: usize,
|
|
1050
|
+
#[case] from: usize,
|
|
1051
|
+
#[case] to: usize,
|
|
1052
|
+
#[case] expected: usize,
|
|
1053
|
+
) {
|
|
1054
|
+
let iter = CompleteGraph::new(num_nodes).all_paths(from, to, depth, false);
|
|
1055
|
+
let got = iter.count();
|
|
1056
|
+
|
|
1057
|
+
assert_eq!(got, expected);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1032
1060
|
#[test]
|
|
1033
1061
|
#[should_panic(expected = "adjacency matrix must be square")]
|
|
1034
1062
|
fn test_di_graph_from_nonsquare_matrix() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/benches/benchmarks/graph_iterators.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/__init__.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/_lowlevel/rt/graph.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/geometry/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/scene/__init__.py
RENAMED
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/scene/sionna.py
RENAMED
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/differt-core/python/differt_core/scene/triangle_scene.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/geometry/triangle_mesh.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{differt_core-0.0.12 → differt_core-0.0.13}/python/differt_core/_lowlevel/scene/triangle_scene.pyi
RENAMED
|
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
|