Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transposing dimensions in the construction of EventSeries objects #240

Open
Lucy967 opened this issue Oct 3, 2024 · 1 comment
Open

Comments

@Lucy967
Copy link

Lucy967 commented Oct 3, 2024

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
Copy link
Collaborator

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:

# Allow for wrong axis, i.e. first axis variables and second axis
# time if time series have the same length
if isinstance(data, np.ndarray):
if data.shape[1] > data.shape[0]:
data = np.swapaxes(data, 0, 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants