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

EddiesObservations cannot be imported from py_eddy_tracker.observations #3

Closed
evanmason opened this issue Dec 27, 2019 · 4 comments
Closed

Comments

@evanmason
Copy link
Collaborator

The Wiki needs to be updated.

The section for creating a tracking recipe presently fails as follows:

In [7]: from py_eddy_tracker.observations import EddiesObservations as Model                                                                                                                                      
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-7-77527e386807> in <module>
----> 1 from py_eddy_tracker.observations import EddiesObservations as Model

ImportError: cannot import name 'EddiesObservations' from 'py_eddy_tracker.observations' (/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/py_eddy_tracker/observations/__init__.py)

This seems to work:
In [2]: from py_eddy_tracker.observations.observation import EddiesObservations as Model but I then get the following when trying to follow the Wiki:

(VENVP3) [emason@marula global4eddytracking]$ EddyTracking my_tracking.py my_tracking.yaml
usage: Tool to use identification step to compute tracking [-h]
                                                           [-v LOGGING_LEVEL]
                                                           [--correspondance_in CORRESPONDANCE_IN]
                                                           [--correspondance_out CORRESPONDANCE_OUT]
                                                           [--save_correspondance_and_stop]
                                                           [--blank_period BLANK_PERIOD]
                                                           yaml_file
Tool to use identification step to compute tracking: error: unrecognized arguments: my_tracking.yaml
(VENVP3) [emason@marula global4eddytracking]$
@AntSimi
Copy link
Owner

AntSimi commented Dec 27, 2019 via email

@evanmason
Copy link
Collaborator Author

Ok, so the Wiki should be updated to reflect that. Is it no longer possible to add a 'tracking recipe', or is that now done within the yaml?

@evanmason
Copy link
Collaborator Author

Is it the file 'tracking.yaml' in share? That is 2 years old.

Using that I get the following error:

(VENVP3) [emason@marula global4eddytracking]$ EddyTracking my_tracking.yaml
/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/EGG-INFO/scripts/EddyTracking:109: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml_load(stream)
/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/py_eddy_tracker/observations/observation.py:692: RuntimeWarning: invalid value encountered in less
  return distance < 125
/home/emason/VENVP3/lib/python3.7/site-packages/numpy/ma/core.py:4008: RuntimeWarning: invalid value encountered in equal
  check = compare(sdata, odata)
/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/py_eddy_tracker/tracking.py:400: RuntimeWarning: invalid value encountered in equal
  h_v.min = h_v[:].min()
/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/py_eddy_tracker/tracking.py:401: RuntimeWarning: invalid value encountered in equal
  h_v.max = h_v[:].max()
Traceback (most recent call last):
  File "/home/emason/VENVP3/bin/EddyTracking", line 4, in <module>
    __import__('pkg_resources').run_script('pyEddyTracker==3.0.0', 'EddyTracking')
  File "/home/emason/VENVP3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/emason/VENVP3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1462, in run_script
    exec(code, namespace, namespace)
  File "/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/EGG-INFO/scripts/EddyTracking", line 190, in <module>
    SHORT_CORRESPONDANCES.shorter_than(size_max=NB_OBS_MIN)
  File "/home/emason/VENVP3/lib/python3.7/site-packages/pyEddyTracker-3.0.0-py3.7.egg/py_eddy_tracker/tracking.py", line 513, in shorter_than
    translate = empty(i_keep_track.max() + 1, dtype='u4')
  File "/home/emason/VENVP3/lib/python3.7/site-packages/numpy/core/_methods.py", line 30, in _amax
    return umr_maximum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation maximum which has no identity
(VENVP3) [emason@marula global4eddytracking]$

Two files are produced:
148 -rw-rw-r-- 1 emason emason 148224 Dec 28 17:43 Cyclonic_correspondances.nc
28 -rw-rw-r-- 1 emason emason 25888 Dec 28 17:43 Cyclonic_untracked.nc
but no Cyclonic.nc.

My yaml file contains:

#DIAGNOSTIC_TYPE: 'SLA'
#DIAGNOSTIC_TYPE: 'ADT'

PATHS:
  # Files produces with EddyIdentification
  FILES_PATTERN: /marula/emason/data/Copernicus/GLOBAL_REANALYSIS_PHY_001_030/global4eddytracking/Cyclonic_20061*.nc
  # Path and filename of Chelton et al (1998) Rossby radius data
  # Obtain file from:
  # http://www-po.coas.oregonstate.edu/research/po/research/rossby_radius/
  RW_PATH: '/home/emason/Dropbox/rossrad.dat'
  # Path for saving of outputs
  SAVE_DIR: '/marula/emason/data/Copernicus/GLOBAL_REANALYSIS_PHY_001_030/global4eddytracking/'

# Minimum number of observations to store eddy
TRACK_DURATION_MIN: 10
VIRTUAL_LENGTH_MAX: 0

@evanmason
Copy link
Collaborator Author

So I updated all PET dependencies and that solved the issue for the missing Cyclonic.nc. I don't know which dependency was the culprit.

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