Closed Parrazyte closed 5 months ago
HI @Parrazyte, what version on python and numpy do you have? I tried the first line and it executed successfully with a warning, so I wanted to make sure that is really the issue here.
My python is 3.11.3 and numpy version is 1.24.3
I'm on python 3.10.12 and numpy 1.26.4
Here's what I get:
np.timedelta64(1,'D')==np.timedelta64(1,'M')
Traceback (most recent call last):
File "/home/parrazyte/Documents/Work/PhD/Scripts/winds/venv/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3577, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-e789e35938dd>", line 1, in <module>
np.timedelta64(1,'D')==np.timedelta64(1,'M')
TypeError: Cannot get a common metadata divisor for Numpy datetime metadata [D] and [M] because they have incompatible nonlinear base time units.
While, I make the necessary changes, try to downgrade your numpy to 1.24.3 and this will allow things to run as I had intended them to run. pip and condo allow for a specified version of a package to be installed.
This was addressed via PR #21
The
group_inventory
function has an explicit comparison with a 1M timedelta64 (line 369)Which crashes if the binning_timedelta argument is a timedelta from another unit (e.g., day).
Proposed fix:
prevents the issue
(note: I also had an issue with explicit
np.int
calls ingroup_outventory
inmosaic.py
, it seems it's been fixed in the github version but I assume that the pip version is not up to date?)