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

python3.8 cannot import ocetrac #30

Open
chiaweh2 opened this issue Feb 1, 2022 · 0 comments
Open

python3.8 cannot import ocetrac #30

chiaweh2 opened this issue Feb 1, 2022 · 0 comments

Comments

@chiaweh2
Copy link

chiaweh2 commented Feb 1, 2022

Thank you for creating this great package! I find the example very helpful. I have successfully created a similar analysis using different datasets. I just want to mention two minor things that I encountered during the analysis which is easily fixed but the error messages might not provide enough detail for the user to find out the problem and fix it.

  1. When installing the package with python3.8, it seems to raise scipy error on importing 'float_factorial' from 'scipy._lib._util' shown below.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-17-4e501da774bd> in <module>
----> 1 import ocetrac

~/miniconda3/envs/mhw/lib/python3.8/site-packages/ocetrac/__init__.py in <module>
----> 1 from .tracker import Tracker
      2 from .tracker import _apply_mask

~/miniconda3/envs/mhw/lib/python3.8/site-packages/ocetrac/tracker.py in <module>
      2 import numpy as np
      3 import scipy.ndimage
----> 4 from skimage.measure import regionprops
      5 from skimage.measure import label as label_np
      6 import dask.array as dsa

~/miniconda3/envs/mhw/lib/python3.8/site-packages/skimage/measure/__init__.py in <module>
      6 from .simple_metrics import compare_mse, compare_nrmse, compare_psnr
      7 from ._structural_similarity import compare_ssim
----> 8 from ._polygon import approximate_polygon, subdivide_polygon
      9 from .pnpoly import points_in_poly, grid_points_in_poly
     10 from ._moments import (moments, moments_central, moments_coords,

~/miniconda3/envs/mhw/lib/python3.8/site-packages/skimage/measure/_polygon.py in <module>
      1 import numpy as np
----> 2 from scipy import signal
      3 
      4 
      5 def approximate_polygon(coords, tolerance):

~/miniconda3/envs/mhw/lib/python3.8/site-packages/scipy/signal/__init__.py in <module>
    299 from .spline import *
    300 
--> 301 from .bsplines import *
    302 from .filter_design import *
    303 from .fir_filter_design import *

~/miniconda3/envs/mhw/lib/python3.8/site-packages/scipy/signal/bsplines.py in <module>
      8 
      9 from scipy.special import comb
---> 10 from scipy._lib._util import float_factorial
     11 
     12 __all__ = ['spline_filter', 'bspline', 'gauss_spline', 'cubic', 'quadratic',

ImportError: cannot import name 'float_factorial' from 'scipy._lib._util' (/home/chsu/miniconda3/envs/mhw/lib/python3.8/site-packages/scipy/_lib/_util.py)

The issue is also found in other instance when installing python3.8 and using float_factorial from scipy._lib._util (Stackoverflow).

Follow the path to correct the float_factorial function seems to correct the error. I understand this is not the problem of the package itself but just want to raise awareness for people who are using python 3.8 and may encounter this issue.

  1. when using the tracker to start tracking, meaning Tracker.track() , it seems to require the dimension order of the Xarray.dataArray to be "time", "lat", "lon". I understand this is usually the case for most dataset. But just by accident, the dataset I am using is "lat", "lon", "time". This is also easily fixed with DataArray.transpose().

I am not sure if any PR can fix the first issue but a quick checking of dimension order or stated the order of the dimension in the function docstring might be helpful for the second issue.

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

1 participant