Repository: scipp/plopp

Issue:
Add poster tutorial with NYC taxi data to docs

Discussion:

Patch:
diff --git a/docs/_static/gallery/README.txt b/docs/_static/gallery/README.txt
new file mode 100644
index 0000000..a728cdb
--- /dev/null
+++ b/docs/_static/gallery/README.txt
@@ -0,0 +1,1 @@
+This directory is a space to save the thumbnails generated by the gallery notebooks. 
diff --git a/docs/conf.py b/docs/conf.py
index c9b9523..57d6521 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -86,6 +86,7 @@ extensions = [
     'sphinx_autodoc_typehints',
     'sphinx_copybutton',
     'nbsphinx',
+    'sphinx_gallery.load_style',
 ]
 
 autodoc_type_aliases = {
@@ -258,3 +259,9 @@ linkcheck_ignore = [
     # Specific lines in Github blobs cannot be found by linkcheck.
     r'https?://github\.com/.*?/blob/[a-f0-9]+/.+?#',
 ]
+
+# -- Options for nbsphinx gallery------------------------------------------
+
+nbsphinx_thumbnails = {
+    'examples/gallery/nyc-taxi': '_static/gallery/nyc-taxi-thumbnail.png',
+}
diff --git a/docs/tutorials/nodes-tutorial.ipynb b/docs/examples/custom-interfaces.ipynb
similarity index 99%
rename from docs/tutorials/nodes-tutorial.ipynb
rename to docs/examples/custom-interfaces.ipynb
index f85456b..7c6a69e 100644
--- a/docs/tutorials/nodes-tutorial.ipynb
+++ b/docs/examples/custom-interfaces.ipynb
@@ -5,9 +5,9 @@
    "id": "3d2790da-668b-4dad-91c0-9d73f09bcdab",
    "metadata": {},
    "source": [
-    "# Custom interactive interfaces\n",
+    "# Building custom interfaces\n",
     "\n",
-    "This tutorial will demonstrate how to create custom interactive interfaces to visualize a simple data set with `plopp`."
+    "This notebook will demonstrate how to create custom interactive interfaces to visualize a data set with `plopp`."
    ]
   },
   {
diff --git a/docs/examples/gallery.ipynb b/docs/examples/gallery.ipynb
new file mode 100644
index 0000000..a56353d
--- /dev/null
+++ b/docs/examples/gallery.ipynb
@@ -0,0 +1,45 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "ad3c84db-66fa-4438-9475-5099eacf34ba",
+   "metadata": {},
+   "source": [
+    "# Gallery"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "6a6ec63f-51df-4bca-ab29-762f6d13420c",
+   "metadata": {
+    "tags": [
+     "nbsphinx-gallery"
+    ]
+   },
+   "source": [
+    "* [Interactive histogramming](gallery/nyc-taxi.ipynb)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.9.13"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/docs/examples/gallery/nyc-taxi.ipynb b/docs/examples/gallery/nyc-taxi.ipynb
new file mode 100644
index 0000000..8d6143c
--- /dev/null
+++ b/docs/examples/gallery/nyc-taxi.ipynb
@@ -0,0 +1,135 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "e3b19dc9-1dbb-408a-9dbc-9afebc4f05ba",
+   "metadata": {},
+   "source": [
+    "# Interactive histogramming\n",
+    "\n",
+    "In this example, we have a dataset which contains information about the number of taxi ride drop-offs in New York City in the year 2015.\n",
+    "The raw data (obtained from the [Vaex documentation](https://vaex.readthedocs.io/en/latest/datasets.html))\n",
+    "has been histogrammed into three dimensions: latitude, longitude and hour-of-the-day.\n",
+    "\n",
+    "The goal is to create an interactive visualization with on-the-fly histogramming and smoothing.\n",
+    "It will contain:\n",
+    "\n",
+    "- a central 2D image that shows a longitude-latitude map of the drop-offs, for a single hour-of-the-day slice.\n",
+    "- a slider above the main panel which allows to navigate the hour-of-the-day dimension, updating the 2D map.\n",
+    "- a 1D figure below the 2D map, displaying the same data but summed along the latitude dimension.\n",
+    "- in the 1D panel, we also want to add a gaussian smoothed version of the 1D curve."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "52db73df-93c4-4bf6-b461-3b989b132b3c",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "%matplotlib widget\n",
+    "import scipp as sc\n",
+    "import plopp as pp\n",
+    "from plopp import widgets\n",
+    "from plopp.data import examples\n",
+    "from scipp.ndimage import gaussian_filter\n",
+    "import ipywidgets as ipw\n",
+    "\n",
+    "data = sc.io.open_hdf5(examples.nyc_taxi())\n",
+    "data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "a8b1129c-5258-49de-a2fe-4e5d51af29ca",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# Input data node\n",
+    "in_node = pp.input_node(data)\n",
+    "in_node.name = 'Input data'\n",
+    "\n",
+    "# Slider node that provides index to slice\n",
+    "slider = ipw.IntSlider(description='Hour:', min=0, max=23)\n",
+    "slider_node = pp.widget_node(slider)\n",
+    "slider_node.name = 'Slider widget'\n",
+    "\n",
+    "# Node that actually does the slicing\n",
+    "slice_node = pp.node(\n",
+    "    lambda da, ind: da['hour', ind])(da=in_node, ind=slider_node)\n",
+    "slice_node.name = 'Slice by hour'\n",
+    "\n",
+    "# Add a 2D figure to show the NYC map\n",
+    "fig2d = pp.figure2d(slice_node, norm='log')\n",
+    "\n",
+    "# Add a node after the slicing to sum along the latitude dimension\n",
+    "sum_lat = pp.node(sc.sum, dim='latitude')(slice_node)\n",
+    "sum_lat.name = 'Sum along latitude'\n",
+    "\n",
+    "# Add a node after the sum that performs as Gaussian smoothing\n",
+    "smooth = pp.node(gaussian_filter, sigma=5)(sum_lat)\n",
+    "smooth.name = 'Gaussian smoothing'\n",
+    "\n",
+    "# Add a 1D figure that will display both raw sum and smoothed data\n",
+    "fig1d = pp.figure1d(sum_lat, smooth, norm='log')\n",
+    "\n",
+    "widgets.Box([slider, fig2d, fig1d])  # Container box"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "1622d0e3-0f33-45db-a9fd-f112d308e3d0",
+   "metadata": {},
+   "source": [
+    "Below is a preview of the graph of connected nodes:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "4290d222-946b-49f1-b42d-e1404c0326c5",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "pp.show_graph(in_node)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "28ee06c2-ed57-45b0-aaff-0667f23479b3",
+   "metadata": {
+    "nbsphinx": "hidden"
+   },
+   "outputs": [],
+   "source": [
+    "# This cell is used to generate the thumbnail for the docs gallery.\n",
+    "# It is hidden from the online documentation.\n",
+    "fig2d.canvas.ax.set_aspect('equal')\n",
+    "fig2d.canvas.savefig('../../_static/gallery/nyc-taxi-thumbnail.png')"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.9.13"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/docs/index.rst b/docs/index.rst
index 4d0109f..795dc6c 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -69,11 +69,12 @@ Get in touch
    user-guide/scatter3d-plot
 
 .. toctree::
-   :caption: Tutorials
+   :caption: Examples
    :maxdepth: 3
    :hidden:
 
-   tutorials/nodes-tutorial
+   examples/custom-interfaces
+   examples/gallery
 
 .. toctree::
    :caption: Reference
diff --git a/docs/user-guide/image-plot.ipynb b/docs/user-guide/image-plot.ipynb
index 29f4df8..9f6497d 100644
--- a/docs/user-guide/image-plot.ipynb
+++ b/docs/user-guide/image-plot.ipynb
@@ -36,7 +36,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "da = pp.data.dense_data_array(ndim=2)\n",
+    "da = pp.data.data_array(ndim=2)\n",
     "da.plot()"
    ]
   },
diff --git a/docs/user-guide/inspector-plot.ipynb b/docs/user-guide/inspector-plot.ipynb
index 5808443..e298d47 100644
--- a/docs/user-guide/inspector-plot.ipynb
+++ b/docs/user-guide/inspector-plot.ipynb
@@ -37,7 +37,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "da = pp.data.dense_data_array(ndim=3, binedges=True)\n",
+    "da = pp.data.data_array(ndim=3, binedges=True)\n",
     "p = pp.inspector(da, orientation='vertical')"
    ]
   },
@@ -111,7 +111,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "da = pp.data.dense_data_array(ndim=3, binedges=True)\n",
+    "da = pp.data.data_array(ndim=3, binedges=True)\n",
     "p = pp.inspector(da, orientation='vertical', operation='max')"
    ]
   },
diff --git a/docs/user-guide/line-plot.ipynb b/docs/user-guide/line-plot.ipynb
index 9932ab1..bae8766 100644
--- a/docs/user-guide/line-plot.ipynb
+++ b/docs/user-guide/line-plot.ipynb
@@ -36,7 +36,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "da = pp.data.dense_data_array(ndim=1)\n",
+    "da = pp.data.data_array(ndim=1)\n",
     "da.plot()"
    ]
   },
@@ -163,7 +163,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "ds = pp.data.dense_dataset(ndim=1)\n",
+    "ds = pp.data.dataset(ndim=1)\n",
     "ds.plot()"
    ]
   },
diff --git a/docs/user-guide/slicer-plot.ipynb b/docs/user-guide/slicer-plot.ipynb
index 0fac56d..e06ad44 100644
--- a/docs/user-guide/slicer-plot.ipynb
+++ b/docs/user-guide/slicer-plot.ipynb
@@ -22,7 +22,7 @@
    "source": [
     "%matplotlib widget\n",
     "import plopp as pp\n",
-    "da = pp.data.dense_data_array(ndim=3)"
+    "da = pp.data.data_array(ndim=3)"
    ]
   },
   {
diff --git a/docs/user-guide/super-plot.ipynb b/docs/user-guide/super-plot.ipynb
index fba273e..894a600 100644
--- a/docs/user-guide/super-plot.ipynb
+++ b/docs/user-guide/super-plot.ipynb
@@ -24,7 +24,7 @@
    "source": [
     "%matplotlib widget\n",
     "import plopp as pp\n",
-    "da = pp.data.dense_data_array(ndim=2)"
+    "da = pp.data.data_array(ndim=2)"
    ]
   },
   {
diff --git a/requirements/docs.in b/requirements/docs.in
index 7865477..d96fd93 100644
--- a/requirements/docs.in
+++ b/requirements/docs.in
@@ -1,12 +1,15 @@
 -r base.in
 graphviz
+h5py
 ipympl
 ipywidgets
 mpltoolbox
 nbsphinx
+pooch
 requests
 scipy
 sphinx
 sphinx-autodoc-typehints==1.18.3  # later versions require sphinx >=5 which is incompatible with current sphinx-book-theme
 sphinx-book-theme
 sphinx-copybutton
+sphinx-gallery<0.11
diff --git a/requirements/docs.txt b/requirements/docs.txt
index 7cc36f2..78ad74b 100644
--- a/requirements/docs.txt
+++ b/requirements/docs.txt
@@ -1,4 +1,4 @@
-# SHA1:2212b16fe5d2d5f98e914db4dc419104fce43e96
+# SHA1:aa0b855d77f841e4aea137c1495777d7947cbcfb
 #
 # This file is autogenerated by pip-compile-multi
 # To update, run:
@@ -8,6 +8,8 @@
 -r base.txt
 alabaster==0.7.12
     # via sphinx
+appdirs==1.4.4
+    # via pooch
 attrs==22.1.0
     # via jsonschema
 babel==2.10.3
@@ -39,6 +41,8 @@ fonttools==4.38.0
     # via matplotlib
 graphviz==0.20.1
     # via -r requirements/docs.in
+h5py==3.7.0
+    # via -r requirements/docs.in
 idna==3.4
     # via requests
 imagesize==1.4.1
@@ -93,6 +97,8 @@ pillow==9.2.0
     # via
     #   ipympl
     #   matplotlib
+pooch==1.6.0
+    # via -r requirements/docs.in
 pydata-sphinx-theme==0.8.1
     # via sphinx-book-theme
 pyrsistent==0.18.1
@@ -102,6 +108,7 @@ pytz==2022.2.1
 requests==2.28.1
     # via
     #   -r requirements/docs.in
+    #   pooch
     #   sphinx
 scipy==1.9.3
     # via -r requirements/docs.in
@@ -117,12 +124,15 @@ sphinx==4.5.0
     #   sphinx-autodoc-typehints
     #   sphinx-book-theme
     #   sphinx-copybutton
+    #   sphinx-gallery
 sphinx-autodoc-typehints==1.18.3
     # via -r requirements/docs.in
 sphinx-book-theme==0.3.3
     # via -r requirements/docs.in
 sphinx-copybutton==0.5.0
     # via -r requirements/docs.in
+sphinx-gallery==0.10.1
+    # via -r requirements/docs.in
 sphinxcontrib-applehelp==1.0.2
     # via sphinx
 sphinxcontrib-devhelp==1.0.2
diff --git a/src/plopp/data/__init__.py b/src/plopp/data/__init__.py
new file mode 100644
index 0000000..0dccaac
--- /dev/null
+++ b/src/plopp/data/__init__.py
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
+
+# flake8: noqa F401
+
+from .generated import variable, data_array, dataset, scatter_data
diff --git a/src/plopp/data/examples.py b/src/plopp/data/examples.py
new file mode 100644
index 0000000..08407a0
--- /dev/null
+++ b/src/plopp/data/examples.py
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
+
+from functools import lru_cache
+
+_version = '1'
+
+
+@lru_cache(maxsize=1)
+def _make_pooch():
+    import pooch
+    return pooch.create(
+        path=pooch.os_cache('plopp'),
+        env='PLOPP_DATA_DIR',
+        base_url='https://public.esss.dk/groups/scipp/plopp/{version}/',
+        version=_version,
+        registry={'nyc_taxi_data.h5': 'md5:fc0867ec061e4ac0cbe5975a665a0eea'})
+
+
+_pooch = _make_pooch()
+
+
+def get_path(name: str) -> str:
+    """
+    Return the path to a data file bundled with plopp.
+
+    This function only works with example data and cannot handle
+    paths to custom files.
+    """
+    return _pooch.fetch(name)
+
+
+def nyc_taxi() -> str:
+    """
+    Return the path to the NYC taxi dataset from 2015 histogrammed in latitude,
+    longitude, and hour-of-the-dat, stored in scipp's HDF5 format.
+
+    The original data was found at https://vaex.readthedocs.io/en/latest/datasets.html.
+
+    Attention
+    ---------
+    This data has been manipulated!
+    """
+    return get_path('nyc_taxi_data.h5')
diff --git a/src/plopp/data.py b/src/plopp/data/generated.py
similarity index 61%
rename from src/plopp/data.py
rename to src/plopp/data/generated.py
index 116bc2f..65bc77f 100644
--- a/src/plopp/data.py
+++ b/src/plopp/data/generated.py
@@ -7,14 +7,7 @@ import scipp as sc
 dim_list = ['xx', 'yy', 'zz', 'time', 'temperature']
 
 
-def scalar_variable(with_variance=False, dtype='float64', unit='m/s'):
-    var = sc.scalar(10.0 * np.random.rand(), unit=unit, dtype=dtype)
-    if with_variance:
-        var.variance = np.random.rand()
-    return var
-
-
-def array_variable(ndim=1, with_variance=False, dims=None, dtype='float64', unit='m/s'):
+def variable(ndim=1, variances=False, dims=None, dtype='float64', unit='m/s'):
 
     shapes = np.arange(50, 0, -10)[:ndim]
     if dims is None:
@@ -26,53 +19,26 @@ def array_variable(ndim=1, with_variance=False, dims=None, dtype='float64', unit
     a = np.sin(radius / 5.0)
 
     var = sc.array(dims=dims, values=a, unit=unit, dtype=dtype)
-    if with_variance:
+    if variances:
         var.variances = np.abs(np.random.normal(a * 0.1, 0.05))
 
     return var
 
 
-def scalar_data_array(with_variance=False,
-                      label=False,
-                      mask=False,
-                      attr=False,
-                      dtype='float64',
-                      unit='m/s'):
-
-    data = scalar_variable(with_variance=with_variance, dtype=dtype, unit=unit)
-
-    coord_dict = {'xx': scalar_variable(dtype=dtype, unit=unit)}
-    attr_dict = {}
-    mask_dict = {}
-
-    if label:
-        coord_dict["lab"] = scalar_variable(dtype=dtype, unit=unit)
-    if attr:
-        attr_dict["attr"] = scalar_variable(dtype=dtype, unit=unit)
-    if mask:
-        mask_dict["mask"] = scalar_variable(dtype=dtype, unit=unit)
-
-    return sc.DataArray(data=data, coords=coord_dict, attrs=attr_dict, masks=mask_dict)
-
-
-def dense_data_array(ndim=1,
-                     with_variance=False,
-                     binedges=False,
-                     labels=False,
-                     masks=False,
-                     attrs=False,
-                     ragged=False,
-                     dims=None,
-                     dtype='float64',
-                     unit='m/s'):
+def data_array(ndim=1,
+               variances=False,
+               binedges=False,
+               labels=False,
+               masks=False,
+               attrs=False,
+               ragged=False,
+               dims=None,
+               dtype='float64',
+               unit='m/s'):
 
     coord_units = dict(zip(dim_list, ['m', 'm', 'm', 's', 'K']))
 
-    data = array_variable(ndim=ndim,
-                          with_variance=with_variance,
-                          dims=dims,
-                          dtype=dtype,
-                          unit=unit)
+    data = variable(ndim=ndim, variances=variances, dims=dims, dtype=dtype, unit=unit)
 
     coord_dict = {
         data.dims[i]: sc.arange(data.dims[i],
@@ -110,12 +76,12 @@ def dense_data_array(ndim=1,
     return sc.DataArray(data=data, coords=coord_dict, attrs=attr_dict, masks=mask_dict)
 
 
-def dense_dataset(entries=None, **kwargs):
+def dataset(entries=None, **kwargs):
     if entries is None:
         entries = ['a', 'b']
     ds = sc.Dataset()
     for entry in entries:
-        ds[entry] = (10.0 * np.random.rand()) * dense_data_array(**kwargs)
+        ds[entry] = (10.0 * np.random.rand()) * data_array(**kwargs)
     return ds
 
 


Test patch:
diff --git a/tests/functions/plot_test.py b/tests/functions/plot_test.py
index 6866146..2d489f8 100644
--- a/tests/functions/plot_test.py
+++ b/tests/functions/plot_test.py
@@ -3,7 +3,7 @@
 
 import numpy as np
 import plopp as pp
-from plopp.data import dense_data_array, dense_dataset
+from plopp.data import data_array, dataset
 import pytest
 import scipp as sc
 
@@ -17,8 +17,8 @@ def test_plot_variable():
 
 
 def test_plot_data_array():
-    pp.plot(dense_data_array(ndim=1))
-    da = dense_data_array(ndim=2)
+    pp.plot(data_array(ndim=1))
+    da = data_array(ndim=2)
     pp.plot(da)
     pp.plot(da)
 
@@ -30,7 +30,7 @@ def test_plot_data_array_missing_coords():
 
 
 def test_plot_dataset():
-    ds = dense_dataset(ndim=1)
+    ds = dataset(ndim=1)
     pp.plot(ds)
 
 
@@ -43,7 +43,7 @@ def test_plot_dict_of_variables():
 
 
 def test_plot_dict_of_data_arrays():
-    ds = dense_dataset(ndim=1)
+    ds = dataset(ndim=1)
     pp.plot({'a': ds['a'], 'b': ds['b']})
 
 
@@ -74,13 +74,13 @@ def test_plot_ignore_size_disables_size_check():
 
 
 def test_plot_2d_coord():
-    da = dense_data_array(ndim=2, ragged=True)
+    da = data_array(ndim=2, ragged=True)
     pp.plot(da)
     pp.plot(da.transpose())
 
 
 def test_plot_2d_coord_with_mask():
-    da = pp.data.dense_data_array(ndim=2, ragged=True)
+    da = pp.data.data_array(ndim=2, ragged=True)
     da.masks['negative'] = da.data < sc.scalar(0, unit='m/s')
     pp.plot(da)
 
@@ -100,7 +100,7 @@ def _get_mesh(fig):
 
 
 def test_kwarg_linecolor():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, color='r')
     assert _get_line(p).get_color() == 'r'
     p = pp.plot(da, c='b')
@@ -108,7 +108,7 @@ def test_kwarg_linecolor():
 
 
 def test_kwarg_linestyle():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, linestyle='solid')
     assert _get_line(p).get_linestyle() == '-'
     p = pp.plot(da, ls='dashed')
@@ -116,7 +116,7 @@ def test_kwarg_linestyle():
 
 
 def test_kwarg_linewidth():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, linewidth=3)
     assert _get_line(p).get_linewidth() == 3
     p = pp.plot(da, lw=5)
@@ -124,39 +124,39 @@ def test_kwarg_linewidth():
 
 
 def test_kwarg_marker():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, marker='+')
     assert _get_line(p).get_marker() == '+'
 
 
 def test_kwarg_norm():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, norm='log')
     assert p.canvas.ax.get_yscale() == 'log'
 
 
 def test_kwarg_scale():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, scale={'xx': 'log'})
     assert p.canvas.ax.get_xscale() == 'log'
     assert p.canvas.ax.get_yscale() == 'linear'
 
 
 def test_kwarg_cmap():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     p = pp.plot(da, cmap='magma')
     assert p.colormapper.cmap.name == 'magma'
 
 
 def test_kwarg_scale_2d():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     p = pp.plot(da, scale={'xx': 'log', 'yy': 'log'})
     assert p.canvas.ax.get_xscale() == 'log'
     assert p.canvas.ax.get_yscale() == 'log'
 
 
 def test_kwarg_crop_1d_min_max():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(
         da,
         crop={'xx': {
@@ -167,19 +167,19 @@ def test_kwarg_crop_1d_min_max():
 
 
 def test_kwarg_crop_1d_min_only():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, crop={'xx': {'min': sc.scalar(20, unit='m')}})
     assert p.canvas.ax.get_xlim()[0] == 20
 
 
 def test_kwarg_crop_1d_min_conversion():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot(da, crop={'xx': {'min': sc.scalar(200, unit='cm')}})
     assert p.canvas.ax.get_xlim()[0] == 2
 
 
 def test_kwarg_crop_1d_with_no_unit():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     del da.coords['xx']
     p = pp.plot(da, crop={'xx': {'min': sc.scalar(20, unit=None)}})
     assert p.canvas.ax.get_xlim()[0] == 20
@@ -190,7 +190,7 @@ def test_kwarg_crop_1d_with_no_unit():
 
 
 def test_kwarg_crop_2d():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     p = pp.plot(da,
                 crop={
                     'xx': {
@@ -206,18 +206,18 @@ def test_kwarg_crop_2d():
 
 
 def test_kwarg_for_two_lines():
-    ds = dense_dataset(ndim=1)
+    ds = dataset(ndim=1)
     p = pp.plot(ds, color='r')
     assert _get_line(p, 0).get_color() == 'r'
     assert _get_line(p, 1).get_color() == 'r'
 
 
 def test_kwarg_as_dict():
-    ds = dense_dataset(ndim=1)
+    ds = dataset(ndim=1)
     p = pp.plot(ds, color={'a': 'red', 'b': 'black'})
     assert _get_line(p, 0).get_color() == 'red'
     assert _get_line(p, 1).get_color() == 'black'
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     p = pp.plot({'a': da, 'b': 0.2 * da}, color={'a': 'red', 'b': 'black'})
     assert _get_line(p, 0).get_color() == 'red'
     assert _get_line(p, 1).get_color() == 'black'
diff --git a/tests/functions/slicer_test.py b/tests/functions/slicer_test.py
index d345d03..a0500bb 100644
--- a/tests/functions/slicer_test.py
+++ b/tests/functions/slicer_test.py
@@ -1,13 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.functions.slicer import Slicer
 import scipp as sc
 
 
 def test_creation_keep_two_dims():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     sl = Slicer(da=da, keep=['xx', 'yy'])
     assert sl.slider.value == {'zz': 0}
     assert sl.slider.controls['zz']['slider'].max == da.sizes['zz'] - 1
@@ -15,7 +15,7 @@ def test_creation_keep_two_dims():
 
 
 def test_creation_keep_one_dim():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     sl = Slicer(da=da, keep=['xx'])
     assert sl.slider.value == {'zz': 0, 'yy': 0}
     assert sl.slider.controls['yy']['slider'].max == da.sizes['yy'] - 1
@@ -24,7 +24,7 @@ def test_creation_keep_one_dim():
 
 
 def test_update_keep_two_dims():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     sl = Slicer(da=da, keep=['xx', 'yy'])
     assert sl.slider.value == {'zz': 0}
     assert sc.identical(sl.slice_node.request_data(), da['zz', 0])
@@ -34,7 +34,7 @@ def test_update_keep_two_dims():
 
 
 def test_update_keep_one_dim():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     sl = Slicer(da=da, keep=['xx'])
     assert sl.slider.value == {'zz': 0, 'yy': 0}
     assert sc.identical(sl.slice_node.request_data(), da['yy', 0]['zz', 0])
diff --git a/tests/functions/superplot_test.py b/tests/functions/superplot_test.py
index 6db4ffa..ffaeaf5 100644
--- a/tests/functions/superplot_test.py
+++ b/tests/functions/superplot_test.py
@@ -1,21 +1,21 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.functions.slicer import Slicer
 from plopp.functions.superplot import LineSaveTool
 import scipp as sc
 
 
 def test_creation():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     sl = Slicer(da=da, keep=['xx'])
     tool = LineSaveTool(data_node=sl.slice_node, slider_node=sl.slider_node, fig=sl.fig)
     assert len(tool._lines) == 0
 
 
 def test_save_line():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     sl = Slicer(da=da, keep=['xx'])
     tool = LineSaveTool(data_node=sl.slice_node, slider_node=sl.slider_node, fig=sl.fig)
     assert len(tool._lines) == 0
@@ -34,7 +34,7 @@ def test_save_line():
 
 
 def test_remove_line():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     sl = Slicer(da=da, keep=['xx'])
     tool = LineSaveTool(data_node=sl.slice_node, slider_node=sl.slider_node, fig=sl.fig)
     assert len(tool._lines) == 0
@@ -60,7 +60,7 @@ def test_remove_line():
 
 
 def test_change_line_color():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     sl = Slicer(da=da, keep=['xx'])
     tool = LineSaveTool(data_node=sl.slice_node, slider_node=sl.slider_node, fig=sl.fig)
     tool.save_line()
diff --git a/tests/graphics/colormapper_test.py b/tests/graphics/colormapper_test.py
index 2419a19..39a81ba 100644
--- a/tests/graphics/colormapper_test.py
+++ b/tests/graphics/colormapper_test.py
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.graphics.colormapper import ColorMapper
 import scipp as sc
 import numpy as np
@@ -41,7 +41,7 @@ def test_norm():
 
 
 def test_autoscale():
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     mapper = ColorMapper()
 
     mapper.autoscale(data=da)
@@ -55,7 +55,7 @@ def test_autoscale():
 
 
 def test_rescale_limits_do_not_shrink():
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     mapper = ColorMapper()
 
     mapper.autoscale(data=da)
@@ -69,7 +69,7 @@ def test_rescale_limits_do_not_shrink():
 
 
 def test_vmin_vmax():
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     vmin = sc.scalar(-0.1, unit='K')
     vmax = sc.scalar(3.5, unit='K')
     mapper = ColorMapper(vmin=vmin, vmax=vmax)
@@ -82,7 +82,7 @@ def test_vmin_vmax():
 
 def test_toggle_norm():
     mapper = ColorMapper()
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     mapper['child1'] = DummyChild(da)
     mapper.autoscale(da)
     assert mapper.norm == 'linear'
@@ -98,7 +98,7 @@ def test_toggle_norm():
 
 
 def test_update_changes_limits():
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     mapper = ColorMapper()
 
     mapper.update(data=da, key=None)
@@ -112,21 +112,21 @@ def test_update_changes_limits():
 
 
 def test_rgba():
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     mapper = ColorMapper()
     colors = mapper.rgba(da)
     assert colors.shape == da.data.shape + (4, )
 
 
 def test_rgba_with_masks():
-    da1 = dense_data_array(ndim=2, unit='K')
-    da2 = dense_data_array(ndim=2, unit='K', masks=True)
+    da1 = data_array(ndim=2, unit='K')
+    da2 = data_array(ndim=2, unit='K', masks=True)
     mapper = ColorMapper()
     assert not np.allclose(mapper.rgba(da1), mapper.rgba(da2))
 
 
 def test_colorbar_updated_on_rescale():
-    da = dense_data_array(ndim=2, unit='K')
+    da = data_array(ndim=2, unit='K')
     mapper = ColorMapper()
 
     mapper.update(data=da, key=None)
diff --git a/tests/graphics/fig1d_test.py b/tests/graphics/fig1d_test.py
index 0407e87..ce2103f 100644
--- a/tests/graphics/fig1d_test.py
+++ b/tests/graphics/fig1d_test.py
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.graphics.fig1d import Figure1d
 from plopp.graphics.line import Line
 from plopp import input_node
@@ -18,7 +18,7 @@ def test_empty():
 def test_update():
     fig = Figure1d()
     assert len(fig.artists) == 0
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     key = 'data1d'
     fig.update(da, key=key)
     assert isinstance(fig.artists[key], Line)
@@ -28,15 +28,15 @@ def test_update():
 def test_update_not_1d_raises():
     fig = Figure1d()
     with pytest.raises(ValueError) as e:
-        fig.update(dense_data_array(ndim=2), key='data2d')
+        fig.update(data_array(ndim=2), key='data2d')
     assert str(e.value) == "Figure1d can only be used to plot 1-D data."
     with pytest.raises(ValueError) as e:
-        fig.update(dense_data_array(ndim=3), key='data3d')
+        fig.update(data_array(ndim=3), key='data3d')
     assert str(e.value) == "Figure1d can only be used to plot 1-D data."
 
 
 def test_create_with_node():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     fig = Figure1d(input_node(da))
     assert len(fig.artists) == 1
     line = list(fig.artists.values())[0]
@@ -45,7 +45,7 @@ def test_create_with_node():
 
 
 def test_with_errorbars():
-    da = dense_data_array(ndim=1, with_variance=True)
+    da = data_array(ndim=1, variances=True)
     fig = Figure1d(input_node(da))
     assert len(fig.artists) == 1
     line = list(fig.artists.values())[0]
@@ -56,7 +56,7 @@ def test_with_errorbars():
 
 
 def test_with_binedges():
-    da = dense_data_array(ndim=1, binedges=True)
+    da = data_array(ndim=1, binedges=True)
     fig = Figure1d(input_node(da))
     assert len(fig.artists) == 1
     line = list(fig.artists.values())[0]
@@ -74,7 +74,7 @@ def test_log_norm():
 
 
 def test_crop():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     fig = Figure1d(input_node(da))
     assert fig.canvas.ax.get_xlim()[0] < da.meta['xx'].min().value
     assert fig.canvas.ax.get_xlim()[1] > da.meta['xx'].max().value
@@ -87,7 +87,7 @@ def test_crop():
 
 
 def test_update_grows_limits():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     fig = Figure1d(input_node(da))
     old_lims = fig.canvas.ax.get_ylim()
     key = list(fig.artists.keys())[0]
@@ -98,7 +98,7 @@ def test_update_grows_limits():
 
 
 def test_update_does_not_shrink_limits():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     fig = Figure1d(input_node(da))
     old_lims = fig.canvas.ax.get_ylim()
     key = list(fig.artists.keys())[0]
@@ -125,7 +125,7 @@ def test_with_strings_as_bin_edges():
 
 
 def test_figsize():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     size = (6.1, 3.3)
     fig = Figure1d(input_node(da), figsize=size)
     assert np.allclose(fig.canvas.fig.get_size_inches(), size)
diff --git a/tests/graphics/fig2d_test.py b/tests/graphics/fig2d_test.py
index 8636f15..55bd794 100644
--- a/tests/graphics/fig2d_test.py
+++ b/tests/graphics/fig2d_test.py
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.graphics.fig2d import Figure2d
 from plopp.graphics.mesh import Mesh
 from plopp import input_node
@@ -18,7 +18,7 @@ def test_empty():
 def test_update():
     fig = Figure2d()
     assert len(fig.artists) == 0
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     key = 'data2d'
     fig.update(da, key=key)
     assert isinstance(fig.artists[key], Mesh)
@@ -28,29 +28,29 @@ def test_update():
 def test_update_not_2d_raises():
     fig = Figure2d()
     with pytest.raises(ValueError) as e:
-        fig.update(dense_data_array(ndim=1), key='data1d')
+        fig.update(data_array(ndim=1), key='data1d')
     assert str(e.value) == "Figure2d can only be used to plot 2-D data."
     with pytest.raises(ValueError) as e:
-        fig.update(dense_data_array(ndim=3), key='data3d')
+        fig.update(data_array(ndim=3), key='data3d')
     assert str(e.value) == "Figure2d can only be used to plot 2-D data."
 
 
 def test_create_with_node():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     fig = Figure2d(input_node(da))
     assert len(fig.artists) == 1
     assert sc.identical(list(fig.artists.values())[0]._data, da)
 
 
 def test_create_with_bin_edges():
-    da = dense_data_array(ndim=2, binedges=True)
+    da = data_array(ndim=2, binedges=True)
     fig = Figure2d(input_node(da))
     assert len(fig.artists) == 1
     assert sc.identical(list(fig.artists.values())[0]._data, da)
 
 
 def test_create_with_only_one_bin_edge_coord():
-    da = dense_data_array(ndim=2, binedges=True)
+    da = data_array(ndim=2, binedges=True)
     da.coords['xx'] = sc.midpoints(da.coords['xx'])
     fig = Figure2d(input_node(da))
     assert len(fig.artists) == 1
@@ -63,7 +63,7 @@ def test_log_norm():
 
 
 def test_toggle_norm():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     fig = Figure2d(input_node(da))
     assert fig.colormapper.norm == 'linear'
     fig.toggle_norm()
@@ -71,7 +71,7 @@ def test_toggle_norm():
 
 
 def test_crop():
-    da = dense_data_array(ndim=2, binedges=True)
+    da = data_array(ndim=2, binedges=True)
     fig = Figure2d(input_node(da))
     assert fig.canvas.ax.get_xlim() == (da.meta['xx'].min().value,
                                         da.meta['xx'].max().value)
@@ -87,14 +87,14 @@ def test_crop():
 
 
 def test_cbar():
-    da = dense_data_array(ndim=2, binedges=True)
+    da = data_array(ndim=2, binedges=True)
     fig = Figure2d(input_node(da), cbar=False)
     assert fig.canvas.cax is None
 
 
 def test_update_on_one_mesh_changes_colors_on_second_mesh():
-    da1 = dense_data_array(ndim=2)
-    da2 = 3.0 * dense_data_array(ndim=2)
+    da1 = data_array(ndim=2)
+    da2 = 3.0 * data_array(ndim=2)
     da2.coords['xx'] += sc.scalar(50.0, unit='m')
     a = input_node(da1)
     b = input_node(da2)
@@ -143,7 +143,7 @@ def test_with_strings_as_bin_edges_other_coord_is_bin_centers():
 
 
 def test_kwargs_are_forwarded_to_artist():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     fig = Figure2d(input_node(da), rasterized=True)
     artist = list(fig.artists.values())[0]
     assert artist._mesh.get_rasterized()
@@ -153,7 +153,7 @@ def test_kwargs_are_forwarded_to_artist():
 
 
 def test_figsize():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     size = (8.1, 8.3)
     fig = Figure2d(input_node(da), figsize=size)
     assert np.allclose(fig.canvas.fig.get_size_inches(), size)
diff --git a/tests/graphics/line_test.py b/tests/graphics/line_test.py
index 8b82d2a..690f2ed 100644
--- a/tests/graphics/line_test.py
+++ b/tests/graphics/line_test.py
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.graphics.canvas import Canvas
 from plopp.graphics.line import Line
 import numpy as np
@@ -9,7 +9,7 @@ import scipp as sc
 
 
 def test_line_creation():
-    da = dense_data_array(ndim=1, unit='K')
+    da = data_array(ndim=1, unit='K')
     line = Line(canvas=Canvas(), data=da)
     assert line._unit == 'K'
     assert line._dim == 'xx'
@@ -21,13 +21,13 @@ def test_line_creation():
 
 
 def test_line_creation_bin_edges():
-    da = dense_data_array(ndim=1, binedges=True)
+    da = data_array(ndim=1, binedges=True)
     line = Line(canvas=Canvas(), data=da)
     assert len(line._line.get_xdata()) == da.sizes['xx'] + 1
 
 
 def test_line_with_errorbars():
-    da = dense_data_array(ndim=1, with_variance=True)
+    da = data_array(ndim=1, variances=True)
     line = Line(canvas=Canvas(), data=da)
     assert line._error.has_yerr
     coll = line._error.get_children()[0]
@@ -40,19 +40,19 @@ def test_line_with_errorbars():
 
 
 def test_line_hide_errorbars():
-    da = dense_data_array(ndim=1, with_variance=True)
+    da = data_array(ndim=1, variances=True)
     line = Line(canvas=Canvas(), data=da, errorbars=False)
     assert line._error is None
 
 
 def test_line_with_mask():
-    da = dense_data_array(ndim=1, masks=True)
+    da = data_array(ndim=1, masks=True)
     line = Line(canvas=Canvas(), data=da)
     assert line._mask.get_visible()
 
 
 def test_line_update():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     line = Line(canvas=Canvas(), data=da)
     assert np.allclose(line._line.get_xdata(), da.meta['xx'].values)
     assert np.allclose(line._line.get_ydata(), da.values)
@@ -62,7 +62,7 @@ def test_line_update():
 
 
 def test_line_update_with_errorbars():
-    da = dense_data_array(ndim=1, with_variance=True)
+    da = data_array(ndim=1, variances=True)
     line = Line(canvas=Canvas(), data=da)
     coll = line._error.get_children()[0]
     x = np.array(coll.get_segments())[:, 0, 0]
diff --git a/tests/graphics/mesh_test.py b/tests/graphics/mesh_test.py
index 4329360..b07216d 100644
--- a/tests/graphics/mesh_test.py
+++ b/tests/graphics/mesh_test.py
@@ -1,32 +1,32 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from plopp.graphics.canvas import Canvas
 from plopp.graphics.mesh import Mesh
 import scipp as sc
 
 
 def test_mesh_creation():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     mesh = Mesh(canvas=Canvas(), data=da)
     assert sc.identical(mesh._data, da)
 
 
 def test_mesh_creation_binedges():
-    da = dense_data_array(ndim=2, binedges=True)
+    da = data_array(ndim=2, binedges=True)
     mesh = Mesh(canvas=Canvas(), data=da)
     assert sc.identical(mesh._data, da)
 
 
 def test_mesh_creation_masks():
-    da = dense_data_array(ndim=2, masks=True)
+    da = data_array(ndim=2, masks=True)
     mesh = Mesh(canvas=Canvas(), data=da)
     assert sc.identical(mesh._data, da)
 
 
 def test_mesh_creation_ragged_coord():
-    da = dense_data_array(ndim=2, ragged=True)
+    da = data_array(ndim=2, ragged=True)
     mesh = Mesh(canvas=Canvas(), data=da)
     assert mesh._dim_2d == ('x', 'xx')
     assert mesh._dim_1d == ('y', 'yy')
@@ -34,7 +34,7 @@ def test_mesh_creation_ragged_coord():
 
 
 def test_mesh_update():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     mesh = Mesh(canvas=Canvas(), data=da)
     assert sc.identical(mesh._data, da)
     mesh.update(da * 2.5)
diff --git a/tests/high_level_test.py b/tests/high_level_test.py
index f612993..87ef0c6 100644
--- a/tests/high_level_test.py
+++ b/tests/high_level_test.py
@@ -4,7 +4,7 @@
 import scipp as sc
 from plopp import figure1d, figure2d, node, input_node, widget_node
 from plopp.widgets import Checkboxes, SliceWidget, slice_dims, Box
-from plopp.data import dense_data_array, dense_dataset
+from plopp.data import data_array, dataset
 import ipywidgets as ipw
 
 
@@ -18,20 +18,20 @@ def hide_masks(data_array, masks):
 
 
 def test_single_1d_line():
-    da = dense_data_array(ndim=1)
+    da = data_array(ndim=1)
     n = input_node(da)
     _ = figure1d(n)
 
 
 def test_two_1d_lines():
-    ds = dense_dataset(ndim=1)
+    ds = dataset(ndim=1)
     a = input_node(ds['a'])
     b = input_node(ds['b'])
     _ = figure1d(a, b)
 
 
 def test_difference_of_two_1d_lines():
-    ds = dense_dataset(ndim=1)
+    ds = dataset(ndim=1)
     a = input_node(ds['a'])
     b = input_node(ds['b'])
 
@@ -44,13 +44,13 @@ def test_difference_of_two_1d_lines():
 
 
 def test_2d_image():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     a = input_node(da)
     _ = figure2d(a)
 
 
 def test_2d_image_smoothing_slider():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     a = input_node(da)
 
     sl = ipw.IntSlider(min=1, max=10)
@@ -65,7 +65,7 @@ def test_2d_image_smoothing_slider():
 
 
 def test_2d_image_with_masks():
-    da = dense_data_array(ndim=2)
+    da = data_array(ndim=2)
     da.masks['m1'] = da.data < sc.scalar(0.0, unit='m/s')
     da.masks['m2'] = da.coords['xx'] > sc.scalar(30., unit='m')
 
@@ -81,7 +81,7 @@ def test_2d_image_with_masks():
 
 
 def test_two_1d_lines_with_masks():
-    ds = dense_dataset()
+    ds = dataset()
     ds['a'].masks['m1'] = ds['a'].coords['xx'] > sc.scalar(40.0, unit='m')
     ds['a'].masks['m2'] = ds['a'].data < ds['b'].data
     ds['b'].masks['m1'] = ds['b'].coords['xx'] < sc.scalar(5.0, unit='m')
@@ -100,7 +100,7 @@ def test_two_1d_lines_with_masks():
 
 
 def test_node_sum_data_along_y():
-    da = dense_data_array(ndim=2, binedges=True)
+    da = data_array(ndim=2, binedges=True)
     a = input_node(da)
 
     s = node(sc.sum, dim='yy')(a)
@@ -111,7 +111,7 @@ def test_node_sum_data_along_y():
 
 
 def test_slice_3d_cube():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     a = input_node(da)
     sl = SliceWidget(da, ['zz'])
     w = widget_node(sl)
@@ -124,7 +124,7 @@ def test_slice_3d_cube():
 
 
 def test_3d_image_slicer_with_connected_side_histograms():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     a = input_node(da)
     sl = SliceWidget(da, ['zz'])
     w = widget_node(sl)
diff --git a/tests/widgets/slice_test.py b/tests/widgets/slice_test.py
index 0aee036..fb8516d 100644
--- a/tests/widgets/slice_test.py
+++ b/tests/widgets/slice_test.py
@@ -2,12 +2,12 @@
 # Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
 
 from plopp.widgets import SliceWidget, slice_dims
-from plopp.data import dense_data_array
+from plopp.data import data_array
 from scipp import identical
 
 
 def test_slice_creation():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     dims = ['xx', 'yy']
     sw = SliceWidget(da, dims=dims)
     assert sw._slider_dims == dims
@@ -20,7 +20,7 @@ def test_slice_creation():
 
 
 def test_slice_value_property():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     dims = ['xx', 'yy']
     sw = SliceWidget(da, dims=dims)
     sw.controls['xx']['slider'].value = 10
@@ -29,7 +29,7 @@ def test_slice_value_property():
 
 
 def test_slice_label_updates():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     da.coords['xx'] *= 1.1
     da.coords['yy'] *= 3.3
     dims = ['xx', 'yy']
@@ -43,7 +43,7 @@ def test_slice_label_updates():
 
 
 def test_slice_dims():
-    da = dense_data_array(ndim=3)
+    da = data_array(ndim=3)
     slices = {'xx': 8, 'yy': 7}
     expected = da['xx', slices['xx']]['yy', slices['yy']]
     assert identical(slice_dims().func(da, slices=slices), expected)