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

py3: zip returns iterator #15

Closed
mathause opened this issue Oct 4, 2016 · 0 comments
Closed

py3: zip returns iterator #15

mathause opened this issue Oct 4, 2016 · 0 comments

Comments

@mathause
Copy link
Member

mathause commented Oct 4, 2016

In python 3 zip([1, 2], [3, 4]) does not return a list.

In [11]: mask = regionmask.defined_regions.giorgi.mask(airtemps)
    ...: print('All NaN? ',np.all(np.isnan(mask)))
    ...: 
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-11-2147f815f4cd> in <module>()
----> 1 mask = regionmask.defined_regions.giorgi.mask(airtemps)
      2 print('All NaN? ',np.all(np.isnan(mask)))

/home/mah/code/regionmask/regionmask/core/mask.py in _mask(self, lon_or_obj, lat, lon_name, lat_name, xarray, wrap_lon)
    132         raise NotImplementedError("Only method 'contains' is implemented")
    133 
--> 134     mask = func(lon, lat, data, numbers=self.numbers)
    135 
    136     if np.all(np.isnan(mask)):

/home/mah/code/regionmask/regionmask/core/mask.py in create_mask_contains(lon, lat, coords, fill, numbers)
    260         for c in cs:
    261             bbPath = mplPath.Path(c)
--> 262             sel = bbPath.contains_points(lonlat)
    263             out[sel] = numbers[i]
    264 

/home/mah/anaconda2/envs/regionmask3/lib/python3.5/site-packages/matplotlib/path.py in contains_points(self, points, transform, radius)
    510         if transform is not None:
    511             transform = transform.frozen()
--> 512         result = _path.points_in_path(points, radius, self, transform)
    513         return result
    514 

TypeError: float() argument must be a string or a number, not 'zip'
mathause added a commit that referenced this issue Oct 4, 2016
@mathause mathause closed this as completed Oct 4, 2016
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