Skip to main content

PySide or PyQt tree model/view for a Zarr hierarchy.

Project description

zarr-view

PySide or PyQt tree model-view for a Zarr hierarchy

Install

  1. Install either PySide6>=6.5.2, PyQt6>=6.5.2, or PyQt5. :warning: The Qt6 version requirements are due to a Qt6.5.1 bug that causes the tree view to crash on macOS arm64 chipset. If you are using a different OS, then this bug may not apply to you and you may be able to ignore these version requirements. For example:
pip install PySide6>=6.5.2
  1. Install zarrview:
pip install zarrview

Quick start example

# Replace PySide6 with PyQt6 or PyQt5 depending on what Qt package you installed.
from PySide6.QtWidgets import QApplication
import sys
import zarr
from zarrview.ZarrViewer import ZarrViewer

# example zarr hierarchy (in-memory vs on-disk should not matter)
root = zarr.group()
foo = root.create_group('foo')
bar = foo.create_dataset('bar', shape=100, chunks=10)
baz = foo.create_group('baz')
quux = baz.create_dataset('quux', shape=200, chunks=20)

# attributes for quux
quux.attrs['a_int'] = 82
quux.attrs['a_float'] = 3.14
quux.attrs['a_bool'] = False
quux.attrs['a_str'] = 'zarr-view is awesome!'
quux.attrs['a_dict'] = {'a_child': 42}
quux.attrs['a_list'] = [8, 4.5, True, 'hello']

# create app
app = QApplication(sys.argv)

# init zarr viewer widget with root of hierarchy
viewer = ZarrViewer(root)
viewer.show()
viewer.setWindowTitle('ZarrViewer')

# run app
sys.exit(app.exec())

The viewer displays a tree view of the Zaar hierarchy groups and arrays along with a representation of each arrays size and data type.

Selecting a group or array in the tree view of the Zarr hierarchy displays the info for the selected object below the tree:

The selected object's attributes can also be viewed and edited in their own tree view below the main hierarchy view:

You can insert new attributes or delete attributes via the viewer:

Toolbar buttons allow quickly collapsing or expanding the tree to any level:

You can insert new groups or delete groups or arrays via the viewer:

You can drag and drop groups or arrays to restructure the hierarchy:

You can specify a specific path or path slice through the hierarchy to display (see the sections on path slicing and N-D arrays of ordered groups):

You can dynamically reset the displayed hierarchy:

viewer.setTree(baz)

Path slicing

:construction:

N-D arrays of ordered groups

:construction:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zarrview-0.1.1.tar.gz (17.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page