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

0.12.33: pytest is failing in few units #1512

Open
kloczek opened this issue Jul 27, 2022 · 7 comments
Open

0.12.33: pytest is failing in few units #1512

kloczek opened this issue Jul 27, 2022 · 7 comments

Comments

@kloczek
Copy link

kloczek commented Jul 27, 2022

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.33, configfile: pytest.ini
plugins: anyio-3.6.1, nbval-0.9.6
collected 952 items

examples/Index.ipynb .                                                                                                                                               [  0%]
examples/Introduction.ipynb ...............................                                                                                                          [  3%]
examples/Advanced Plotting/Advanced Plotting.ipynb ..............                                                                                                    [  4%]
examples/Advanced Plotting/Animations.ipynb ...............                                                                                                          [  6%]
examples/Advanced Plotting/Axis Properties.ipynb .........................                                                                                           [  9%]
examples/Advanced Plotting/Plotting Dates.ipynb ...............                                                                                                      [ 10%]
examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb ..FFFF                                                                                           [ 11%]
examples/Applications/Mobile Patent Suits.ipynb ...                                                                                                                  [ 11%]
examples/Applications/Neural Network.ipynb ...                                                                                                                       [ 11%]
examples/Applications/Outlier Detection.ipynb .........                                                                                                              [ 12%]
examples/Applications/Visualizing the US Elections.ipynb ..........FF.......                                                                                         [ 14%]
examples/Applications/Equity Index Performance/Time Series.ipynb ...                                                                                                 [ 15%]
examples/Applications/Logs Analytics/Logs Dashboard.ipynb ............                                                                                               [ 16%]
examples/Applications/Wealth Of Nations/Bubble Chart.ipynb ........                                                                                                  [ 17%]
examples/Applications/Wealth Of Nations/Choropleth.ipynb ........                                                                                                    [ 18%]
examples/Basic Plotting/Basic Plotting.ipynb .........                                                                                                               [ 19%]
examples/Basic Plotting/Pyplot.ipynb .........................................                                                                                       [ 23%]
examples/Interactions/Interaction Layer.ipynb .......................................................                                                                [ 29%]
examples/Interactions/Mark Interactions.ipynb .....................                                                                                                  [ 31%]
examples/Interactions/Selectors.ipynb .............                                                                                                                  [ 32%]
examples/Marks/Object Model/Bars.ipynb ......................                                                                                                        [ 34%]
examples/Marks/Object Model/Bins.ipynb ...........                                                                                                                   [ 36%]
examples/Marks/Object Model/Boxplot.ipynb ......                                                                                                                     [ 36%]
examples/Marks/Object Model/Candles.ipynb ..........                                                                                                                 [ 37%]
examples/Marks/Object Model/FlexLine.ipynb ....                                                                                                                      [ 38%]
examples/Marks/Object Model/Graph.ipynb .............                                                                                                                [ 39%]
examples/Marks/Object Model/GridHeatMap.ipynb .................                                                                                                      [ 41%]
examples/Marks/Object Model/HeatMap.ipynb .....                                                                                                                      [ 41%]
examples/Marks/Object Model/Hist.ipynb ...........                                                                                                                   [ 43%]
examples/Marks/Object Model/Image.ipynb ......                                                                                                                       [ 43%]
examples/Marks/Object Model/Label.ipynb ........                                                                                                                     [ 44%]
examples/Marks/Object Model/Lines.ipynb ............................                                                                                                 [ 47%]
examples/Marks/Object Model/Map.ipynb ........                                                                                                                       [ 48%]
examples/Marks/Object Model/Market Map.ipynb ...............                                                                                                         [ 49%]
examples/Marks/Object Model/Pie.ipynb ...............                                                                                                                [ 51%]
examples/Marks/Object Model/Scatter.ipynb .......................................                                                                                    [ 55%]
examples/Marks/Object Model/ScatterMega.ipynb ....................................                                                                                   [ 59%]
examples/Marks/Pyplot/Bars.ipynb ...................                                                                                                                 [ 61%]
examples/Marks/Pyplot/Bins.ipynb ...........                                                                                                                         [ 62%]
examples/Marks/Pyplot/Boxplot.ipynb ......                                                                                                                           [ 63%]
examples/Marks/Pyplot/Candles.ipynb .........                                                                                                                        [ 64%]
examples/Marks/Pyplot/GridHeatMap.ipynb .................                                                                                                            [ 65%]
examples/Marks/Pyplot/HeatMap.ipynb .....                                                                                                                            [ 66%]
examples/Marks/Pyplot/Hist.ipynb ...........                                                                                                                         [ 67%]
examples/Marks/Pyplot/Image.ipynb ......                                                                                                                             [ 68%]
examples/Marks/Pyplot/Label.ipynb ........                                                                                                                           [ 69%]
examples/Marks/Pyplot/Lines.ipynb ........................                                                                                                           [ 71%]
examples/Marks/Pyplot/Map.ipynb .........                                                                                                                            [ 72%]
examples/Marks/Pyplot/Pie.ipynb ..............                                                                                                                       [ 73%]
examples/Marks/Pyplot/Scatter.ipynb .....................................                                                                                            [ 77%]
examples/Scales/Color Scales.ipynb .................                                                                                                                 [ 79%]
examples/Tutorials/Brush Interval Selector.ipynb ......                                                                                                              [ 80%]
examples/Tutorials/Fast Interval Selector.ipynb ......                                                                                                               [ 80%]
examples/Tutorials/Gaussian Density Widget.ipynb .....                                                                                                               [ 81%]
examples/Tutorials/Gaussian Density.ipynb .....                                                                                                                      [ 81%]
examples/Tutorials/Linking Plots With Widgets.ipynb .......                                                                                                          [ 82%]
examples/Tutorials/Object Model.ipynb ....                                                                                                                           [ 83%]
examples/Tutorials/Pyplot.ipynb ....                                                                                                                                 [ 83%]
examples/Tutorials/Updating Plots.ipynb .......                                                                                                                      [ 84%]
tests/binary_serialization_test.py .....                                                                                                                             [ 84%]
tests/marks_test.py ....                                                                                                                                             [ 85%]
tests/selector_test.py .                                                                                                                                             [ 85%]
ui-tests/tests/notebooks/bars.ipynb ......                                                                                                                           [ 85%]
ui-tests/tests/notebooks/bars2d_update.ipynb ........                                                                                                                [ 86%]
ui-tests/tests/notebooks/bars_update.ipynb .........                                                                                                                 [ 87%]
ui-tests/tests/notebooks/figure_pyplot.ipynb ...                                                                                                                     [ 88%]
ui-tests/tests/notebooks/graph.ipynb ..                                                                                                                              [ 88%]
ui-tests/tests/notebooks/graph_update.ipynb ........                                                                                                                 [ 89%]
ui-tests/tests/notebooks/gridheatmap.ipynb .....                                                                                                                     [ 89%]
ui-tests/tests/notebooks/gridheatmap_update.ipynb .........                                                                                                          [ 90%]
ui-tests/tests/notebooks/hist_update.ipynb ........                                                                                                                  [ 91%]
ui-tests/tests/notebooks/index_selector_update.ipynb ..                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines.ipynb ..                                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines_update.ipynb ............                                                                                                             [ 93%]
ui-tests/tests/notebooks/map.ipynb .                                                                                                                                 [ 93%]
ui-tests/tests/notebooks/ohlc_update.ipynb ..........                                                                                                                [ 94%]
ui-tests/tests/notebooks/ordinal_scale.ipynb ....                                                                                                                    [ 94%]
ui-tests/tests/notebooks/pie_update.ipynb ....................                                                                                                       [ 96%]
ui-tests/tests/notebooks/scatter.ipynb ..                                                                                                                            [ 96%]
ui-tests/tests/notebooks/scatter_update.ipynb ............                                                                                                           [ 98%]
ui-tests/tests/notebooks/scattergl_update.ipynb .............                                                                                                        [ 99%]
ui-tests/tests/notebooks/ticks.ipynb ....                                                                                                                            [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2 ________________________________________________
Notebook cell execution failed
Cell 2: Cell execution caused an exception

Input:
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_iris()
data = scale(digits.data)
n_features=4
#n_pca=3
#pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(data, columns=['feature_{}'.format(x) for x in range(n_features)])
df['leaf'] = digits.target
df['extra_info'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [3], in <cell line: 2>()
      1 import pandas as pd
----> 2 from sklearn.datasets import load_iris
      3 from sklearn.decomposition import PCA
      4 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3 ________________________________________________
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'leaf',
                                group_columns=['extra_info'],
                                bins=25,
                                f_lim = {'min':-3, 'max':3}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 feature_vector_distribution(df, 'leaf',
      2                                 group_columns=['extra_info'],
      3                                 bins=25,
      4                                 f_lim = {'min':-3, 'max':3}
      5                                 )

NameError: name 'df' is not defined

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4 ________________________________________________
Notebook cell execution failed
Cell 4: Cell execution caused an exception

Input:
import numpy as np
import pandas as pd
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_digits()
data = scale(digits.data)

n_pca=10
pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(pca.transform(data), columns=['pca_{}'.format(x) for x in range(n_pca)])
df['digit'] = digits.target
df['test'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [5], in <cell line: 3>()
      1 import numpy as np
      2 import pandas as pd
----> 3 from sklearn.datasets import load_digits
      4 from sklearn.decomposition import PCA
      5 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5 ________________________________________________
Notebook cell execution failed
Cell 5: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'digit',
                                group_columns=['test'],
                                bins=20,
                                f_lim = {'min':-7, 'max':7}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 feature_vector_distribution(df, 'digit',
      2                                 group_columns=['test'],
      3                                 bins=20,
      4                                 f_lim = {'min':-7, 'max':7}
      5                                 )

NameError: name 'df' is not defined

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 10 _____________________________________________________
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

dt_x = DateScale()
sc_y = LinearScale()

clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
                          scales={'x': dt_x, 'y': sc_y},
                          colors=['#2aa1ec'])

trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
                        scales={'x': dt_x, 'y': sc_y},
                        colors=['#E91D0E'])

ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)
ax_y = Axis(scale=sc_y, orientation='vertical', label='Percentage')

scat_fig = Figure(marks=[clinton_scatter, trump_scatter], axes=[ax_x, ax_y], title='General Election - National Polls')

Traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [11], in <cell line: 6>()
      3 dt_x = DateScale()
      4 sc_y = LinearScale()
----> 6 clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
      7                           scales={'x': dt_x, 'y': sc_y},
      8                           colors=['#2aa1ec'])
     10 trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
     11                         scales={'x': dt_x, 'y': sc_y},
     12                         colors=['#E91D0E'])
     14 ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:547, in _ScatterBase.__init__(self, **kwargs)
    545 self._drag_handlers = CallbackDispatcher()
    546 self._drag_end_handlers = CallbackDispatcher()
--> 547 super(_ScatterBase, self).__init__(**kwargs)
    549 self._name_to_handler.update({
    550     'drag_start': self._drag_start_handlers,
    551     'drag_end': self._drag_end_handlers,
    552     'drag': self._drag_handlers
    553 })

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:242, in Mark.__init__(self, **kwargs)
    241 def __init__(self, **kwargs):
--> 242     super(Mark, self).__init__(**kwargs)
    243     self._hover_handlers = CallbackDispatcher()
    244     self._click_handlers = CallbackDispatcher()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:480, in Widget.__init__(self, **kwargs)
    477 super(Widget, self).__init__(**kwargs)
    479 Widget._call_widget_constructed(self)
--> 480 self.open()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:493, in Widget.open(self)
    491 """Open a comm to the frontend if one isn't already open."""
    492 if self.comm is None:
--> 493     state, buffer_paths, buffers = _remove_buffers(self.get_state())
    495     args = dict(target_name='jupyter.widget',
    496                 data={'state': state, 'buffer_paths': buffer_paths},
    497                 buffers=buffers,
    498                 metadata={'version': __protocol_version__}
    499                 )
    500     if self._model_id is not None:

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:583, in Widget.get_state(self, key, drop_defaults)
    581 for k in keys:
    582     to_json = self.trait_metadata(k, 'to_json', self._trait_to_json)
--> 583     value = to_json(getattr(self, k), self)
    584     if not PY3 and isinstance(traits[k], Bytes) and isinstance(value, bytes):
    585         value = memoryview(value)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/traits.py:177, in array_to_json(ar, obj, force_contiguous)
    175         return [array_to_json(np.array(row), obj, force_contiguous) for row in ar]
    176     else:
--> 177         raise ValueError("Unsupported dtype object")
    179 if ar.dtype.kind in ['S', 'U']:  # strings to as plain json
    180     return ar.tolist()

ValueError: Unsupported dtype object

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 11 _____________________________________________________
Notebook cell execution failed
Cell 11: Cell execution caused an exception

Input:
VBox([map_fig, scat_fig])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [12], in <cell line: 1>()
----> 1 VBox([map_fig, scat_fig])

NameError: name 'scat_fig' is not defined

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/traittypes/traittypes.py:20
  /usr/lib/python3.8/site-packages/traittypes/traittypes.py:20: DeprecationWarning:
              Sentinel is not a public part of the traitlets API.
              It was published by mistake, and may be removed in the future.

    Empty = Sentinel('Empty', 'traittypes',

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:633: 81 warnings
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:633: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 10
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 11
========================================================== 6 failed, 946 passed, 82 warnings in 358.07s (0:05:58) ==========================================================

Here list of modules installed in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
anyio                         3.6.1
appdirs                       1.4.4
argon2-cffi                   21.1.0
asttokens                     2.0.5
attrs                         22.1.0.dev0
Babel                         2.10.2
backcall                      0.2.0
beautifulsoup4                4.10.0
bleach                        5.0.0
Brlapi                        0.8.3
build                         0.8.0
cffi                          1.15.1
charset-normalizer            2.1.0
codespell                     2.1.0
coverage                      6.4.2
cssselect                     1.1.0
cycler                        0.11.0
debugpy                       1.6.2
decorator                     5.1.1
defusedxml                    0.7.1
deprecation                   2.1.0
distro                        1.7.0
docutils                      0.18.1
entrypoints                   0.4
executing                     0.8.3
extras                        1.0.0
fastjsonschema                2.16.1
fixtures                      4.0.0
fonttools                     4.34.4
gpg                           1.17.1-unknown
html5lib                      1.1
idna                          3.3
imagesize                     1.4.1
importlib-metadata            4.12.0
importlib-resources           5.9.0
iniconfig                     1.1.1
ipykernel                     6.15.1
ipython                       8.4.0
ipython-genutils              0.2.0
ipywidgets                    7.7.0
jedi                          0.18.1
Jinja2                        3.1.1
joblib                        1.1.0
json5                         0.9.8
jsonschema                    4.7.2
jupyter-client                7.3.4
jupyter-core                  4.11.1
jupyter-packaging             0.12.2
jupyter-server                1.18.1
jupyter-sphinx                0.4.0
jupyterlab                    3.4.2
jupyterlab-pygments           0.1.2
jupyterlab-server             2.15.0
kiwisolver                    1.4.4
libcomps                      0.1.18
louis                         3.22.0
lxml                          4.9.1
MarkupSafe                    2.1.1
matplotlib                    3.5.2
matplotlib-inline             0.1.3
mistune                       2.0.3
nbclassic                     0.4.2
nbclient                      0.6.6
nbconvert                     6.5.0
nbformat                      5.4.0
nbval                         0.9.6
nest-asyncio                  1.5.5
notebook                      6.4.12
notebook-shim                 0.1.0
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pandas                        1.4.2
pandocfilters                 1.5.0
parso                         0.8.3
pbr                           5.8.1
pep517                        0.12.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.2.0
pip                           22.0.4
pluggy                        1.0.0
ply                           3.11
Pollster                      0.1.6
prometheus-client             0.14.1
prompt-toolkit                3.0.29
psutil                        5.9.0
ptyprocess                    0.7.0
pure-eval                     0.2.2
py                            1.11.0
pycparser                     2.21
Pygments                      2.12.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyrsistent                    0.18.1
pytest                        7.1.2
python-dateutil               2.8.2
pytz                          2022.1
pyzmq                         23.2.0
requests                      2.28.1
rpm                           4.17.0
scikit-learn                  1.1.1
scipy                         1.8.1
scour                         0.38.2
Send2Trash                    1.8.0
setuptools                    63.2.0
six                           1.16.0
sklearn                       0.0
sniffio                       1.2.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        5.1.1
sphinx-rtd-theme              1.0.0
sphinx-thebe                  0.1.2
sphinxcontrib-applehelp       1.0.2.dev20220714
sphinxcontrib-devhelp         1.0.2.dev20220714
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220712
sphinxcontrib-qthelp          1.0.3.dev20220712
sphinxcontrib-serializinghtml 1.1.5
stack-data                    0.3.0
terminado                     0.15.0
testtools                     2.5.0
threadpoolctl                 3.1.0
tinycss2                      1.1.1
tomli                         2.0.1
tomlkit                       0.11.1
tornado                       6.1
traitlets                     5.3.0
traittypes                    0.2.1
urllib3                       1.26.9
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.3.2
wheel                         0.37.1
widgetsnbextension            3.6.0
zipp                          3.8.1
@kloczek
Copy link
Author

kloczek commented Jul 27, 2022

Second issue: looks like MANIFEST.in needs to be trimed to not install content of the tests/

RPM build errors:
   /usr/etc/jupyter/nbconfig/notebook.d/bqplot.json
   /usr/lib/python3.8/site-packages/tests/__init__.py
   /usr/lib/python3.8/site-packages/tests/__pycache__/__init__.cpython-38.opt-1.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/__init__.cpython-38.opt-2.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/__init__.cpython-38.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/binary_serialization_test.cpython-38.opt-1.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/binary_serialization_test.cpython-38.opt-2.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/binary_serialization_test.cpython-38.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/conftest.cpython-38.opt-1.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/conftest.cpython-38.opt-2.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/conftest.cpython-38.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/marks_test.cpython-38.opt-1.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/marks_test.cpython-38.opt-2.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/marks_test.cpython-38.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/selector_test.cpython-38.opt-1.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/selector_test.cpython-38.opt-2.pyc
   /usr/lib/python3.8/site-packages/tests/__pycache__/selector_test.cpython-38.pyc
   /usr/lib/python3.8/site-packages/tests/binary_serialization_test.py
   /usr/lib/python3.8/site-packages/tests/conftest.py
   /usr/lib/python3.8/site-packages/tests/marks_test.py
   /usr/lib/python3.8/site-packages/tests/selector_test.py

@kloczek
Copy link
Author

kloczek commented Aug 23, 2022

Just tested 0.12.34 and it is better however still two units are failimg

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.34, configfile: pytest.ini
plugins: anyio-3.6.1, nbval-0.9.6
collected 952 items

examples/Index.ipynb .                                                                                                                                               [  0%]
examples/Introduction.ipynb ...............................                                                                                                          [  3%]
examples/Advanced Plotting/Advanced Plotting.ipynb ..............                                                                                                    [  4%]
examples/Advanced Plotting/Animations.ipynb ...............                                                                                                          [  6%]
examples/Advanced Plotting/Axis Properties.ipynb .........................                                                                                           [  9%]
examples/Advanced Plotting/Plotting Dates.ipynb ...............                                                                                                      [ 10%]
examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb ......                                                                                           [ 11%]
examples/Applications/Mobile Patent Suits.ipynb ...                                                                                                                  [ 11%]
examples/Applications/Neural Network.ipynb ...                                                                                                                       [ 11%]
examples/Applications/Outlier Detection.ipynb .........                                                                                                              [ 12%]
examples/Applications/Visualizing the US Elections.ipynb ..........FF.......                                                                                         [ 14%]
examples/Applications/Equity Index Performance/Time Series.ipynb ...                                                                                                 [ 15%]
examples/Applications/Logs Analytics/Logs Dashboard.ipynb ............                                                                                               [ 16%]
examples/Applications/Wealth Of Nations/Bubble Chart.ipynb ........                                                                                                  [ 17%]
examples/Applications/Wealth Of Nations/Choropleth.ipynb ........                                                                                                    [ 18%]
examples/Basic Plotting/Basic Plotting.ipynb .........                                                                                                               [ 19%]
examples/Basic Plotting/Pyplot.ipynb .........................................                                                                                       [ 23%]
examples/Interactions/Interaction Layer.ipynb .......................................................                                                                [ 29%]
examples/Interactions/Mark Interactions.ipynb .....................                                                                                                  [ 31%]
examples/Interactions/Selectors.ipynb .............                                                                                                                  [ 32%]
examples/Marks/Object Model/Bars.ipynb ......................                                                                                                        [ 34%]
examples/Marks/Object Model/Bins.ipynb ...........                                                                                                                   [ 36%]
examples/Marks/Object Model/Boxplot.ipynb ......                                                                                                                     [ 36%]
examples/Marks/Object Model/Candles.ipynb ..........                                                                                                                 [ 37%]
examples/Marks/Object Model/FlexLine.ipynb ....                                                                                                                      [ 38%]
examples/Marks/Object Model/Graph.ipynb .............                                                                                                                [ 39%]
examples/Marks/Object Model/GridHeatMap.ipynb .................                                                                                                      [ 41%]
examples/Marks/Object Model/HeatMap.ipynb .....                                                                                                                      [ 41%]
examples/Marks/Object Model/Hist.ipynb ...........                                                                                                                   [ 43%]
examples/Marks/Object Model/Image.ipynb ......                                                                                                                       [ 43%]
examples/Marks/Object Model/Label.ipynb ........                                                                                                                     [ 44%]
examples/Marks/Object Model/Lines.ipynb ............................                                                                                                 [ 47%]
examples/Marks/Object Model/Map.ipynb ........                                                                                                                       [ 48%]
examples/Marks/Object Model/Market Map.ipynb ...............                                                                                                         [ 49%]
examples/Marks/Object Model/Pie.ipynb ...............                                                                                                                [ 51%]
examples/Marks/Object Model/Scatter.ipynb .......................................                                                                                    [ 55%]
examples/Marks/Object Model/ScatterMega.ipynb ....................................                                                                                   [ 59%]
examples/Marks/Pyplot/Bars.ipynb ...................                                                                                                                 [ 61%]
examples/Marks/Pyplot/Bins.ipynb ...........                                                                                                                         [ 62%]
examples/Marks/Pyplot/Boxplot.ipynb ......                                                                                                                           [ 63%]
examples/Marks/Pyplot/Candles.ipynb .........                                                                                                                        [ 64%]
examples/Marks/Pyplot/GridHeatMap.ipynb .................                                                                                                            [ 65%]
examples/Marks/Pyplot/HeatMap.ipynb .....                                                                                                                            [ 66%]
examples/Marks/Pyplot/Hist.ipynb ...........                                                                                                                         [ 67%]
examples/Marks/Pyplot/Image.ipynb ......                                                                                                                             [ 68%]
examples/Marks/Pyplot/Label.ipynb ........                                                                                                                           [ 69%]
examples/Marks/Pyplot/Lines.ipynb ........................                                                                                                           [ 71%]
examples/Marks/Pyplot/Map.ipynb .........                                                                                                                            [ 72%]
examples/Marks/Pyplot/Pie.ipynb ..............                                                                                                                       [ 73%]
examples/Marks/Pyplot/Scatter.ipynb .....................................                                                                                            [ 77%]
examples/Scales/Color Scales.ipynb .................                                                                                                                 [ 79%]
examples/Tutorials/Brush Interval Selector.ipynb ......                                                                                                              [ 80%]
examples/Tutorials/Fast Interval Selector.ipynb ......                                                                                                               [ 80%]
examples/Tutorials/Gaussian Density Widget.ipynb .....                                                                                                               [ 81%]
examples/Tutorials/Gaussian Density.ipynb .....                                                                                                                      [ 81%]
examples/Tutorials/Linking Plots With Widgets.ipynb .......                                                                                                          [ 82%]
examples/Tutorials/Object Model.ipynb ....                                                                                                                           [ 83%]
examples/Tutorials/Pyplot.ipynb ....                                                                                                                                 [ 83%]
examples/Tutorials/Updating Plots.ipynb .......                                                                                                                      [ 84%]
tests/binary_serialization_test.py .....                                                                                                                             [ 84%]
tests/marks_test.py ....                                                                                                                                             [ 85%]
tests/selector_test.py .                                                                                                                                             [ 85%]
ui-tests/tests/notebooks/bars.ipynb ......                                                                                                                           [ 85%]
ui-tests/tests/notebooks/bars2d_update.ipynb ........                                                                                                                [ 86%]
ui-tests/tests/notebooks/bars_update.ipynb .........                                                                                                                 [ 87%]
ui-tests/tests/notebooks/figure_pyplot.ipynb ...                                                                                                                     [ 88%]
ui-tests/tests/notebooks/graph.ipynb ..                                                                                                                              [ 88%]
ui-tests/tests/notebooks/graph_update.ipynb ........                                                                                                                 [ 89%]
ui-tests/tests/notebooks/gridheatmap.ipynb .....                                                                                                                     [ 89%]
ui-tests/tests/notebooks/gridheatmap_update.ipynb .........                                                                                                          [ 90%]
ui-tests/tests/notebooks/hist_update.ipynb ........                                                                                                                  [ 91%]
ui-tests/tests/notebooks/index_selector_update.ipynb ..                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines.ipynb ..                                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines_update.ipynb ............                                                                                                             [ 93%]
ui-tests/tests/notebooks/map.ipynb .                                                                                                                                 [ 93%]
ui-tests/tests/notebooks/ohlc_update.ipynb ..........                                                                                                                [ 94%]
ui-tests/tests/notebooks/ordinal_scale.ipynb ....                                                                                                                    [ 94%]
ui-tests/tests/notebooks/pie_update.ipynb ....................                                                                                                       [ 96%]
ui-tests/tests/notebooks/scatter.ipynb ..                                                                                                                            [ 96%]
ui-tests/tests/notebooks/scatter_update.ipynb ............                                                                                                           [ 98%]
ui-tests/tests/notebooks/scattergl_update.ipynb .............                                                                                                        [ 99%]
ui-tests/tests/notebooks/ticks.ipynb ....                                                                                                                            [100%]

================================================================================= FAILURES =================================================================================
____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 10 _____________________________________________________
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

dt_x = DateScale()
sc_y = LinearScale()

clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
                          scales={'x': dt_x, 'y': sc_y},
                          colors=['#2aa1ec'])

trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
                        scales={'x': dt_x, 'y': sc_y},
                        colors=['#E91D0E'])

ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)
ax_y = Axis(scale=sc_y, orientation='vertical', label='Percentage')

scat_fig = Figure(marks=[clinton_scatter, trump_scatter], axes=[ax_x, ax_y], title='General Election - National Polls')

Traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [11], in <cell line: 6>()
      3 dt_x = DateScale()
      4 sc_y = LinearScale()
----> 6 clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
      7                           scales={'x': dt_x, 'y': sc_y},
      8                           colors=['#2aa1ec'])
     10 trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
     11                         scales={'x': dt_x, 'y': sc_y},
     12                         colors=['#E91D0E'])
     14 ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:547, in _ScatterBase.__init__(self, **kwargs)
    545 self._drag_handlers = CallbackDispatcher()
    546 self._drag_end_handlers = CallbackDispatcher()
--> 547 super(_ScatterBase, self).__init__(**kwargs)
    549 self._name_to_handler.update({
    550     'drag_start': self._drag_start_handlers,
    551     'drag_end': self._drag_end_handlers,
    552     'drag': self._drag_handlers
    553 })

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:242, in Mark.__init__(self, **kwargs)
    241 def __init__(self, **kwargs):
--> 242     super(Mark, self).__init__(**kwargs)
    243     self._hover_handlers = CallbackDispatcher()
    244     self._click_handlers = CallbackDispatcher()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:480, in Widget.__init__(self, **kwargs)
    477 super(Widget, self).__init__(**kwargs)
    479 Widget._call_widget_constructed(self)
--> 480 self.open()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:493, in Widget.open(self)
    491 """Open a comm to the frontend if one isn't already open."""
    492 if self.comm is None:
--> 493     state, buffer_paths, buffers = _remove_buffers(self.get_state())
    495     args = dict(target_name='jupyter.widget',
    496                 data={'state': state, 'buffer_paths': buffer_paths},
    497                 buffers=buffers,
    498                 metadata={'version': __protocol_version__}
    499                 )
    500     if self._model_id is not None:

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:583, in Widget.get_state(self, key, drop_defaults)
    581 for k in keys:
    582     to_json = self.trait_metadata(k, 'to_json', self._trait_to_json)
--> 583     value = to_json(getattr(self, k), self)
    584     if not PY3 and isinstance(traits[k], Bytes) and isinstance(value, bytes):
    585         value = memoryview(value)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/traits.py:177, in array_to_json(ar, obj, force_contiguous)
    175         return [array_to_json(np.array(row), obj, force_contiguous) for row in ar]
    176     else:
--> 177         raise ValueError("Unsupported dtype object")
    179 if ar.dtype.kind in ['S', 'U']:  # strings to as plain json
    180     return ar.tolist()

ValueError: Unsupported dtype object

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 11 _____________________________________________________
Notebook cell execution failed
Cell 11: Cell execution caused an exception

Input:
VBox([map_fig, scat_fig])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [12], in <cell line: 1>()
----> 1 VBox([map_fig, scat_fig])

NameError: name 'scat_fig' is not defined

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/traittypes/traittypes.py:20
  /usr/lib/python3.8/site-packages/traittypes/traittypes.py:20: DeprecationWarning:
              Sentinel is not a public part of the traitlets API.
              It was published by mistake, and may be removed in the future.

    Empty = Sentinel('Empty', 'traittypes',

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:633: 81 warnings
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:633: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 10
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 11
========================================================== 2 failed, 950 passed, 82 warnings in 340.82s (0:05:40) ==========================================================

@martinRenou
Copy link
Member

Thanks for reporting! Looking at the error output ModuleNotFoundError: No module named 'sklearn' it just seems to be a test dependency that is missing. Note that this is not a bqplot dependency though, only for tests.

Second issue: looks like MANIFEST.in needs to be trimed to not install content of the tests/

Yes indeed, it has been fixed yesterday #1518 and will be included in the next 0.12 release.

@kloczek
Copy link
Author

kloczek commented Aug 23, 2022

Tested b82283e from 0.12.x branch and looks like still something is wrong ..

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra 'examples/Applications/Visualizing the US Elections.ipynb'
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.34, configfile: pytest.ini
plugins: anyio-3.6.1, nbval-0.9.6
collected 19 items

examples/Applications/Visualizing the US Elections.ipynb ..........FF.......                                                                                         [100%]

================================================================================= FAILURES =================================================================================
____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 10 _____________________________________________________
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

dt_x = DateScale()
sc_y = LinearScale()

clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
                          scales={'x': dt_x, 'y': sc_y},
                          colors=['#2aa1ec'])

trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
                        scales={'x': dt_x, 'y': sc_y},
                        colors=['#E91D0E'])

ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)
ax_y = Axis(scale=sc_y, orientation='vertical', label='Percentage')

scat_fig = Figure(marks=[clinton_scatter, trump_scatter], axes=[ax_x, ax_y], title='General Election - National Polls')

Traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [11], in <cell line: 6>()
      3 dt_x = DateScale()
      4 sc_y = LinearScale()
----> 6 clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
      7                           scales={'x': dt_x, 'y': sc_y},
      8                           colors=['#2aa1ec'])
     10 trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
     11                         scales={'x': dt_x, 'y': sc_y},
     12                         colors=['#E91D0E'])
     14 ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:547, in _ScatterBase.__init__(self, **kwargs)
    545 self._drag_handlers = CallbackDispatcher()
    546 self._drag_end_handlers = CallbackDispatcher()
--> 547 super(_ScatterBase, self).__init__(**kwargs)
    549 self._name_to_handler.update({
    550     'drag_start': self._drag_start_handlers,
    551     'drag_end': self._drag_end_handlers,
    552     'drag': self._drag_handlers
    553 })

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:242, in Mark.__init__(self, **kwargs)
    241 def __init__(self, **kwargs):
--> 242     super(Mark, self).__init__(**kwargs)
    243     self._hover_handlers = CallbackDispatcher()
    244     self._click_handlers = CallbackDispatcher()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:480, in Widget.__init__(self, **kwargs)
    477 super(Widget, self).__init__(**kwargs)
    479 Widget._call_widget_constructed(self)
--> 480 self.open()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:493, in Widget.open(self)
    491 """Open a comm to the frontend if one isn't already open."""
    492 if self.comm is None:
--> 493     state, buffer_paths, buffers = _remove_buffers(self.get_state())
    495     args = dict(target_name='jupyter.widget',
    496                 data={'state': state, 'buffer_paths': buffer_paths},
    497                 buffers=buffers,
    498                 metadata={'version': __protocol_version__}
    499                 )
    500     if self._model_id is not None:

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:583, in Widget.get_state(self, key, drop_defaults)
    581 for k in keys:
    582     to_json = self.trait_metadata(k, 'to_json', self._trait_to_json)
--> 583     value = to_json(getattr(self, k), self)
    584     if not PY3 and isinstance(traits[k], Bytes) and isinstance(value, bytes):
    585         value = memoryview(value)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.34-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/traits.py:177, in array_to_json(ar, obj, force_contiguous)
    175         return [array_to_json(np.array(row), obj, force_contiguous) for row in ar]
    176     else:
--> 177         raise ValueError("Unsupported dtype object")
    179 if ar.dtype.kind in ['S', 'U']:  # strings to as plain json
    180     return ar.tolist()

ValueError: Unsupported dtype object

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 11 _____________________________________________________

@kloczek
Copy link
Author

kloczek commented Dec 3, 2022

Just updated my package to 0.12.36 and stil lI see some failimg units
Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.36-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.36-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.36, configfile: pytest.ini
plugins: anyio-3.6.1, nbval-0.9.6
collected 952 items

examples/Index.ipynb .                                                                                                                                               [  0%]
examples/Introduction.ipynb ...............................                                                                                                          [  3%]
examples/Advanced Plotting/Advanced Plotting.ipynb ..............                                                                                                    [  4%]
examples/Advanced Plotting/Animations.ipynb ...............                                                                                                          [  6%]
examples/Advanced Plotting/Axis Properties.ipynb .........................                                                                                           [  9%]
examples/Advanced Plotting/Plotting Dates.ipynb ...............                                                                                                      [ 10%]
examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb ..FFFF                                                                                           [ 11%]
examples/Applications/Mobile Patent Suits.ipynb ...                                                                                                                  [ 11%]
examples/Applications/Neural Network.ipynb ...                                                                                                                       [ 11%]
examples/Applications/Outlier Detection.ipynb .........                                                                                                              [ 12%]
examples/Applications/Visualizing the US Elections.ipynb ...F...F.FFF.......                                                                                         [ 14%]
examples/Applications/Equity Index Performance/Time Series.ipynb ...                                                                                                 [ 15%]
examples/Applications/Logs Analytics/Logs Dashboard.ipynb ............                                                                                               [ 16%]
examples/Applications/Wealth Of Nations/Bubble Chart.ipynb ........                                                                                                  [ 17%]
examples/Applications/Wealth Of Nations/Choropleth.ipynb ........                                                                                                    [ 18%]
examples/Basic Plotting/Basic Plotting.ipynb .........                                                                                                               [ 19%]
examples/Basic Plotting/Pyplot.ipynb .....................................F..F                                                                                       [ 23%]
examples/Interactions/Interaction Layer.ipynb .....................................................F.                                                                [ 29%]
examples/Interactions/Mark Interactions.ipynb .....................                                                                                                  [ 31%]
examples/Interactions/Selectors.ipynb .............                                                                                                                  [ 32%]
examples/Marks/Object Model/Bars.ipynb ......................                                                                                                        [ 34%]
examples/Marks/Object Model/Bins.ipynb ...........                                                                                                                   [ 36%]
examples/Marks/Object Model/Boxplot.ipynb ......                                                                                                                     [ 36%]
examples/Marks/Object Model/Candles.ipynb ..........                                                                                                                 [ 37%]
examples/Marks/Object Model/FlexLine.ipynb ....                                                                                                                      [ 38%]
examples/Marks/Object Model/Graph.ipynb .............                                                                                                                [ 39%]
examples/Marks/Object Model/GridHeatMap.ipynb .................                                                                                                      [ 41%]
examples/Marks/Object Model/HeatMap.ipynb .....                                                                                                                      [ 41%]
examples/Marks/Object Model/Hist.ipynb ...........                                                                                                                   [ 43%]
examples/Marks/Object Model/Image.ipynb ......                                                                                                                       [ 43%]
examples/Marks/Object Model/Label.ipynb ........                                                                                                                     [ 44%]
examples/Marks/Object Model/Lines.ipynb ............................                                                                                                 [ 47%]
examples/Marks/Object Model/Map.ipynb ........                                                                                                                       [ 48%]
examples/Marks/Object Model/Market Map.ipynb ...............                                                                                                         [ 49%]
examples/Marks/Object Model/Pie.ipynb ...............                                                                                                                [ 51%]
examples/Marks/Object Model/Scatter.ipynb .......................................                                                                                    [ 55%]
examples/Marks/Object Model/ScatterMega.ipynb ....................................                                                                                   [ 59%]
examples/Marks/Pyplot/Bars.ipynb ...................                                                                                                                 [ 61%]
examples/Marks/Pyplot/Bins.ipynb ...........                                                                                                                         [ 62%]
examples/Marks/Pyplot/Boxplot.ipynb ......                                                                                                                           [ 63%]
examples/Marks/Pyplot/Candles.ipynb .........                                                                                                                        [ 64%]
examples/Marks/Pyplot/GridHeatMap.ipynb .................                                                                                                            [ 65%]
examples/Marks/Pyplot/HeatMap.ipynb .....                                                                                                                            [ 66%]
examples/Marks/Pyplot/Hist.ipynb ...........                                                                                                                         [ 67%]
examples/Marks/Pyplot/Image.ipynb ......                                                                                                                             [ 68%]
examples/Marks/Pyplot/Label.ipynb ........                                                                                                                           [ 69%]
examples/Marks/Pyplot/Lines.ipynb ........................                                                                                                           [ 71%]
examples/Marks/Pyplot/Map.ipynb .........                                                                                                                            [ 72%]
examples/Marks/Pyplot/Pie.ipynb ..............                                                                                                                       [ 73%]
examples/Marks/Pyplot/Scatter.ipynb .....................................                                                                                            [ 77%]
examples/Scales/Color Scales.ipynb ................F                                                                                                                 [ 79%]
examples/Tutorials/Brush Interval Selector.ipynb ......                                                                                                              [ 80%]
examples/Tutorials/Fast Interval Selector.ipynb ......                                                                                                               [ 80%]
examples/Tutorials/Gaussian Density Widget.ipynb .....                                                                                                               [ 81%]
examples/Tutorials/Gaussian Density.ipynb .....                                                                                                                      [ 81%]
examples/Tutorials/Linking Plots With Widgets.ipynb ......F                                                                                                          [ 82%]
examples/Tutorials/Object Model.ipynb ....                                                                                                                           [ 83%]
examples/Tutorials/Pyplot.ipynb ....                                                                                                                                 [ 83%]
examples/Tutorials/Updating Plots.ipynb .......                                                                                                                      [ 84%]
tests/binary_serialization_test.py .....                                                                                                                             [ 84%]
tests/marks_test.py ....                                                                                                                                             [ 85%]
tests/selector_test.py .                                                                                                                                             [ 85%]
ui-tests/tests/notebooks/bars.ipynb ......                                                                                                                           [ 85%]
ui-tests/tests/notebooks/bars2d_update.ipynb ........                                                                                                                [ 86%]
ui-tests/tests/notebooks/bars_update.ipynb .........                                                                                                                 [ 87%]
ui-tests/tests/notebooks/figure_pyplot.ipynb ...                                                                                                                     [ 88%]
ui-tests/tests/notebooks/graph.ipynb ..                                                                                                                              [ 88%]
ui-tests/tests/notebooks/graph_update.ipynb ........                                                                                                                 [ 89%]
ui-tests/tests/notebooks/gridheatmap.ipynb .....                                                                                                                     [ 89%]
ui-tests/tests/notebooks/gridheatmap_update.ipynb .........                                                                                                          [ 90%]
ui-tests/tests/notebooks/hist_update.ipynb ........                                                                                                                  [ 91%]
ui-tests/tests/notebooks/index_selector_update.ipynb ..                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines.ipynb ..                                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines_update.ipynb ............                                                                                                             [ 93%]
ui-tests/tests/notebooks/map.ipynb .                                                                                                                                 [ 93%]
ui-tests/tests/notebooks/ohlc_update.ipynb ..........                                                                                                                [ 94%]
ui-tests/tests/notebooks/ordinal_scale.ipynb ....                                                                                                                    [ 94%]
ui-tests/tests/notebooks/pie_update.ipynb ....................                                                                                                       [ 96%]
ui-tests/tests/notebooks/scatter.ipynb ..                                                                                                                            [ 96%]
ui-tests/tests/notebooks/scatter_update.ipynb ............                                                                                                           [ 98%]
ui-tests/tests/notebooks/scattergl_update.ipynb .............                                                                                                        [ 99%]
ui-tests/tests/notebooks/ticks.ipynb ....                                                                                                                            [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2 ________________________________________________
Notebook cell execution failed
Cell 2: Cell execution caused an exception

Input:
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_iris()
data = scale(digits.data)
n_features=4
#n_pca=3
#pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(data, columns=['feature_{}'.format(x) for x in range(n_features)])
df['leaf'] = digits.target
df['extra_info'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [3], line 2
      1 import pandas as pd
----> 2 from sklearn.datasets import load_iris
      3 from sklearn.decomposition import PCA
      4 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3 ________________________________________________
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'leaf',
                                group_columns=['extra_info'],
                                bins=25,
                                f_lim = {'min':-3, 'max':3}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [4], line 1
----> 1 feature_vector_distribution(df, 'leaf',
      2                                 group_columns=['extra_info'],
      3                                 bins=25,
      4                                 f_lim = {'min':-3, 'max':3}
      5                                 )

NameError: name 'df' is not defined

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4 ________________________________________________
Notebook cell execution failed
Cell 4: Cell execution caused an exception

Input:
import numpy as np
import pandas as pd
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_digits()
data = scale(digits.data)

n_pca=10
pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(pca.transform(data), columns=['pca_{}'.format(x) for x in range(n_pca)])
df['digit'] = digits.target
df['test'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [5], line 3
      1 import numpy as np
      2 import pandas as pd
----> 3 from sklearn.datasets import load_digits
      4 from sklearn.decomposition import PCA
      5 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5 ________________________________________________
Notebook cell execution failed
Cell 5: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'digit',
                                group_columns=['test'],
                                bins=20,
                                f_lim = {'min':-7, 'max':7}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [6], line 1
----> 1 feature_vector_distribution(df, 'digit',
      2                                 group_columns=['test'],
      3                                 bins=20,
      4                                 f_lim = {'min':-7, 'max':7}
      5                                 )

NameError: name 'df' is not defined

_____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 3 _____________________________________________________
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
try:
    from pollster import Pollster
    pollster = Pollster()

    # Getting data from Pollster. This might take a second.
    raw_data = pollster.charts(topic='2016-president')

    data = pd.DataFrame(columns=['Name', 'Partisan', 'State', 'Date', 'Trump', 'Clinton', 'Other',
                     'Undecided'])

    for i in raw_data:
        analyze_polls(i.polls())
except:
    raise ValueError('Please install Pollster and run the functions above')

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [4], line 2
      1 try:
----> 2     from pollster import Pollster
      3     pollster = Pollster()

ModuleNotFoundError: No module named 'pollster'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In [4], line 14
     12         analyze_polls(i.polls())
     13 except:
---> 14     raise ValueError('Please install Pollster and run the functions above')

ValueError: Please install Pollster and run the functions above

_____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 7 _____________________________________________________
Notebook cell execution failed
Cell 7: Cell execution caused an exception

Input:
sc_geo = AlbersUSA()
sc_c1 = OrdinalColorScale(domain=['Democrat', 'Republican'], colors=['#2aa1ec', '#E91D0E'])

color_data = get_color_data()

map_styles = {'color': color_data,
              'scales': {'projection': sc_geo, 'color': sc_c1}, 'colors': {'default_color': 'Grey'}}

axis = ColorAxis(scale=sc_c1)

states_map = Map(map_data=topo_load('map_data/USStatesMap.json'), tooltip=ts_fig, **map_styles)
map_fig = Figure(marks=[states_map], axes=[axis],title='General Election Polls - State Wise')

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [8], line 4
      1 sc_geo = AlbersUSA()
      2 sc_c1 = OrdinalColorScale(domain=['Democrat', 'Republican'], colors=['#2aa1ec', '#E91D0E'])
----> 4 color_data = get_color_data()
      6 map_styles = {'color': color_data,
      7               'scales': {'projection': sc_geo, 'color': sc_c1}, 'colors': {'default_color': 'Grey'}}
      9 axis = ColorAxis(scale=sc_c1)

Cell In [5], line 16, in get_color_data()
     14 color_data = {}
     15 for i in codes['FIPS']:
---> 16     color_data[i] = get_state_party(i)
     17 return color_data

Cell In [5], line 3, in get_state_party(code)
      1 def get_state_party(code):
      2     state = codes[codes['FIPS']==code]['USPS'].values[0]
----> 3     if data[data['State']==state].shape[0] == 0:
      4         return None
      5     polls = data[(data['State']==state) & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

NameError: name 'data' is not defined

_____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 9 _____________________________________________________
Notebook cell execution failed
Cell 9: Cell execution caused an exception

Input:
states_map.on_hover(hover_callback)

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [10], line 1
----> 1 states_map.on_hover(hover_callback)

NameError: name 'states_map' is not defined

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 10 _____________________________________________________
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

dt_x = DateScale()
sc_y = LinearScale()

clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
                          scales={'x': dt_x, 'y': sc_y},
                          colors=['#2aa1ec'])

trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
                        scales={'x': dt_x, 'y': sc_y},
                        colors=['#E91D0E'])

ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)
ax_y = Axis(scale=sc_y, orientation='vertical', label='Percentage')

scat_fig = Figure(marks=[clinton_scatter, trump_scatter], axes=[ax_x, ax_y], title='General Election - National Polls')

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [11], line 1
----> 1 national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')
      3 dt_x = DateScale()
      4 sc_y = LinearScale()

NameError: name 'data' is not defined

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 11 _____________________________________________________
Notebook cell execution failed
Cell 11: Cell execution caused an exception

Input:
VBox([map_fig, scat_fig])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [12], line 1
----> 1 VBox([map_fig, scat_fig])

NameError: name 'map_fig' is not defined

______________________________________________________________ examples/Basic Plotting/Pyplot.ipynb::Cell 37 _______________________________________________________________
Notebook cell execution failed
Cell 37: Cell execution caused an exception

Input:
plt.close(2)

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [38], line 1
----> 1 plt.close(2)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.36-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/pyplot.py:235, in close(key)
    233 fig = figure_registry[key]
    234 if hasattr(fig, 'pyplot'):
--> 235     fig.pyplot.close()
    236     fig.pyplot_vbox.close()
    237 fig.close()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:500, in Widget.close(self)
    498 if self.comm is not None:
    499     Widget._active_widgets.pop(self.model_id, None)
--> 500     self.comm.close()
    501     self.comm = None
    502     self._repr_mimebundle_ = None

File /usr/lib/python3.8/site-packages/comm/base_comm.py:109, in BaseComm.close(self, data, metadata, buffers, deleting)
    101 self.publish_msg(
    102     "comm_close",
    103     data=data,
    104     metadata=metadata,
    105     buffers=buffers,
    106 )
    107 if not deleting:
    108     # If deleting, the comm can't be registered
--> 109     get_comm_manager().unregister_comm(self)

NameError: name 'get_comm_manager' is not defined

______________________________________________________________ examples/Basic Plotting/Pyplot.ipynb::Cell 40 _______________________________________________________________
Notebook cell execution failed
Cell 40: Cell execution caused an exception

Input:
# click and drag on chart to make a selection
def callback(name, value):
    label.value = 'Brushing: ' + str(value)
_ = plt.brush_int_selector(callback, 'brushing')

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [41], line 4
      2 def callback(name, value):
      3     label.value = 'Brushing: ' + str(value)
----> 4 _ = plt.brush_int_selector(callback, 'brushing')

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.36-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/pyplot.py:1180, in brush_int_selector(func, trait, **kwargs)
   1164 def brush_int_selector(func=None, trait='selected', **kwargs):
   1165     """Create a `BrushIntervalSelector` interaction for the `figure`.
   1166
   1167     Also attaches the function `func` as an event listener for the
   (...)
   1178         call back function `func`.
   1179     """
-> 1180     return _create_selector(BrushIntervalSelector, func, trait, **kwargs)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.36-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/pyplot.py:1158, in _create_selector(int_type, func, trait, **kwargs)
   1138 def _create_selector(int_type, func, trait, **kwargs):
   1139     """Create a selector of the specified type.
   1140
   1141     Also attaches the function `func` as an `on_trait_change` listener
   (...)
   1156         call back function `func`.
   1157     """
-> 1158     interaction = _add_interaction(int_type, **kwargs)
   1159     if func is not None:
   1160         interaction.on_trait_change(func, trait)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.36-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/pyplot.py:1121, in _add_interaction(int_type, **kwargs)
   1119 interaction = int_type(**kwargs)
   1120 if fig.interaction is not None:
-> 1121     fig.interaction.close()
   1122 fig.interaction = interaction
   1123 return interaction

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:500, in Widget.close(self)
    498 if self.comm is not None:
    499     Widget._active_widgets.pop(self.model_id, None)
--> 500     self.comm.close()
    501     self.comm = None
    502     self._repr_mimebundle_ = None

File /usr/lib/python3.8/site-packages/comm/base_comm.py:109, in BaseComm.close(self, data, metadata, buffers, deleting)
    101 self.publish_msg(
    102     "comm_close",
    103     data=data,
    104     metadata=metadata,
    105     buffers=buffers,
    106 )
    107 if not deleting:
    108     # If deleting, the comm can't be registered
--> 109     get_comm_manager().unregister_comm(self)

NameError: name 'get_comm_manager' is not defined

__________________________________________________________ examples/Interactions/Interaction Layer.ipynb::Cell 53 __________________________________________________________
Notebook cell execution failed
Cell 53: Cell execution caused an exception

Input:
from collections import OrderedDict
selection_interacts = ToggleButtons(options=OrderedDict([('HandDraw1', hd), ('HandDraw2', hd2), ('PanZoom', pz),
                                                       ('FastIntervalSelector', int_sel), ('IndexSelector', index_sel),
                                                       ('BrushIntervalSelector', br_intsel), ('MultiSelector', multi_sel),
                                                       ('None', None)]))

link((selection_interacts, 'value'), (fig, 'interaction'))
VBox([deb, fig, selection_interacts], align_self='stretch')

Traceback:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [54], line 2
      1 from collections import OrderedDict
----> 2 selection_interacts = ToggleButtons(options=OrderedDict([('HandDraw1', hd), ('HandDraw2', hd2), ('PanZoom', pz),
      3                                                        ('FastIntervalSelector', int_sel), ('IndexSelector', index_sel),
      4                                                        ('BrushIntervalSelector', br_intsel), ('MultiSelector', multi_sel),
      5                                                        ('None', None)]))
      7 link((selection_interacts, 'value'), (fig, 'interaction'))
      8 VBox([deb, fig, selection_interacts], align_self='stretch')

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget_selection.py:173, in _Selection.__init__(self, *args, **kwargs)
    171 self._initializing_traits_ = True
    172 kwargs['options'] = _exhaust_iterable(kwargs.get('options', ()))
--> 173 self._options_full = _make_options(kwargs['options'])
    174 self._propagate_options(None)
    176 # Select the first item by default, if we can

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget_selection.py:115, in _make_options(x)
    106 """Standardize the options tuple format.
    107
    108 The returned tuple should be in the format (('label', value), ('label', value), ...).
   (...)
    112 * an iterable of values, and labels will be generated
    113 """
    114 if isinstance(x, Mapping):
--> 115     raise TypeError("options must be a list of values or a list of (label, value) tuples")
    117 # only iterate once through the options.
    118 xlist = tuple(x)

TypeError: options must be a list of values or a list of (label, value) tuples

_______________________________________________________________ examples/Scales/Color Scales.ipynb::Cell 16 ________________________________________________________________
Notebook cell execution failed
Cell 16: Cell execution caused an exception

Input:
# Define the control widgets
n_groups_slider = IntSlider(description='n colors', min=3)
scheme_dd = Dropdown(description='Scheme',
                     options=ord_schemes)

def update_scheme(*args):
    col_sc.scheme = scheme_dd.label
    ax_c.label = scheme_dd.label
    n_groups_slider.max = scheme_dd.value

def update_categories(*args):
    groups = partition(names, n_groups_slider.value)
    market_map.color = groups
    market_map.groups = groups

n_groups_slider.observe(update_categories, 'value')
scheme_dd.observe(update_scheme)

# Define the bqplot marketmap
names = range(100)

col_sc = OrdinalColorScale()
ax_c = ColorAxis(scale=col_sc)

market_map = MarketMap(names=names,
                       display_text=['' for _ in names],
                       scales={'color': col_sc}, axes=[ax_c],
                       layout=Layout(min_width='800px', min_height='600px'))
update_scheme()
update_categories()

VBox([HBox([scheme_dd, n_groups_slider]), market_map])

Traceback:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [17], line 3
      1 # Define the control widgets
      2 n_groups_slider = IntSlider(description='n colors', min=3)
----> 3 scheme_dd = Dropdown(description='Scheme',
      4                      options=ord_schemes)
      6 def update_scheme(*args):
      7     col_sc.scheme = scheme_dd.label

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget_selection.py:173, in _Selection.__init__(self, *args, **kwargs)
    171 self._initializing_traits_ = True
    172 kwargs['options'] = _exhaust_iterable(kwargs.get('options', ()))
--> 173 self._options_full = _make_options(kwargs['options'])
    174 self._propagate_options(None)
    176 # Select the first item by default, if we can

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget_selection.py:115, in _make_options(x)
    106 """Standardize the options tuple format.
    107
    108 The returned tuple should be in the format (('label', value), ('label', value), ...).
   (...)
    112 * an iterable of values, and labels will be generated
    113 """
    114 if isinstance(x, Mapping):
--> 115     raise TypeError("options must be a list of values or a list of (label, value) tuples")
    117 # only iterate once through the options.
    118 xlist = tuple(x)

TypeError: options must be a list of values or a list of (label, value) tuples

_______________________________________________________ examples/Tutorials/Linking Plots With Widgets.ipynb::Cell 6 ________________________________________________________
Notebook cell execution failed
Cell 6: Cell execution caused an exception

Input:
funcs = dict(sin=np.sin, cos=np.cos, tan=np.tan, sinh=np.sinh, tanh=np.tanh)
dropdown = widgets.Dropdown(options=funcs, description='Function')

fig = plt.figure(title='sin(x)', animation_duration=1000)

# create x and y data attributes for the line chart
x = np.arange(-10, 10, .1)
y = np.sin(x)

line = plt.plot(x, y ,'m')

def update_line(*args):
    f = dropdown.value
    fig.title = f'{f.__name__}(x)'
    line.y = f(line.x)

dropdown.observe(update_line, 'value')

widgets.VBox([dropdown, fig])

Traceback:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [7], line 2
      1 funcs = dict(sin=np.sin, cos=np.cos, tan=np.tan, sinh=np.sinh, tanh=np.tanh)
----> 2 dropdown = widgets.Dropdown(options=funcs, description='Function')
      4 fig = plt.figure(title='sin(x)', animation_duration=1000)
      6 # create x and y data attributes for the line chart

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget_selection.py:173, in _Selection.__init__(self, *args, **kwargs)
    171 self._initializing_traits_ = True
    172 kwargs['options'] = _exhaust_iterable(kwargs.get('options', ()))
--> 173 self._options_full = _make_options(kwargs['options'])
    174 self._propagate_options(None)
    176 # Select the first item by default, if we can

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget_selection.py:115, in _make_options(x)
    106 """Standardize the options tuple format.
    107
    108 The returned tuple should be in the format (('label', value), ('label', value), ...).
   (...)
    112 * an iterable of values, and labels will be generated
    113 """
    114 if isinstance(x, Mapping):
--> 115     raise TypeError("options must be a list of values or a list of (label, value) tuples")
    117 # only iterate once through the options.
    118 xlist = tuple(x)

TypeError: options must be a list of values or a list of (label, value) tuples

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/traittypes/traittypes.py:20
  /usr/lib/python3.8/site-packages/traittypes/traittypes.py:20: DeprecationWarning:
              Sentinel is not a public part of the traitlets API.
              It was published by mistake, and may be removed in the future.

    Empty = Sentinel('Empty', 'traittypes',

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:642: 81 warnings
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:642: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 3
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 7
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 9
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 10
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 11
FAILED examples/Basic Plotting/Pyplot.ipynb::Cell 37
FAILED examples/Basic Plotting/Pyplot.ipynb::Cell 40
FAILED examples/Interactions/Interaction Layer.ipynb::Cell 53
FAILED examples/Scales/Color Scales.ipynb::Cell 16
FAILED examples/Tutorials/Linking Plots With Widgets.ipynb::Cell 6
========================================================= 14 failed, 938 passed, 82 warnings in 207.05s (0:03:27) ==========================================================

Here is list of installed modules in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
anyio                         3.6.1
appdirs                       1.4.4
argon2-cffi                   21.3.0
argon2-cffi-bindings          21.2.0
asttokens                     2.2.0
attrs                         22.1.0
Babel                         2.11.0
backcall                      0.2.0
beautifulsoup4                4.11.1
bleach                        5.0.0
Brlapi                        0.8.3
build                         0.9.0
cffi                          1.15.1
charset-normalizer            3.0.1
comm                          0.1.0
contourpy                     1.0.6
coverage                      6.5.0
cssselect                     1.1.0
cycler                        0.11.0
debugpy                       1.6.4
decorator                     5.1.1
defusedxml                    0.7.1
deprecation                   2.1.0
distro                        1.8.0
dnspython                     2.2.1
docutils                      0.19
entrypoints                   0.4
exceptiongroup                1.0.0
executing                     1.2.0
extras                        1.0.0
fastjsonschema                2.16.1
fixtures                      4.0.0
fonttools                     4.38.0
gpg                           1.17.1-unknown
html5lib                      1.1
idna                          3.4
imagesize                     1.4.1
importlib-metadata            5.1.0
importlib-resources           5.9.0
iniconfig                     1.1.1
ipykernel                     6.18.3
ipython                       8.6.0
ipython-genutils              0.2.0
ipywidgets                    8.0.1
jedi                          0.18.2
Jinja2                        3.1.2
json5                         0.9.9
jsonschema                    4.17.3
jupyter_client                7.4.7
jupyter_core                  5.1.0
jupyter_packaging             0.12.3
jupyter-server                1.23.3
jupyter-sphinx                0.4.0
jupyterlab                    3.5.0
jupyterlab-pygments           0.1.2
jupyterlab_server             2.16.3
jupyterlab-widgets            3.0.2
kiwisolver                    1.4.4
libcomps                      0.1.19
louis                         3.23.0
lxml                          4.9.1
MarkupSafe                    2.1.1
matplotlib                    3.6.2
matplotlib-inline             0.1.5
mistune                       2.0.4
nbclassic                     0.4.8
nbclient                      0.7.2
nbconvert                     7.2.5
nbformat                      5.7.0
nbval                         0.9.6
nest-asyncio                  1.5.6
notebook                      6.5.2
notebook_shim                 0.2.2
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pandas                        1.5.2
pandocfilters                 1.5.0
parso                         0.8.3
pbr                           5.9.0
pep517                        0.13.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.3.0
pip                           22.3.1
pkgutil_resolve_name          1.3.10
platformdirs                  2.5.2
pluggy                        1.0.0
ply                           3.11
prometheus-client             0.15.0
prompt-toolkit                3.0.29
psutil                        5.9.2
ptyprocess                    0.7.0
pure-eval                     0.2.2
pycparser                     2.21
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyrsistent                    0.19.2
pytest                        7.2.0
python-dateutil               2.8.2
pytz                          2022.4
pyzmq                         24.0.0
requests                      2.28.1
rpm                           4.17.0
SciPy                         1.8.1
scour                         0.38.2
Send2Trash                    1.8.0
setuptools                    65.6.3
six                           1.16.0
sniffio                       1.2.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        5.3.0
sphinx-rtd-theme              1.1.1
sphinx-thebe                  0.1.2
sphinxcontrib-applehelp       1.0.2.dev20220730
sphinxcontrib-devhelp         1.0.2.dev20220730
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220730
sphinxcontrib-qthelp          1.0.3.dev20220730
sphinxcontrib-serializinghtml 1.1.5
stack-data                    0.6.2
terminado                     0.15.0
testtools                     2.5.0
tinycss2                      1.2.1
tomli                         2.0.1
tomlkit                       0.11.6
tornado                       6.2
traitlets                     5.4.0
traittypes                    0.2.1
urllib3                       1.26.12
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.4.2
wheel                         0.38.4
widgetsnbextension            4.0.3
zipp                          3.11.0

@kloczek
Copy link
Author

kloczek commented Dec 3, 2022

FYI I'm asuming that those fails are issues of the test suite and not tested code so I've added those units in my build procedure to --deselect list to have working nbase build.

@kloczek
Copy link
Author

kloczek commented Jul 11, 2023

Just FTR 0.12.40 pytest output

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.40-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.40-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.40
configfile: pytest.ini
plugins: anyio-3.7.0, nbval-0.9.6
collected 962 items

examples/Index.ipynb .                                                   [  0%]
examples/Introduction.ipynb ...............................              [  3%]
examples/Advanced Plotting/Advanced Plotting.ipynb ..............        [  4%]
examples/Advanced Plotting/Animations.ipynb ...............              [  6%]
examples/Advanced Plotting/Axis Properties.ipynb ....................... [  8%]
...                                                                      [  9%]
examples/Advanced Plotting/Plotting Dates.ipynb ...............          [ 10%]
examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb ..FF [ 11%]
FF                                                                       [ 11%]
examples/Applications/Mobile Patent Suits.ipynb ...                      [ 11%]
examples/Applications/Neural Network.ipynb ...                           [ 11%]
examples/Applications/Outlier Detection.ipynb .........                  [ 12%]
examples/Applications/Visualizing the US Elections.ipynb ...F...F.FFF... [ 14%]
....                                                                     [ 14%]
examples/Applications/Equity Index Performance/Time Series.ipynb .FF     [ 15%]
examples/Applications/Logs Analytics/Logs Dashboard.ipynb ...FFFF...FF   [ 16%]
examples/Applications/Wealth Of Nations/Bubble Chart.ipynb ........      [ 17%]
examples/Applications/Wealth Of Nations/Choropleth.ipynb ........        [ 17%]
examples/Basic Plotting/Basic Plotting.ipynb .........                   [ 18%]
examples/Basic Plotting/Pyplot.ipynb ................................... [ 22%]
......                                                                   [ 23%]
examples/Interactions/Interaction Layer.ipynb .......................... [ 25%]
.............................                                            [ 28%]
examples/Interactions/Mark Interactions.ipynb .....................      [ 31%]
examples/Interactions/Selectors.ipynb .............                      [ 32%]
examples/Marks/Object Model/Bars.ipynb ......................            [ 34%]
examples/Marks/Object Model/Bins.ipynb ...........                       [ 35%]
examples/Marks/Object Model/Boxplot.ipynb ......                         [ 36%]
examples/Marks/Object Model/Candles.ipynb ..........                     [ 37%]
examples/Marks/Object Model/FlexLine.ipynb ....                          [ 37%]
examples/Marks/Object Model/Graph.ipynb .............                    [ 39%]
examples/Marks/Object Model/GridHeatMap.ipynb .................          [ 41%]
examples/Marks/Object Model/HeatMap.ipynb .....                          [ 41%]
examples/Marks/Object Model/Hist.ipynb ...........                       [ 42%]
examples/Marks/Object Model/Image.ipynb ......                           [ 43%]
examples/Marks/Object Model/Label.ipynb ........                         [ 44%]
examples/Marks/Object Model/Lines.ipynb ............................     [ 47%]
examples/Marks/Object Model/Map.ipynb ........                           [ 47%]
examples/Marks/Object Model/Market Map.ipynb ...............             [ 49%]
examples/Marks/Object Model/Pie.ipynb ...............                    [ 51%]
examples/Marks/Object Model/Scatter.ipynb .............................. [ 54%]
.........                                                                [ 55%]
examples/Marks/Object Model/ScatterMega.ipynb .......................... [ 57%]
..........                                                               [ 58%]
examples/Marks/Pyplot/Bars.ipynb ...................                     [ 60%]
examples/Marks/Pyplot/Bins.ipynb ...........                             [ 61%]
examples/Marks/Pyplot/Boxplot.ipynb ......                               [ 62%]
examples/Marks/Pyplot/Candles.ipynb .........                            [ 63%]
examples/Marks/Pyplot/GridHeatMap.ipynb .................                [ 65%]
examples/Marks/Pyplot/HeatMap.ipynb .....                                [ 65%]
examples/Marks/Pyplot/Hist.ipynb ...........                             [ 66%]
examples/Marks/Pyplot/Image.ipynb ......                                 [ 67%]
examples/Marks/Pyplot/Label.ipynb ........                               [ 68%]
examples/Marks/Pyplot/Lines.ipynb ........................               [ 70%]
examples/Marks/Pyplot/Map.ipynb .........                                [ 71%]
examples/Marks/Pyplot/Pie.ipynb ..............                           [ 73%]
examples/Marks/Pyplot/Scatter.ipynb .................................... [ 77%]
.                                                                        [ 77%]
examples/Plotting Widgets/Radar.ipynb .........                          [ 78%]
examples/Scales/Color Scales.ipynb ........F........                     [ 79%]
examples/Tutorials/Brush Interval Selector.ipynb ......                  [ 80%]
examples/Tutorials/Fast Interval Selector.ipynb ......                   [ 81%]
examples/Tutorials/Gaussian Density Widget.ipynb .....                   [ 81%]
examples/Tutorials/Gaussian Density.ipynb .....                          [ 82%]
examples/Tutorials/Linking Plots With Widgets.ipynb .......              [ 82%]
examples/Tutorials/Object Model.ipynb ....                               [ 83%]
examples/Tutorials/Pyplot.ipynb ....                                     [ 83%]
examples/Tutorials/Updating Plots.ipynb .......                          [ 84%]
tests/binary_serialization_test.py .....                                 [ 84%]
tests/marks_test.py ....                                                 [ 85%]
tests/selector_test.py .                                                 [ 85%]
ui-tests/tests/notebooks/bars.ipynb ......                               [ 86%]
ui-tests/tests/notebooks/bars2d_update.ipynb ........                    [ 86%]
ui-tests/tests/notebooks/bars_update.ipynb .........                     [ 87%]
ui-tests/tests/notebooks/figure_pyplot.ipynb ...                         [ 88%]
ui-tests/tests/notebooks/graph.ipynb ..                                  [ 88%]
ui-tests/tests/notebooks/graph_update.ipynb ........                     [ 89%]
ui-tests/tests/notebooks/gridheatmap.ipynb .....                         [ 89%]
ui-tests/tests/notebooks/gridheatmap_update.ipynb .........              [ 90%]
ui-tests/tests/notebooks/hist_update.ipynb ........                      [ 91%]
ui-tests/tests/notebooks/index_selector_update.ipynb ..                  [ 91%]
ui-tests/tests/notebooks/lines.ipynb ..                                  [ 91%]
ui-tests/tests/notebooks/lines_update.ipynb ............                 [ 93%]
ui-tests/tests/notebooks/map.ipynb .                                     [ 93%]
ui-tests/tests/notebooks/ohlc_update.ipynb ..........                    [ 94%]
ui-tests/tests/notebooks/ordinal_scale.ipynb ....                        [ 94%]
ui-tests/tests/notebooks/pie_update.ipynb ....................           [ 96%]
ui-tests/tests/notebooks/scatter.ipynb ..                                [ 96%]
ui-tests/tests/notebooks/scatter_update.ipynb ............               [ 98%]
ui-tests/tests/notebooks/scattergl_update.ipynb .............            [ 99%]
ui-tests/tests/notebooks/ticks.ipynb ....                                [100%]

=================================== FAILURES ===================================
_ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2 __
Notebook cell execution failed
Cell 2: Cell execution caused an exception

Input:
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_iris()
data = scale(digits.data)
n_features=4
#n_pca=3
#pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(data, columns=['feature_{}'.format(x) for x in range(n_features)])
df['leaf'] = digits.target
df['extra_info'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 2
      1 import pandas as pd
----> 2 from sklearn.datasets import load_iris
      3 from sklearn.decomposition import PCA
      4 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3 __
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'leaf',
                                group_columns=['extra_info'],
                                bins=25,
                                f_lim = {'min':-3, 'max':3}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[4], line 1
----> 1 feature_vector_distribution(df, 'leaf',
      2                                 group_columns=['extra_info'],
      3                                 bins=25,
      4                                 f_lim = {'min':-3, 'max':3}
      5                                 )

NameError: name 'df' is not defined

_ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4 __
Notebook cell execution failed
Cell 4: Cell execution caused an exception

Input:
import numpy as np
import pandas as pd
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_digits()
data = scale(digits.data)

n_pca=10
pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(pca.transform(data), columns=['pca_{}'.format(x) for x in range(n_pca)])
df['digit'] = digits.target
df['test'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], line 3
      1 import numpy as np
      2 import pandas as pd
----> 3 from sklearn.datasets import load_digits
      4 from sklearn.decomposition import PCA
      5 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5 __
Notebook cell execution failed
Cell 5: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'digit',
                                group_columns=['test'],
                                bins=20,
                                f_lim = {'min':-7, 'max':7}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[6], line 1
----> 1 feature_vector_distribution(df, 'digit',
      2                                 group_columns=['test'],
      3                                 bins=20,
      4                                 f_lim = {'min':-7, 'max':7}
      5                                 )

NameError: name 'df' is not defined

_______ examples/Applications/Visualizing the US Elections.ipynb::Cell 3 _______
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
try:
    from pollster import Pollster
    pollster = Pollster()

    # Getting data from Pollster. This might take a second.
    raw_data = pollster.charts(topic='2016-president')

    data = pd.DataFrame(columns=['Name', 'Partisan', 'State', 'Date', 'Trump', 'Clinton', 'Other',
                     'Undecided'])

    for i in raw_data:
        analyze_polls(i.polls())
except:
    raise ValueError('Please install Pollster and run the functions above')

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[4], line 2
      1 try:
----> 2     from pollster import Pollster
      3     pollster = Pollster()

ModuleNotFoundError: No module named 'pollster'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[4], line 14
     12         analyze_polls(i.polls())
     13 except:
---> 14     raise ValueError('Please install Pollster and run the functions above')

ValueError: Please install Pollster and run the functions above

_______ examples/Applications/Visualizing the US Elections.ipynb::Cell 7 _______
Notebook cell execution failed
Cell 7: Cell execution caused an exception

Input:
sc_geo = AlbersUSA()
sc_c1 = OrdinalColorScale(domain=['Democrat', 'Republican'], colors=['#2aa1ec', '#E91D0E'])

color_data = get_color_data()

map_styles = {'color': color_data,
              'scales': {'projection': sc_geo, 'color': sc_c1}, 'colors': {'default_color': 'Grey'}}

axis = ColorAxis(scale=sc_c1)

states_map = Map(map_data=topo_load('map_data/USStatesMap.json'), tooltip=ts_fig, **map_styles)
map_fig = Figure(marks=[states_map], axes=[axis],title='General Election Polls - State Wise')

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[8], line 4
      1 sc_geo = AlbersUSA()
      2 sc_c1 = OrdinalColorScale(domain=['Democrat', 'Republican'], colors=['#2aa1ec', '#E91D0E'])
----> 4 color_data = get_color_data()
      6 map_styles = {'color': color_data,
      7               'scales': {'projection': sc_geo, 'color': sc_c1}, 'colors': {'default_color': 'Grey'}}
      9 axis = ColorAxis(scale=sc_c1)

Cell In[5], line 16, in get_color_data()
     14 color_data = {}
     15 for i in codes['FIPS']:
---> 16     color_data[i] = get_state_party(i)
     17 return color_data

Cell In[5], line 3, in get_state_party(code)
      1 def get_state_party(code):
      2     state = codes[codes['FIPS']==code]['USPS'].values[0]
----> 3     if data[data['State']==state].shape[0] == 0:
      4         return None
      5     polls = data[(data['State']==state) & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

NameError: name 'data' is not defined

_______ examples/Applications/Visualizing the US Elections.ipynb::Cell 9 _______
Notebook cell execution failed
Cell 9: Cell execution caused an exception

Input:
states_map.on_hover(hover_callback)

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[10], line 1
----> 1 states_map.on_hover(hover_callback)

NameError: name 'states_map' is not defined

______ examples/Applications/Visualizing the US Elections.ipynb::Cell 10 _______
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

dt_x = DateScale()
sc_y = LinearScale()

clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
                          scales={'x': dt_x, 'y': sc_y},
                          colors=['#2aa1ec'])

trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
                        scales={'x': dt_x, 'y': sc_y},
                        colors=['#E91D0E'])

ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)
ax_y = Axis(scale=sc_y, orientation='vertical', label='Percentage')

scat_fig = Figure(marks=[clinton_scatter, trump_scatter], axes=[ax_x, ax_y], title='General Election - National Polls')

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[11], line 1
----> 1 national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')
      3 dt_x = DateScale()
      4 sc_y = LinearScale()

NameError: name 'data' is not defined

______ examples/Applications/Visualizing the US Elections.ipynb::Cell 11 _______
Notebook cell execution failed
Cell 11: Cell execution caused an exception

Input:
VBox([map_fig, scat_fig])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[12], line 1
----> 1 VBox([map_fig, scat_fig])

NameError: name 'map_fig' is not defined

___ examples/Applications/Equity Index Performance/Time Series.ipynb::Cell 1 ___
Notebook cell execution failed
Cell 1: Cell execution caused an exception

Input:
format_date = lambda d: d.strftime('%m/%d/%Y')

spx_prices = pd.read_csv('spx_prices.csv', index_col=0, parse_dates=True, squeeze=True)
log_returns = np.log(spx_prices / spx_prices.shift(1))
dates = spx_prices.index

Traceback:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 3
      1 format_date = lambda d: d.strftime('%m/%d/%Y')
----> 3 spx_prices = pd.read_csv('spx_prices.csv', index_col=0, parse_dates=True, squeeze=True)
      4 log_returns = np.log(spx_prices / spx_prices.shift(1))
      5 dates = spx_prices.index

TypeError: read_csv() got an unexpected keyword argument 'squeeze'

___ examples/Applications/Equity Index Performance/Time Series.ipynb::Cell 2 ___
Notebook cell execution failed
Cell 2: Cell execution caused an exception

Input:
fig_title_tmpl = 'S&P Index Prices (from {start} to {end})'
fig_title = fig_title_tmpl.format(start=format_date(dates[0]),
                                  end=format_date(dates[-1]))
time_series_fig = plt.figure(title=fig_title,
                             layout=widgets.Layout(width='1300px', height='500px'))

plt.scales(scales={'x': DateScale()})
axes_options = {'y': {'tick_format': ','}}
time_series = plt.plot(dates, spx_prices, colors=['dodgerblue'],
                       stroke_width=1.5, axes_options=axes_options)
return_label = plt.label([], x=[], y=[spx_prices.max() * .9],
                         align='middle', default_size=36,
                         font_weight='bolder', colors=['green'])
trend_line = plt.plot([], [])
intsel = FastIntervalSelector(scale=time_series.scales['x'], marks=[time_series])
time_series_fig.interaction = intsel

hist_fig = plt.figure(title='Histogram Of Returns',
                      layout=widgets.Layout(width='900px',
                                            height='450px',
                                            margin='0px 150px 0px 150px'))
plt.scales(scales={'x': LinearScale(min=-.1, max=.1)})
hist = plt.hist(log_returns, colors=['salmon'], bins=75)
for axis in hist_fig.axes:
    axis.grid_lines = 'none'
    if axis.orientation != 'vertical':
        axis.tick_format = '.0%'

def update_hist(*args):
    selected_ix = time_series.selected
    if selected_ix is not None:
        s, e = selected_ix[0], selected_ix[-1]
        spx_prices_slice = spx_prices[s:e]
        pct_return = spx_prices[e] / spx_prices[s] - 1

        # update the position of the total return label
        with return_label.hold_sync():
            return_label.text = ['{:.0%}'.format(pct_return)]
            return_label.x = [time_series.x[(s + e) // 2]]
            return_label.colors = ['red'] if pct_return < 0. else ['green']

        time_series_fig.title = fig_title_tmpl.format(start=format_date(dates[s]),
                                                      end=format_date(dates[e]))
        # update hist with returns
        hist.sample = np.log(spx_prices_slice / spx_prices_slice.shift(1))

time_series.observe(update_hist, 'selected')
widgets.VBox([time_series_fig, hist_fig])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[3], line 2
      1 fig_title_tmpl = 'S&P Index Prices (from {start} to {end})'
----> 2 fig_title = fig_title_tmpl.format(start=format_date(dates[0]),
      3                                   end=format_date(dates[-1]))
      4 time_series_fig = plt.figure(title=fig_title,
      5                              layout=widgets.Layout(width='1300px', height='500px'))
      7 plt.scales(scales={'x': DateScale()})

NameError: name 'dates' is not defined

______ examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 3 _______
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
# load data into pandas and do some munging
log_data = pd.read_csv('access.log', sep=' ', header=None)
log_data.drop([1, 2], axis=1, inplace=True)
log_data.columns = ['ip_address', 'timestamp', 'request', 'status', 'col1', 'url', 'agent', 'col2']

log_data.index = pd.to_datetime(log_data['timestamp'].str.replace('[\[\]]', ''),
                                format='%d/%b/%Y:%H:%M:%S')
log_data.drop('timestamp', axis=1, inplace=True)

# add extra columns for easy querying
log_data['status_code'] = log_data['status'].map(get_status_code)
log_data['category'] = log_data['request'].str.extract('categoryId=(.*)&', expand=False)
log_data['product'] = log_data['request'].str.extract('productId=(.*)&', expand=False)
log_data['hour'] = log_data.index.map(lambda x: x.hour)
log_data['day'] = log_data.index.strftime('%Y-%m-%d')

Traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[4], line 6
      3 log_data.drop([1, 2], axis=1, inplace=True)
      4 log_data.columns = ['ip_address', 'timestamp', 'request', 'status', 'col1', 'url', 'agent', 'col2']
----> 6 log_data.index = pd.to_datetime(log_data['timestamp'].str.replace('[\[\]]', ''),
      7                                 format='%d/%b/%Y:%H:%M:%S')
      8 log_data.drop('timestamp', axis=1, inplace=True)
     10 # add extra columns for easy querying

File /usr/lib64/python3.8/site-packages/pandas/core/tools/datetimes.py:1046, in to_datetime(arg, errors, dayfirst, yearfirst, utc, format, exact, unit, infer_datetime_format, origin, cache)
   1044             result = arg.tz_localize("utc")
   1045 elif isinstance(arg, ABCSeries):
-> 1046     cache_array = _maybe_cache(arg, format, cache, convert_listlike)
   1047     if not cache_array.empty:
   1048         result = arg.map(cache_array)

File /usr/lib64/python3.8/site-packages/pandas/core/tools/datetimes.py:250, in _maybe_cache(arg, format, cache, convert_listlike)
    248 unique_dates = unique(arg)
    249 if len(unique_dates) < len(arg):
--> 250     cache_dates = convert_listlike(unique_dates, format)
    251     # GH#45319
    252     try:

File /usr/lib64/python3.8/site-packages/pandas/core/tools/datetimes.py:453, in _convert_listlike_datetimes(arg, format, name, utc, unit, errors, dayfirst, yearfirst, exact)
    451 # `format` could be inferred, or user didn't ask for mixed-format parsing.
    452 if format is not None and format != "mixed":
--> 453     return _array_strptime_with_fallback(arg, name, utc, format, exact, errors)
    455 result, tz_parsed = objects_to_datetime64ns(
    456     arg,
    457     dayfirst=dayfirst,
   (...)
    461     allow_object=True,
    462 )
    464 if tz_parsed is not None:
    465     # We can take a shortcut since the datetime64 numpy array
    466     # is in UTC

File /usr/lib64/python3.8/site-packages/pandas/core/tools/datetimes.py:484, in _array_strptime_with_fallback(arg, name, utc, fmt, exact, errors)
    473 def _array_strptime_with_fallback(
    474     arg,
    475     name,
   (...)
    479     errors: str,
    480 ) -> Index:
    481     """
    482     Call array_strptime, with fallback behavior depending on 'errors'.
    483     """
--> 484     result, timezones = array_strptime(arg, fmt, exact=exact, errors=errors, utc=utc)
    485     if any(tz is not None for tz in timezones):
    486         return _return_parsed_timezone_results(result, timezones, utc, name)

File /usr/lib64/python3.8/site-packages/pandas/_libs/tslibs/strptime.pyx:530, in pandas._libs.tslibs.strptime.array_strptime()

File /usr/lib64/python3.8/site-packages/pandas/_libs/tslibs/strptime.pyx:351, in pandas._libs.tslibs.strptime.array_strptime()

ValueError: time data "[16/Oct/2018:18:22:16]" doesn't match format "%d/%b/%Y:%H:%M:%S", at position 0. You might want to try:
    - passing `format` if your strings have a consistent format;
    - passing `format='ISO8601'` if your strings are all ISO8601 but not necessarily in exactly the same format;
    - passing `format='mixed'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.

______ examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 4 _______
Notebook cell execution failed
Cell 4: Cell execution caused an exception

Input:
all_days = log_data['day'].value_counts().index
all_hours = np.arange(24)
all_categories = list(log_data['category'].value_counts().index)
all_products = list(log_data['product'].value_counts().index)
all_status_codes = list(log_data['status_code'].value_counts().index)

category_colors = dict(zip(all_categories, bq.CATEGORY10))
status_label_colors = dict([('SUCCESS', '#006d2c'),
                            ('CLIENT ERROR', '#fc8d59'),
                            ('SERVER ERROR', '#a63603')])

Traceback:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File /usr/lib64/python3.8/site-packages/pandas/core/indexes/base.py:3653, in Index.get_loc(self, key)
   3652 try:
-> 3653     return self._engine.get_loc(casted_key)
   3654 except KeyError as err:

File /usr/lib64/python3.8/site-packages/pandas/_libs/index.pyx:147, in pandas._libs.index.IndexEngine.get_loc()

File /usr/lib64/python3.8/site-packages/pandas/_libs/index.pyx:176, in pandas._libs.index.IndexEngine.get_loc()

File pandas/_libs/hashtable_class_helper.pxi:7080, in pandas._libs.hashtable.PyObjectHashTable.get_item()

File pandas/_libs/hashtable_class_helper.pxi:7088, in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'day'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
Cell In[5], line 1
----> 1 all_days = log_data['day'].value_counts().index
      2 all_hours = np.arange(24)
      3 all_categories = list(log_data['category'].value_counts().index)

File /usr/lib64/python3.8/site-packages/pandas/core/frame.py:3761, in DataFrame.__getitem__(self, key)
   3759 if self.columns.nlevels > 1:
   3760     return self._getitem_multilevel(key)
-> 3761 indexer = self.columns.get_loc(key)
   3762 if is_integer(indexer):
   3763     indexer = [indexer]

File /usr/lib64/python3.8/site-packages/pandas/core/indexes/base.py:3655, in Index.get_loc(self, key)
   3653     return self._engine.get_loc(casted_key)
   3654 except KeyError as err:
-> 3655     raise KeyError(key) from err
   3656 except TypeError:
   3657     # If we have a listlike key, _check_indexing_error will raise
   3658     #  InvalidIndexError. Otherwise we fall through and re-raise
   3659     #  the TypeError.
   3660     self._check_indexing_error(key)

KeyError: 'day'

______ examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 5 _______
Notebook cell execution failed
Cell 5: Cell execution caused an exception

Input:
# daily events bar chart
daily_events_fig = plt.figure(title='Daily Events',
                              animation_duration=1000,
                              layout=widgets.Layout(width='900px', height='500px'))

plt.scales(scales={'x': bq.DateScale()})

# intsel = BrushIntervalSelector(scale=, marks=[hist])
bar_axes_options = {'x': {'grid_lines': 'none'},
                    'y': {'tick_format': ','}}
common_bar_options = dict(interactions={'click': 'select'},
                          selected_style={'stroke': 'Red',
                                          'stroke-width': 4},
                          axes_options=bar_axes_options)
daily_events_bar = plt.bar(pd.to_datetime(all_days), [],
                           colors=['dodgerblue'],
                           opacities=[.8] * len(all_days),
                           **common_bar_options)

num_days = len(all_days)
filtered_daily_events_bar = plt.bar(pd.to_datetime(all_days),
                                    np.zeros(num_days),
                                    colors=['lightgreen'],
                                    opacities=[.8] * num_days,
                                    axes_options=bar_axes_options)

# hourly events line chart
hourly_events_fig = plt.figure(title='Hourly Events',
                               animation_duration=1000,
                               layout=widgets.Layout(width='600px', height='500px'))

plt.scales(scales={'x': bq.OrdinalScale()})
hourly_events_bar = plt.bar(all_hours,[],
                            colors=['goldenrod'],
                            opacities=[.8] * 24,
                            padding=.2,
                            **common_bar_options)

filtered_hourly_events_bar = plt.bar(all_hours, [],
                                     colors=['lightgreen'],
                                     opacities=[.8] * 24,
                                     padding=.2,
                                     axes_options=bar_axes_options)

products_fig = plt.figure(title='Events By Product',
                          animation_duration=1000,
                          fig_margin=dict(top=60, bottom=20, left=100, right=40),
                          layout=widgets.Layout(width='550px', height='500px'))
products_bar = plt.bar(all_products, [],
                       colors=['salmon'],
                       orientation='horizontal',
                       opacities=[.8] * len(all_products),
                       padding=.2,
                       **common_bar_options)

common_pie_args = dict(display_labels='outside',
                       interactions={'click': 'select'},
                       selected_style={'stroke': 'white',
                                       'stroke-width': 3},
                       inner_radius=80,
                       apply_clip=False)
# categories pie chart
categories_fig = plt.figure(title='Events By Category', animation_duration=1000,
                           layout=widgets.Layout(width='550px', height='500px'))
categories_pie = plt.pie([], labels=all_categories, **common_pie_args)

# status codes pie chart
status_codes_fig = plt.figure(title='Events By Status', animation_duration=1000,
                              layout=widgets.Layout(width='550px', height='500px'))
status_codes_pie = plt.pie([], labels=all_status_codes, **common_pie_args)

# buttons for updating and resetting filters
update_btn = widgets.Button(description='Update', button_style='Success')
reset_btn = widgets.Button(description='Reset', button_style='Success')

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[6], line 15
      9 bar_axes_options = {'x': {'grid_lines': 'none'},
     10                     'y': {'tick_format': ','}}
     11 common_bar_options = dict(interactions={'click': 'select'},
     12                           selected_style={'stroke': 'Red',
     13                                           'stroke-width': 4},
     14                           axes_options=bar_axes_options)
---> 15 daily_events_bar = plt.bar(pd.to_datetime(all_days), [],
     16                            colors=['dodgerblue'],
     17                            opacities=[.8] * len(all_days),
     18                            **common_bar_options)
     20 num_days = len(all_days)
     21 filtered_daily_events_bar = plt.bar(pd.to_datetime(all_days),
     22                                     np.zeros(num_days),
     23                                     colors=['lightgreen'],
     24                                     opacities=[.8] * num_days,
     25                                     axes_options=bar_axes_options)

NameError: name 'all_days' is not defined

______ examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 6 _______
Notebook cell execution failed
Cell 6: Cell execution caused an exception

Input:
fields = ['day', 'hour', 'product', 'category', 'status_code']
field_vals = [all_days, all_hours, all_products, all_categories, all_status_codes]
plots = [daily_events_bar, hourly_events_bar, products_bar, categories_pie, status_codes_pie]

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[7], line 2
      1 fields = ['day', 'hour', 'product', 'category', 'status_code']
----> 2 field_vals = [all_days, all_hours, all_products, all_categories, all_status_codes]
      3 plots = [daily_events_bar, hourly_events_bar, products_bar, categories_pie, status_codes_pie]

NameError: name 'all_days' is not defined

______ examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 10 ______
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
def reset_filters(*args):
    for plot in plots:
        plot.selected = None
    update_plots(None)

update_btn.on_click(lambda btn: update_plots(None))
reset_btn.on_click(lambda btn: reset_filters())
btns_layout = widgets.VBox([update_btn, reset_btn], layout=widgets.Layout(overflow_x='hidden'))

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[11], line 6
      3         plot.selected = None
      4     update_plots(None)
----> 6 update_btn.on_click(lambda btn: update_plots(None))
      7 reset_btn.on_click(lambda btn: reset_filters())
      8 btns_layout = widgets.VBox([update_btn, reset_btn], layout=widgets.Layout(overflow_x='hidden'))

NameError: name 'update_btn' is not defined

______ examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 11 ______
Notebook cell execution failed
Cell 11: Cell execution caused an exception

Input:
update_plots(None)

parent_plots = widgets.HBox([daily_events_fig, hourly_events_fig])
child_plots = widgets.HBox([products_fig, categories_fig, status_codes_fig])
widgets.VBox([widgets.HBox([parent_plots, btns_layout]),child_plots])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[12], line 1
----> 1 update_plots(None)
      3 parent_plots = widgets.HBox([daily_events_fig, hourly_events_fig])
      4 child_plots = widgets.HBox([products_fig, categories_fig, status_codes_fig])

Cell In[10], line 3, in update_plots(*args)
      1 def update_plots(*args):
      2     global filters, filtered_log_data
----> 3     filters = generate_filters()
      4     filtered_log_data = apply_filters(log_data, filters)
      6     daily_events = filtered_log_data\
      7         .resample('D')\
      8         .count()['status_code']\
      9         .reindex(pd.to_datetime(all_days))\
     10         .fillna(0)

Cell In[8], line 3, in generate_filters()
      1 def generate_filters():
      2     filters_dict = {}
----> 3     for field, field_val, plot in zip(fields, field_vals, plots):
      4         if plot.selected:
      5             selected_vals = [field_val[i] for i in plot.selected]

NameError: name 'field_vals' is not defined

__________________ examples/Scales/Color Scales.ipynb::Cell 8 __________________
Notebook cell execution failed
Cell 8: Cell execution caused an exception

Input:
date_col_sc.min = pd.datetime(2016, 2, 28)

Traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[9], line 1
----> 1 date_col_sc.min = pd.datetime(2016, 2, 28)

AttributeError: module 'pandas' has no attribute 'datetime'

=============================== warnings summary ===============================
../../../../../usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: 151 warnings
  /usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: DeprecationWarning: Widget._active_widgets is deprecated.
    value = getattr(cls, name)

../../../../../usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: 151 warnings
  /usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: DeprecationWarning: Widget._widget_types is deprecated.
    value = getattr(cls, name)

../../../../../usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: 151 warnings
  /usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: DeprecationWarning: Widget.widget_types is deprecated.
    value = getattr(cls, name)

../../../../../usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: 151 warnings
  /usr/lib/python3.8/site-packages/traitlets/traitlets.py:1016: DeprecationWarning: Widget.widgets is deprecated.
    value = getattr(cls, name)

bqplot/plotting_widgets.py:30
  /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.40/bqplot/plotting_widgets.py:30: DeprecationWarning: metadata {'dtype': None} was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
    data = DataFrame()

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:644: 82 warnings
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:644: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)

tests/binary_serialization_test.py: 11 warnings
tests/marks_test.py: 18 warnings
tests/selector_test.py: 1 warning
  /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:528: DeprecationWarning: The `ipykernel.comm.Comm` class has been deprecated. Please use the `comm` module instead.For creating comms, use the function `from comm import create_comm`.
    self.comm = Comm(**args)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 3
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 7
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 9
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 10
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 11
FAILED examples/Applications/Equity Index Performance/Time Series.ipynb::Cell 1
FAILED examples/Applications/Equity Index Performance/Time Series.ipynb::Cell 2
FAILED examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 3
FAILED examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 4
FAILED examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 5
FAILED examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 6
FAILED examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 10
FAILED examples/Applications/Logs Analytics/Logs Dashboard.ipynb::Cell 11
FAILED examples/Scales/Color Scales.ipynb::Cell 8
=========== 18 failed, 944 passed, 717 warnings in 197.84s (0:03:17) ===========

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