holoviz-topics / EarthSim

Tools for working with and visualizing environmental simulations.
https://earthsim.holoviz.org
BSD 3-Clause "New" or "Revised" License
65 stars 21 forks source link

Error with links in Annotator instantiation #261

Closed kcpevey closed 5 years ago

kcpevey commented 5 years ago

I just updated my env to the latest pyviz master for hv, gv, panel and earthsim and it seems I've now broken something that was previously working.

versions:
panel = '0.2.0a3.post4+g82e3f43'
holoviews = '1.11.0a9.post1+g98b5e96c'
geoviews = '1.6.0a1' earthsim = '1.1.0a3+gc1fce56-dirty'

Is what has happened immediately apparent? I can't provide the full code here so it'll take some work to reduce it down. I didn't want to do that if @philippjfr could see the issue right offhand.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-15-7d973a09da73> in <module>
     70                             tile_url=wmts_param.tile_server,
     71                             polys=list(gv_dict.values()),
---> 72                             poly_columns=['name'])
     73 
     74 

~/ers/gitHub/earthsim/master/EarthSim/earthsim/annotators.py in __init__(self, poly_data, **params)
    191 
    192     def __init__(self, poly_data={}, **params):
--> 193         super(PolyAnnotator, self).__init__(**params)
    194         style = dict(editable=True)
    195         plot = dict(width=self.width, height=self.table_height)

~/ers/gitHub/earthsim/master/EarthSim/earthsim/annotators.py in __init__(self, **params)
    241         projected = gv.project(self.points, projection=ccrs.PlateCarree())
    242         self.point_table = Table(projected).opts(plot=plot, style=style)
--> 243         self.point_link = PointTableLink(source=self.points, target=self.point_table)
    244 
    245     def view(self):

~/ers/gitHub/earthsim/master/EarthSim/earthsim/links.py in __init__(self, source, target, **params)
     22             dimensions = [dimension_sanitizer(d.name) for d in target.dimensions()[:2]]
     23             params['point_columns'] = dimensions
---> 24         super(PointTableLink, self).__init__(source, target, **params)
     25 
     26 

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/links.py in __init__(self, source, target, **params)
     37         self._target = weakref.ref(target) if target else None
     38         super(Link, self).__init__(**params)
---> 39         self.link()
     40 
     41     @classmethod

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/links.py in link(self)
     62             self.registry[self.source].append(self)
     63         else:
---> 64             self.registry[self.source] = [self]
     65 
     66     def unlink(self):

~/miniconda3/envs/earthsim/lib/python3.6/weakref.py in __setitem__(self, key, value)
    405 
    406     def __setitem__(self, key, value):
--> 407         self.data[ref(key, self._remove)] = value
    408 
    409     def copy(self):

TypeError: cannot create weak reference to 'NoneType' object
philippjfr commented 5 years ago

Thanks, this was only merged this morning, I'll attempt to get a fix in asap.

philippjfr commented 5 years ago

Actually I'll need to update the Links code in earthsim.

kcpevey commented 5 years ago

Thanks!

philippjfr commented 5 years ago

Until that's merged I'd recommend sticking with holoviews 1.11.0a9.

kcpevey commented 5 years ago

Got it. will do.