AntSimi / py-eddy-tracker

Eddy identification and tracking
https://py-eddy-tracker.readthedocs.io/en/latest/
GNU General Public License v3.0
120 stars 48 forks source link

quick use issue #202

Closed zjuneilzhou closed 1 year ago

zjuneilzhou commented 1 year ago

when I use EddyId:

EddyId E:\Compressed\py-eddy-tracker-master\py-eddy-tracker-master\src\py_eddy_tracker\data\nrt_global_allsat_phy_l4_20190223_20190226.nc 20190223 adt ugos vgos longitude latitude ./ -
v INFO

the output comes as:

WARNING 2023-05-10 16:23:36,365 grid.__init__ : 
        We assume pixel position of grid is centered for ~/share/nrt_global_allsat_phy_l4_20190223_20190226.nc
Traceback (most recent call last): 
  File "F:\python\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "F:\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Compressed\py-eddy-tracker-master\venv\Scripts\EddyId.exe\__main__.py", line 7, in <module>
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\appli\grid.py", line 134, in eddy_id
    a, c = identification(
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\appli\grid.py", line 174, in identification
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\dataset\grid.py", line 1211, in __init__
    super().__init__(*args, **kwargs)
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\dataset\grid.py", line 307, in __init__
    self.populate()
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\dataset\grid.py", line 311, in populate
    self.load_general_features()
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\dataset\grid.py", line 345, in load_general_features
    with Dataset(self.filename) as h:
  File "src\netCDF4\_netCDF4.pyx", line 2307, in netCDF4._netCDF4.Dataset.__init__
  File "src\netCDF4\_netCDF4.pyx", line 1925, in netCDF4._netCDF4._ensure_nc_success
FileNotFoundError: [Errno 2] No such file or directory: b'~/share/nrt_global_allsat_phy_l4_20190223_20190226.nc'
(venv) PS E:\Compressed\py-eddy-tracker-master> EddyId E:\Compressed\py-eddy-tracker-master\py-eddy-tracker-master\src\py_eddy_tracker\data\nrt_global_allsat_phy_l4_20190223_20190226.nc 20190223 adt ugos vgos longitude latitude ./ -
v INFO
WARNING 2023-05-10 16:24:53,206 grid.__init__ : 
        We assume pixel position of grid is centered for E:\Compressed\py-eddy-tracker-master\py-eddy-tracker-master\src\py_eddy_tracker\data\nrt_global_allsat_phy_l4_20190223_20190226.nc
WARNING 2023-05-10 16:24:53,222 grid.convolve_filter_with_dynamic_kernel : 
        No filtering above 85.000000 degrees of latitude
INFO 2023-05-10 16:25:20,022 grid.eddy_identification : 
        We will apply on step a factor to be coherent with grid : 1.000000
E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\numpy\lib\function_base.py:4650: UserWarning: Warning: 'partition' will ignore the 'mask' of the MaskedArray. 
  arr.partition(
INFO 2023-05-10 16:25:20,087 eddy_feature.__init__ : 
        Start computing iso lines
INFO 2023-05-10 16:25:20,115 eddy_feature.__init__ : 
        Start computing iso lines with 924 levels from -1.090000 to 0.756000 ...
INFO 2023-05-10 16:25:32,448 eddy_feature.find_wrapcut_path_and_join : 
        867 contours close over the bounds
INFO 2023-05-10 16:25:32,449 eddy_feature.__init__ : 
        Finish computing iso lines
INFO 2023-05-10 16:25:36,879 eddy_feature.__init__ : 
        Repair 30596 closed contours and 83 almost closed contours / 234391 contours
Traceback (most recent call last): 
  File "F:\python\lib\runpy.py", line 192, in _run_module_as_main 
    return _run_code(code, main_globals, None,
  File "F:\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Compressed\py-eddy-tracker-master\venv\Scripts\EddyId.exe\__main__.py", line 7, in <module>
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\appli\grid.py", line 134, in eddy_id
    a, c = identification(
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\appli\grid.py", line 183, in identification
    return grid.eddy_identification(h, u, v, date, **kwargs)
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\dataset\grid.py", line 925, in eddy_identification
    xy_e_f = resample(*xy_e, **out_sampling)
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\numba\core\dispatcher.py", line 468, in _compile_for_args
    error_rewrite(e, 'typing')
  File "E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\numba\core\dispatcher.py", line 409, in error_rewrite 
    raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function heappush>) found for signature:

 >>> heappush(list(Tuple(float64, UniTuple(int32 x 3)))<iv=None>, Tuple(float64, Tuple(int64, int32, int32)))

There are 2 candidate implementations:
     - Of which 2 did not match due to:
     Overload in function 'heappush': File: numba\cpython\heapq.py: Line 150.
       With argument(s): '(list(Tuple(float64, UniTuple(int32 x 3)))<iv=None>, Tuple(float64, Tuple(int64, int32, int32)))':
      Rejected as the implementation raised a specific error:
        TypingError: heap type must be the same as item type
  raised from E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\numba\cpython\heapq.py:119

During: resolving callee type: Function(<built-in function heappush>)
During: typing of call at E:\Compressed\py-eddy-tracker-master\venv\lib\site-packages\py_eddy_tracker\poly.py (831)

File "venv\lib\site-packages\py_eddy_tracker\poly.py", line 831:
def visvalingam(x, y, fixed_size=18):
    <source elided>
            i_1 = (i0 - 1) % nb_ori
        heapq.heappush(h, (tri_area2(x, y, i_1, i0, i2), (i_1, i0, i2)))
        ^

It seems that the error occurs when calling the heappush() function in the visvalingam() function from the py_eddy_tracker.poly module. The error message suggests that there are two candidate implementations of heappush(), but neither of them is compatible with the provided arguments. The issue stems from a mismatch between the heap type and the item type. What should I do with this error?

I use Pathon 3.8/numpy 1.22.4+mkl/numba 0.55.2