You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building pyunicorn (from master) with Python 3.13 (3.13.0b2) and igraph 0.11.5 the igraph tests fail.
Example of failing igraph test
__________________________test_number_internal_links__________________________
[gw7] linux--Python3.13.0/usr/bin/python3deftest_number_internal_links():
net=InteractingNetworks.SmallTestNetwork()
>res=net.number_internal_links([0, 3, 5])
tests/test_core/test_interacting_networks.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../BUILDROOT/usr/lib64/python3.13/site-packages/pyunicorn/core/interacting_networks.py:655: innumber_internal_linksn_links=self.internal_adjacency(node_list).sum()
../BUILDROOT/usr/lib64/python3.13/site-packages/pyunicorn/core/interacting_networks.py:402: ininternal_adjacencyreturnnp.array(subgraph.get_adjacency(type=2).data).astype(np.int8)
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self=<igraph.Graphobjectat0x7f00841a4a50>, type=2, attribute=Nonedefault=0, eids=Falsedef_get_adjacency(
self, type=GET_ADJACENCY_BOTH, attribute=None, default=0, eids=False
):
"""Returns the adjacency matrix of a graph. @param type: either C{GET_ADJACENCY_LOWER} (uses the lower triangle of the matrix) or C{GET_ADJACENCY_UPPER} (uses the upper triangle) or C{GET_ADJACENCY_BOTH} (uses both parts). Ignored for directed graphs. @param attribute: if C{None}, returns the ordinary adjacency matrix. When the name of a valid edge attribute is given here, the matrix returned will contain the default value at the places where there is no edge or the value of the given attribute where there is an edge. Multiple edges are not supported, the value written in the matrix in this case will be unpredictable. This parameter is ignored if I{eids} is C{True} @param default: the default value written to the cells in the case of adjacency matrices with attributes. @param eids: specifies whether the edge IDs should be returned in the adjacency matrix. Since zero is a valid edge ID, the cells in the matrix that correspond to unconnected vertex pairs will contain -1 instead of 0 if I{eids} is C{True}. If I{eids} is C{False}, the number of edges will be returned in the matrix for each vertex pair. @return: the adjacency matrix as a L{Matrix}. """if (
type!=GET_ADJACENCY_LOWERandtype!=GET_ADJACENCY_UPPERandtype!=GET_ADJACENCY_BOTH
):
# Maybe it was called with the first argument as the attribute nametype, attribute=attribute, typeiftypeisNone:
type=GET_ADJACENCY_BOTHifeids:
result=Matrix(GraphBase.get_adjacency(self, type, eids))
result-=1returnresultifattributeisNone:
>returnMatrix(GraphBase.get_adjacency(self, type))
ESystemError: <method'get_adjacency'of'igraph._igraph.GraphBase'objects>returnedNULLwithoutsettinganexception/usr/lib64/python3.13/site-packages/igraph/adjacency.py:62: SystemError_____________________test_correlation_weighted_closeness______________________
[gw2] linux--Python3.13.0/usr/bin/python3deftest_correlation_weighted_closeness():
res=TsonisClimateNetwork.SmallTestNetwork().\
>correlation_weighted_closeness()
tests/test_climate/test_tsonis.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../BUILDROOT/usr/lib64/python3.13/site-packages/pyunicorn/climate/tsonis.py:300: incorrelation_weighted_closenessreturnself.closeness('correlation')
../BUILDROOT/usr/lib64/python3.13/site-packages/pyunicorn/core/network.py:3396: inclosenesspath_lengths=self.path_lengths(link_attribute)
../BUILDROOT/usr/lib64/python3.13/site-packages/pyunicorn/core/cache.py:118: inuncachedreturnf(self, *args, **kwargs)
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self=<pyunicorn.climate.tsonis.TsonisClimateNetworkobjectat0x7f9692579160>link_attribute='correlation'@Cached.method(name="path lengths")defpath_lengths(self, link_attribute=None):
""" For each pair of nodes i,j, return the (weighted) shortest path length from i to j (also called the distance from i to j). This is the shortest length of a path from i to j along links, or infinity if there is no such path. The length of links can be specified by an optional link attribute. **Example:** >>> print(Network.SmallTestNetwork().path_lengths()) Calculating all shortest path lengths... [[ 0. 2. 2. 1. 1. 1.] [ 2. 0. 1. 1. 1. 3.] [ 2. 1. 0. 2. 1. 3.] [ 1. 1. 2. 0. 2. 2.] [ 1. 1. 1. 2. 0. 2.] [ 1. 3. 3. 2. 2. 0.]] :arg str link_attribute: Optional name of the link attribute to be used as the links' length. If None, links have length 1. (Default: None) :rtype: square array [[float]] """iflink_attribute=="topological":
print("WARNING: link_attribute='topological' is deprecated.\n"+"Use link_attribute=None instead.")
link_attribute=Noneiflink_attributeisNone:
ifself.silence_level<=1:
print("Calculating all shortest path lengths...")
# fixed negative numbers to infinity!pl=np.array(self.graph.distances(), dtype=float)
pl[pl<0] =np.infreturnplelse:
ifself.silence_level<=1:
print("Calculating weighted shortest path lengths...")
returnnp.array(
>self.graph.distances(weights=link_attribute, mode=1))
ESystemError: <method'distances'of'igraph._igraph.GraphBase'objects>returnedNULLwithoutsettinganexception
../BUILDROOT/usr/lib64/python3.13/site-packages/pyunicorn/core/network.py:2887: SystemError
Python 3.13 builds are not yet included in Pyunicorn's CI. Will definitely look into this in the future. Currently, Python 3.8/3.9/3.10/3.11/3.12 are actively maintained.
If you need to run Python 3.13 and can find a fix, feel free to send a PR! :)
Thanks. One could argue that Python 3.13 is more actively maintained than the current stable releases as it is prepared for release in three month time. It will be the version Fedora 41 ships with, also planned for October.
Sure! Establishing Python 3.13 support is definitely on the TODO.
Edit: What I meant to say was that currently Pyunicorn is actively maintained to run on Python 3.8/3.9/3.10/3.11/3.12. As we have not been able to establish Python 3.13 support yet, please resort to previous versions if possible.
Building pyunicorn (from master) with Python 3.13 (3.13.0b2) and igraph 0.11.5 the igraph tests fail.
Example of failing igraph test
List of all failed tests (all with SystemError):
With Python 3.12 those tests succeed.
The text was updated successfully, but these errors were encountered: