pik-copan / pyunicorn

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

Transposing dimensions in the construction of EventSeries objects #240

Open Lucy967 opened 1 month ago

Lucy967 commented 1 month ago

Code We're currently trying to use pyunicorn and found a small potential bug in the EventSeries init function. In the case that input data isn't already preprocessed, we go into the else clause shown in the screenshot. Inside the else clause, the dimensions are transposed if there are fewer time steps than spatial grid points - which is the case for us. We don't know if or why this transposition is necessary and think it's counterintuitive given the doc strings in the functions.

fkuehlein commented 5 days ago

Hi @Lucy967,

thank you for reporting this, and excuse the delayed reply.

I agree to find it counterintuitive to practically transpose the event matrix at this point. I can't really think of a satisfactory explanation for it, e.g. a constraint that would require the time axis length to be greater than the number of dimensions.

@jakassel, as you are the original author of the EventSeries class you might know more about it. Would you be available to have a quick look at this particular case?

Here's a permalink to the snippet in question:

https://github.com/pik-copan/pyunicorn/blob/1bf45cab625fa3cc4344e4f24005974fa144d325/src/pyunicorn/eventseries/event_series.py#L113-L117