-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
import scipp as sc
sc.scalar('abc').broadcast(dims=('x',), shape=(10000,)) # ok
sc.scalar('abc').broadcast(dims=('x',), shape=(100000,)) # Jupyter HTML repr raises_repr_html_ raises:
---------------------------------------------------------------------------
DTypeError Traceback (most recent call last)
File ~/miniconda3/envs/dev/lib/python3.8/site-packages/IPython/core/formatters.py:343, in BaseFormatter.__call__(self, obj)
341 method = get_real_method(obj, self.print_method)
342 if method is not None:
--> 343 return method()
344 return None
345 else:
File ~/code/scipp/scipp/src/scipp/html/__init__.py:39, in make_html(container)
36 from .formatting_html import dataset_repr, variable_repr
38 if isinstance(container, Variable):
---> 39 return variable_repr(container)
40 elif isinstance(container, DataGroup):
41 return datagroup_repr(container)
File ~/code/scipp/scipp/src/scipp/html/formatting_html.py:534, in variable_repr(var)
530 def variable_repr(var):
531 obj_type = "scipp.{}".format(type(var).__name__)
533 header_components = [
--> 534 f"<div class='sc-obj-type'>{escape(obj_type)} " + _format_size(var) + "</div>"
535 ]
537 sections = [variable_section(var)]
539 return _obj_repr(header_components, sections)
File ~/code/scipp/scipp/src/scipp/html/formatting_html.py:497, in _format_size(obj)
496 def _format_size(obj):
--> 497 view_size = obj.__sizeof__()
498 underlying_size = obj.underlying_size()
499 res = f"({human_readable_size(view_size)}"
DTypeError: 'size_of' does not support dtypes 'int64', 'int64', Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done