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

AttributeError: 'numpy.timedelta64' object has no attribute 'total_seconds' #251

Closed
zseebrz opened this issue Aug 18, 2021 · 2 comments
Closed

Comments

@zseebrz
Copy link

zseebrz commented Aug 18, 2021

After upgrading to version 2.2.11.1 from 2.2.10.2, and running dfg discovery for performance:
dfg_perf = dfg_discovery.apply(log, parameters=parameters, variant=dfg_discovery.Variants.PERFORMANCE)

I get the following error message:

File "(...)pm4py/algo/discovery/dfg/variants/performance.py", line 92, in for i in range(1, len(t))]), log)
AttributeError: 'numpy.timedelta64' object has no attribute 'total_seconds'

Reverting back to version 2.2.10.2 removes the error.

I suspect the culprit is the required numpy version. For both 2.2.10.2 and 2.2.11.1 the requirement is numpy!=1.19.4. In my case 2.2.10.2 runs fine on numpy 1.18.5, but I get the above error for the latest pm4py version.

@fit-alessandro-berti
Copy link
Contributor

Dear zseebrz,

I managed to reproduce your error importing a Parquet file (exported using Pyarrow).

Actually, we will force some more updated requirements from the next release (Numpy >= 1.19.5 and Pandas >= 1.1.5). I think it would also be safe to update the Pyarrow version in your installation to 5.0.0, as it is also a part of the problem. Parquet files exported starting from Pandas >= 1.1.5 using Pyarrow 5.0.0 do not have this problem when imported back.

@fit-alessandro-berti
Copy link
Contributor

Dear zseebrz,

in the current release (2.2.12), we set up the aforementioned versions for the requirements. Have a nice day.

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