Skip to content

Instantly share code, notes, and snippets.

@epifanio
Created April 7, 2021 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epifanio/1e0ed21dd7f92c2ce55d04886d71aa80 to your computer and use it in GitHub Desktop.
Save epifanio/1e0ed21dd7f92c2ce55d04886d71aa80 to your computer and use it in GitHub Desktop.
WARNING:param.dynamic_operation: Callable raised "AttributeError("'DataArray' object has no attribute '_file_obj'")".
Invoked as dynamic_operation(numpy.datetime64('2021-04-07T01:00:00.000000000'), height=400, scale=1.0, width=400, x_range=None, y_range=None)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/opt/conda/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
968
969 if method is not None:
--> 970 return method(include=include, exclude=exclude)
971 return None
972 else:
/opt/conda/lib/python3.8/site-packages/holoviews/core/dimension.py in _repr_mimebundle_(self, include, exclude)
1315 combined and returned.
1316 """
-> 1317 return Store.render(self)
1318
1319
/opt/conda/lib/python3.8/site-packages/holoviews/core/options.py in render(cls, obj)
1403 data, metadata = {}, {}
1404 for hook in hooks:
-> 1405 ret = hook(obj)
1406 if ret is None:
1407 continue
/opt/conda/lib/python3.8/site-packages/holoviews/ipython/display_hooks.py in pprint_display(obj)
280 if not ip.display_formatter.formatters['text/plain'].pprint:
281 return None
--> 282 return display(obj, raw_output=True)
283
284
/opt/conda/lib/python3.8/site-packages/holoviews/ipython/display_hooks.py in display(obj, raw_output, **kwargs)
256 elif isinstance(obj, (HoloMap, DynamicMap)):
257 with option_state(obj):
--> 258 output = map_display(obj)
259 elif isinstance(obj, Plot):
260 output = render(obj)
/opt/conda/lib/python3.8/site-packages/holoviews/ipython/display_hooks.py in wrapped(element)
144 try:
145 max_frames = OutputSettings.options['max_frames']
--> 146 mimebundle = fn(element, max_frames=max_frames)
147 if mimebundle is None:
148 return {}, {}
/opt/conda/lib/python3.8/site-packages/holoviews/ipython/display_hooks.py in map_display(vmap, max_frames)
204 return None
205
--> 206 return render(vmap)
207
208
/opt/conda/lib/python3.8/site-packages/holoviews/ipython/display_hooks.py in render(obj, **kwargs)
66 renderer = renderer.instance(fig='png')
67
---> 68 return renderer.components(obj, **kwargs)
69
70
/opt/conda/lib/python3.8/site-packages/holoviews/plotting/renderer.py in components(self, obj, fmt, comm, **kwargs)
408 doc = Document()
409 with config.set(embed=embed):
--> 410 model = plot.layout._render_model(doc, comm)
411 if embed:
412 return render_model(model, comm)
/opt/conda/lib/python3.8/site-packages/panel/viewable.py in _render_model(self, doc, comm)
422 if comm is None:
423 comm = state._comm_manager.get_server_comm()
--> 424 model = self.get_root(doc, comm)
425
426 if config.embed:
/opt/conda/lib/python3.8/site-packages/panel/viewable.py in get_root(self, doc, comm, preprocess)
480 """
481 doc = init_doc(doc)
--> 482 root = self._get_model(doc, comm=comm)
483 if preprocess:
484 self._preprocess(root)
/opt/conda/lib/python3.8/site-packages/panel/layout/base.py in _get_model(self, doc, root, parent, comm)
110 if root is None:
111 root = model
--> 112 objects = self._get_objects(model, [], doc, root, comm)
113 props = dict(self._init_properties(), objects=objects)
114 model.update(**self._process_param_change(props))
/opt/conda/lib/python3.8/site-packages/panel/layout/base.py in _get_objects(self, model, old_objects, doc, root, comm)
100 else:
101 try:
--> 102 child = pane._get_model(doc, root, model, comm)
103 except RerenderError:
104 return self._get_objects(model, current_objects[:i], doc, root, comm)
/opt/conda/lib/python3.8/site-packages/panel/pane/holoviews.py in _get_model(self, doc, root, parent, comm)
239 plot = self.object
240 else:
--> 241 plot = self._render(doc, comm, root)
242
243 plot.pane = self
/opt/conda/lib/python3.8/site-packages/panel/pane/holoviews.py in _render(self, doc, comm, root)
304 kwargs['comm'] = comm
305
--> 306 return renderer.get_plot(self.object, **kwargs)
307
308 def _cleanup(self, root):
/opt/conda/lib/python3.8/site-packages/holoviews/plotting/bokeh/renderer.py in get_plot(self_or_cls, obj, doc, renderer, **kwargs)
71 combining the bokeh model with another plot.
72 """
---> 73 plot = super(BokehRenderer, self_or_cls).get_plot(obj, doc, renderer, **kwargs)
74 if plot.document is None:
75 plot.document = Document() if self_or_cls.notebook_context else curdoc()
/opt/conda/lib/python3.8/site-packages/holoviews/plotting/renderer.py in get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
218
219 # Initialize DynamicMaps with first data item
--> 220 initialize_dynamic(obj)
221
222 if not renderer:
/opt/conda/lib/python3.8/site-packages/holoviews/plotting/util.py in initialize_dynamic(obj)
250 continue
251 if not len(dmap):
--> 252 dmap[dmap._initial_key()]
253
254
/opt/conda/lib/python3.8/site-packages/holoviews/core/spaces.py in __getitem__(self, key)
1339 # Not a cross product and nothing cached so compute element.
1340 if cache is not None: return cache
-> 1341 val = self._execute_callback(*tuple_key)
1342 if data_slice:
1343 val = self._dataslice(val, data_slice)
/opt/conda/lib/python3.8/site-packages/holoviews/core/spaces.py in _execute_callback(self, *args)
1108
1109 with dynamicmap_memoization(self.callback, self.streams):
-> 1110 retval = self.callback(*args, **kwargs)
1111 return self._style(retval)
1112
/opt/conda/lib/python3.8/site-packages/holoviews/core/spaces.py in __call__(self, *args, **kwargs)
712
713 try:
--> 714 ret = self.callable(*args, **kwargs)
715 except KeyError:
716 # KeyError is caught separately because it is used to signal
/opt/conda/lib/python3.8/site-packages/holoviews/util/__init__.py in dynamic_operation(*key, **kwargs)
1041 def dynamic_operation(*key, **kwargs):
1042 key, obj = resolve(key, kwargs)
-> 1043 return apply(obj, *key, **kwargs)
1044
1045 operation = self.p.operation
/opt/conda/lib/python3.8/site-packages/holoviews/util/__init__.py in apply(element, *key, **kwargs)
1033 def apply(element, *key, **kwargs):
1034 kwargs = dict(util.resolve_dependent_kwargs(self.p.kwargs), **kwargs)
-> 1035 processed = self._process(element, key, kwargs)
1036 if (self.p.link_dataset and isinstance(element, Dataset) and
1037 isinstance(processed, Dataset) and processed._dataset is None):
/opt/conda/lib/python3.8/site-packages/holoviews/util/__init__.py in _process(self, element, key, kwargs)
1015 elif isinstance(self.p.operation, Operation):
1016 kwargs = {k: v for k, v in kwargs.items() if k in self.p.operation.param}
-> 1017 return self.p.operation.process_element(element, key, **kwargs)
1018 else:
1019 return self.p.operation(element, **kwargs)
/opt/conda/lib/python3.8/site-packages/holoviews/core/operation.py in process_element(self, element, key, **params)
192 self.p = param.ParamOverrides(self, params,
193 allow_extra_keywords=self._allow_extra_keywords)
--> 194 return self._apply(element, key)
195
196
/opt/conda/lib/python3.8/site-packages/holoviews/core/operation.py in _apply(self, element, key)
139 if not in_method:
140 element._in_method = True
--> 141 ret = self._process(element, key)
142 if hasattr(element, '_in_method') and not in_method:
143 element._in_method = in_method
/opt/conda/lib/python3.8/site-packages/holoviews/operation/datashader.py in _process(self, element, key)
1496
1497 def _process(self, element, key=None):
-> 1498 agg = rasterize._process(self, element, key)
1499 shaded = shade._process(self, agg, key)
1500 return shaded
/opt/conda/lib/python3.8/site-packages/holoviews/operation/datashader.py in _process(self, element, key)
1475 if k in transform.param})
1476 op._precomputed = self._precomputed
-> 1477 element = element.map(op, predicate)
1478 self._precomputed = op._precomputed
1479
/opt/conda/lib/python3.8/site-packages/holoviews/core/data/__init__.py in pipelined_fn(*args, **kwargs)
203
204 try:
--> 205 result = method_fn(*args, **kwargs)
206 if PipelineMeta.disable:
207 return result
/opt/conda/lib/python3.8/site-packages/holoviews/core/data/__init__.py in map(self, *args, **kwargs)
1220
1221 def map(self, *args, **kwargs):
-> 1222 return super(Dataset, self).map(*args, **kwargs)
1223 map.__doc__ = LabelledData.map.__doc__
1224
/opt/conda/lib/python3.8/site-packages/holoviews/core/dimension.py in map(self, map_fn, specs, clone)
708 return deep_mapped
709 else:
--> 710 return map_fn(self) if applies else self
711
712
/opt/conda/lib/python3.8/site-packages/holoviews/core/operation.py in __call__(self, element, **kwargs)
212 elif ((self._per_element and isinstance(element, Element)) or
213 (not self._per_element and isinstance(element, ViewableElement))):
--> 214 return self._apply(element)
215 elif 'streams' not in kwargs:
216 kwargs['streams'] = self.p.streams
/opt/conda/lib/python3.8/site-packages/holoviews/core/operation.py in _apply(self, element, key)
139 if not in_method:
140 element._in_method = True
--> 141 ret = self._process(element, key)
142 if hasattr(element, '_in_method') and not in_method:
143 element._in_method = in_method
/opt/conda/lib/python3.8/site-packages/holoviews/operation/datashader.py in _process(self, element, key)
937 agg_fn = self._get_aggregator(element, add_field=False)
938 for vd, xarr in arrays.items():
--> 939 rarray = cvs.raster(xarr, upsample_method=interp,
940 downsample_method=agg_fn)
941
/opt/conda/lib/python3.8/site-packages/datashader/core.py in raster(self, source, layer, upsample_method, downsample_method, nan_value, agg, interpolate, chunksize, max_mem)
1126 dims = [ydim, xdim]
1127 attrs = dict(res=res[0])
-> 1128 if source._file_obj is not None and hasattr(source._file_obj, 'nodata'):
1129 attrs['nodata'] = source._file_obj.nodata
1130
/opt/conda/lib/python3.8/site-packages/xarray/core/common.py in __getattr__(self, name)
237 with suppress(KeyError):
238 return source[name]
--> 239 raise AttributeError(
240 "{!r} object has no attribute {!r}".format(type(self).__name__, name)
241 )
AttributeError: 'DataArray' object has no attribute '_file_obj'
:DynamicMap [time]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment