pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 86 forks source link

_embed_time_series function throws ValueError #114

Closed jkroenke closed 5 years ago

jkroenke commented 5 years ago

In the tutorial 'recurrence_network.py' I replaced the logistic_map function with

def logistic_map(x0, r, T):
    """
    Returns a time series of length T using the logistic map
    x_(n+1) = r*x_n(1-x_n) at parameter r and using the initial condition x0.

    INPUT: x0 - Initial condition, 0 <= x0 <= 1
            r - Bifurcation parameter, 0 <= r <= 4
            T - length of the desired time series
    """
    #  Initialize the time series array
    timeSeries = np.empty(T)

    timeSeries[0] = x0
    for i in range(1,len(timeSeries)):
        xn = timeSeries[i-1]
        timeSeries[i] = r * xn * (1 - xn)

    return timeSeries

to remove obsolete weave imports. When executing the script, the external cython function _embed_time_series throws

ValueError: Buffer has wrong number of dimensions (expected 1, got 2)

I checked the dimension of time_series and embedding and they correspond to what _embed_time_series expects. When delete the _embed_time_series call the rest of the script executes properly. I tried many shapes for time_series but nothing worked and I can't find the problem.

jkroenke commented 5 years ago

I just recognized that Issue #83 seems to be related to the same problem.