From 8ccf323fb0ab736a706b8057d2256aec46a90066 Mon Sep 17 00:00:00 2001 From: Felix Jung Date: Wed, 14 Aug 2024 13:49:51 +0200 Subject: [PATCH] what on earth is the problem, here? --- src/ridepy/util/spaces_cython/spaces.pxd | 2 +- src/ridepy/util/spaces_cython/spaces.pyx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ridepy/util/spaces_cython/spaces.pxd b/src/ridepy/util/spaces_cython/spaces.pxd index 64d8f042..495cb033 100644 --- a/src/ridepy/util/spaces_cython/spaces.pxd +++ b/src/ridepy/util/spaces_cython/spaces.pxd @@ -15,7 +15,7 @@ from ridepy.data_structures_cython.data_structures cimport LocType, R2loc, uiloc cdef union USpace: CTransportSpace[R2loc] *space_r2loc_ptr - CTransportSpace[uiloc] *space_int_ptr + CGraphSpace[uiloc] *space_int_ptr cdef class TransportSpace: diff --git a/src/ridepy/util/spaces_cython/spaces.pyx b/src/ridepy/util/spaces_cython/spaces.pyx index 01f9b132..f1b18656 100644 --- a/src/ridepy/util/spaces_cython/spaces.pyx +++ b/src/ridepy/util/spaces_cython/spaces.pyx @@ -475,20 +475,21 @@ cdef class Graph(TransportSpace): self.loc_type = LocType.INT if weights is None: - self.u_space.space_int_ptr = self.derived_ptr = new CGraphSpace[uiloc]( - velocity, vertices, edges + self.derived_ptr = self.u_space.space_int_ptr = new CGraphSpace[uiloc]( + velocity, + vertices, + edges ) else: if isinstance(weights, (int, float)): weights = it.repeat(float(weights), len(edges)) - self.u_space.space_int_ptr = self.derived_ptr = new CGraphSpace[uiloc]( + self.derived_ptr = self.u_space.space_int_ptr = new CGraphSpace[uiloc]( velocity, vertices, edges, weights ) - self.u_space.space_int_ptr = self.derived_ptr def __init__(self, *args, **kwargs): # remember both __cinit__ and __init__ gets the same arguments passed """