pgraph-python 0.6.3__py3-none-any.whl → 0.6.5__py3-none-any.whl

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.
pgraph/PGraph.py CHANGED
@@ -307,7 +307,10 @@ class PGraph(ABC):
307
307
  coloring algorithm is run which is potentially expensive for
308
308
  a large graph.
309
309
  """
310
- self._graphcolor()
310
+ n = self._graphcolor()
311
+ if n is not None:
312
+ self._ncomponents = n
313
+
311
314
  return self._ncomponents
312
315
 
313
316
  def _metricfunc(self, metric):
@@ -604,7 +607,8 @@ class PGraph(ABC):
604
607
  # # add a colorbar
605
608
  # plt.colorbar()
606
609
  ax.grid(grid)
607
- plt.show(block=block)
610
+ if block is not None:
611
+ plt.show(block=block)
608
612
 
609
613
  def highlight_path(self, path, block=False, **kwargs):
610
614
  """
@@ -625,7 +629,8 @@ class PGraph(ABC):
625
629
  e = path[i].edgeto(path[i + 1])
626
630
  self.highlight_edge(e, **kwargs)
627
631
  self.highlight_vertex(path[i], **kwargs)
628
- plt.show(block=block)
632
+ if block is not None:
633
+ plt.show(block=block)
629
634
 
630
635
  def highlight_edge(self, edge, scale=2, color="r", alpha=0.5):
631
636
  """
@@ -1440,7 +1445,10 @@ class DGraph(PGraph):
1440
1445
  for v in self:
1441
1446
  v.label = final[v.label]
1442
1447
 
1443
- self._ncomponents = len(unique)
1448
+ return len(unique)
1449
+ else:
1450
+ # no coloring performed
1451
+ return None
1444
1452
 
1445
1453
 
1446
1454
  # ========================================================================== #
@@ -1,65 +1,65 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.5
2
2
  Name: pgraph-python
3
- Version: 0.6.3
3
+ Version: 0.6.5
4
4
  Summary: Mathematical graphs for Python
5
- Author-email: Peter Corke <rvc@petercorke.com>
6
5
  Project-URL: Homepage, https://github.com/petercorke/pgraph-python
7
- Project-URL: Bug Tracker, https://github.com/pypa/sampleproject/issues
6
+ Project-URL: Bug Tracker, https://github.com/petercorke/pgraph-python/issues
8
7
  Project-URL: Documentation, https://petercorke.github.io/pgraph-python
9
8
  Project-URL: GitHub Source, https://github.com/petercorke/pgraph-python
10
- Project-URL: Changelog, https://github.com/petercorke/pgraph-python/blob/master/CHANGELOG.md
11
- Project-URL: Coverage, https://codecov.io/gh/petercorke/spatialmath-python
12
- Keywords: python,graph,directed graph,undirected graph,a* search,adjacency matrix,Laplacian matrix,plotting,optimal path
9
+ Project-URL: Changelog, https://github.com/petercorke/pgraph-python/blob/main/CHANGELOG.md
10
+ Project-URL: Coverage, https://codecov.io/gh/petercorke/pgraph-python
11
+ Author-email: Peter Corke <rvc@petercorke.com>
12
+ License-File: LICENSE
13
+ Keywords: Laplacian matrix,a* search,adjacency matrix,directed graph,graph,optimal path,plotting,python,undirected graph
13
14
  Classifier: Development Status :: 5 - Production/Stable
14
15
  Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
15
18
  Classifier: Programming Language :: Python :: 3.9
16
19
  Classifier: Programming Language :: Python :: 3.10
17
20
  Classifier: Programming Language :: Python :: 3.11
18
21
  Classifier: Programming Language :: Python :: 3.12
19
22
  Classifier: Programming Language :: Python :: 3.13
20
- Classifier: License :: OSI Approved :: MIT License
21
- Classifier: Operating System :: OS Independent
22
23
  Requires-Python: >=3.7
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Requires-Dist: spatialmath-python
24
+ Requires-Dist: matplotlib
26
25
  Requires-Dist: numpy>=1.18.0
27
26
  Requires-Dist: scipy
28
- Requires-Dist: matplotlib
27
+ Requires-Dist: spatialmath-python
29
28
  Provides-Extra: dev
30
- Requires-Dist: pytest; extra == "dev"
31
- Requires-Dist: pytest-cov; extra == "dev"
29
+ Requires-Dist: pytest; extra == 'dev'
30
+ Requires-Dist: pytest-cov; extra == 'dev'
32
31
  Provides-Extra: docs
33
- Requires-Dist: sphinx; extra == "docs"
34
- Requires-Dist: recommonmark; extra == "docs"
35
- Requires-Dist: sphinx-rtd-theme; extra == "docs"
36
- Requires-Dist: sphinx-autorun; extra == "docs"
37
- Requires-Dist: sphinx-favicon; extra == "docs"
32
+ Requires-Dist: recommonmark; extra == 'docs'
33
+ Requires-Dist: sphinx; extra == 'docs'
34
+ Requires-Dist: sphinx-autorun; extra == 'docs'
35
+ Requires-Dist: sphinx-favicon; extra == 'docs'
36
+ Requires-Dist: sphinx-rtd-theme; extra == 'docs'
37
+ Description-Content-Type: text/markdown
38
38
 
39
39
  # PGraph: graphs for Python
40
40
 
41
- [![A Python Robotics Package](https://raw.githubusercontent.com/petercorke/robotics-toolbox-python/master/.github/svg/py_collection.min.svg)](https://github.com/petercorke/robotics-toolbox-python)
41
+ [![A Python Robotics Package](https://raw.githubusercontent.com/petercorke/robotics-toolbox-python/main/.github/svg/py_collection.min.svg)](https://github.com/petercorke/robotics-toolbox-python)
42
42
  [![Powered by Spatial Maths](https://raw.githubusercontent.com/petercorke/spatialmath-python/master/.github/svg/sm_powered.min.svg)](https://github.com/petercorke/spatialmath-python)
43
43
  [![QUT Centre for Robotics Open Source](https://github.com/qcr/qcr.github.io/raw/master/misc/badge.svg)](https://qcr.github.io)
44
44
 
45
45
  [![PyPI version fury.io](https://badge.fury.io/py/pgraph-python.svg)](https://pypi.python.org/pypi/pgraph-python/)
46
46
  [![PyPI pyversions](https://img.shields.io/pypi/pyversions/pgraph-python)](https://pypi.python.org/pypi/pgraph-python/)
47
- [![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/petercorke/pgraph-python/blob/master/LICENSE)
47
+ [![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/petercorke/pgraph-python/blob/main/LICENSE)
48
48
 
49
- [![Build Status](https://github.com/petercorke/pgraph-python/actions/workflows/master.yml/badge.svg)](https://github.com/petercorke/pgraph-python/actions?query=workflow%3Abuild)
50
- [![Coverage](https://codecov.io/gh/petercorke/pgraph-python/branch/master/graph/badge.svg)](https://codecov.io/gh/petercorke/pgraph-python)
49
+ [![Build Status](https://github.com/petercorke/pgraph-python/actions/workflows/ci.yml/badge.svg)](https://github.com/petercorke/pgraph-python/actions?query=workflow%3ACI)
50
+ [![Coverage](https://codecov.io/gh/petercorke/pgraph-python/branch/main/graph/badge.svg)](https://codecov.io/gh/petercorke/pgraph-python)
51
51
  ![pypi downloads](https://img.shields.io/pypi/dw/pgraph-python)
52
52
 
53
53
  - [GitHub repository](https://github.com/petercorke/pgraph-python)
54
54
  - [Wiki (examples and details)](https://github.com/petercorke/pgraph-python/wiki)
55
55
  - [Documentation](https://petercorke.github.io/pgraph-python)
56
- - [Changelog](https://github.com/petercorke/pgraph-python/blob/master/CHANGELOG.md)
56
+ - [Changelog](https://github.com/petercorke/pgraph-python/blob/main/CHANGELOG.md)
57
57
  - Dependencies: [`numpy`](https://numpy.org) [`spatialmath`](https://github.com/bdaiinstitute/spatialmath-python)
58
58
 
59
59
 
60
60
  This Python package allows the manipulation of directed and non-directed graphs. Also supports embedded graphs. It is suitable for graphs with thousands of nodes.
61
61
 
62
- ![road network](https://github.com/petercorke/pgraph-python/raw/master/examples/roads.png)
62
+ ![road network](https://github.com/petercorke/pgraph-python/raw/main/examples/roads.png)
63
63
 
64
64
  ```
65
65
  from pgraph import *
@@ -161,11 +161,11 @@ for f in f1.neighbours():
161
161
 
162
162
  The key objects and their interactions are shown below.
163
163
 
164
- ![data structures](https://github.com/petercorke/pgraph-python/raw/master/docs/source/datastructures.png)
164
+ ![data structures](https://github.com/petercorke/pgraph-python/raw/main/docs/source/datastructures.png)
165
165
 
166
166
  ## MATLAB version
167
167
 
168
- This is a re-engineered version of [PGraph.m](https://github.com/petercorke/spatialmath-matlab/blob/master/PGraph.m) which ships as part of the [Spatial Math Toolbox for MATLAB](https://github.com/petercorke/spatialmath-matlab). This class is used to support bundle adjustment, pose-graph SLAM and various planners such as PRM, RRT and Lattice.
168
+ This is a re-engineered version of [PGraph.m](https://github.com/petercorke/spatialmath-matlab/blob/main/PGraph.m) which ships as part of the [Spatial Math Toolbox for MATLAB](https://github.com/petercorke/spatialmath-matlab). This class is used to support bundle adjustment, pose-graph SLAM and various planners such as PRM, RRT and Lattice.
169
169
 
170
170
  The Python version was designed from the start to work with directed and undirected graphs, whereas directed graphs were a late addition to the MATLAB version. Semantics are similar but not identical. In particular the use of subclassing rather than references to
171
171
  _user data_ is encouraged.
@@ -0,0 +1,6 @@
1
+ pgraph/PGraph.py,sha256=vAVCAolCRybMaowkdw7Oz_jn3xj7655rbbw2jF793pA,60135
2
+ pgraph/__init__.py,sha256=J2sLjUeac_R5eSJncN1RvkkDkgxA8ko8dDan5CP-Tp8,65
3
+ pgraph_python-0.6.5.dist-info/METADATA,sha256=16Pi6yASR-aKCvjRKXJcQjHP7M8BUIRYi-rN60CxSkU,7528
4
+ pgraph_python-0.6.5.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
5
+ pgraph_python-0.6.5.dist-info/licenses/LICENSE,sha256=niCzY_CzbIMKuUZlUkGimjrKp0vkLAtcwFmoSuSKrdw,1068
6
+ pgraph_python-0.6.5.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.7.0)
2
+ Generator: hatchling 1.32.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -1,7 +0,0 @@
1
- pgraph/PGraph.py,sha256=MiMyyFCeQoe4GHFuIwPpIRjOq5NdBSjypiaQtHbRo1w,59937
2
- pgraph/__init__.py,sha256=J2sLjUeac_R5eSJncN1RvkkDkgxA8ko8dDan5CP-Tp8,65
3
- pgraph_python-0.6.3.dist-info/LICENSE,sha256=niCzY_CzbIMKuUZlUkGimjrKp0vkLAtcwFmoSuSKrdw,1068
4
- pgraph_python-0.6.3.dist-info/METADATA,sha256=1VOLNQ1eqabXKpEBRJfQLYfeEtoKEbFOJSmuFi-bqjo,7550
5
- pgraph_python-0.6.3.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
6
- pgraph_python-0.6.3.dist-info/top_level.txt,sha256=65APwJt5i4VXyjNAHBsHHy_t8h9wt-LJ3jlngDZ9d8o,7
7
- pgraph_python-0.6.3.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- pgraph