Repository: scipp/scippnexus

Issue:
Should loading event data no longer create weights with variances?
After scipp/scipp#2895, broadcasting of variances will no longer be supported. This implies that the "standard" paradigm of handling uncertainties will not be feasible any more. This further implies that there is limited use to carrying uncertainties of "counts", since uncertainties can simply be computed later on.

We should therefore consider avoiding the overhead of creating variances for the weights when an `NXdetector` with `NXevent_data` is loaded. This would save both memory and compute resources.

Discussion:

Patch:
diff --git a/docs/about/release-notes.rst b/docs/about/release-notes.rst
index e8047de..b6dff84 100644
--- a/docs/about/release-notes.rst
+++ b/docs/about/release-notes.rst
@@ -28,6 +28,19 @@ Release Notes
    Neil Vaytet :sup:`a`\ ,
    and Jan-Lukas Wynen :sup:`a`
 
+v23.01.0
+--------
+
+Breaking changes
+~~~~~~~~~~~~~~~~
+
+* :class:`scippnexus.NXevent_data` is now loaded without automatically assigning a variance of 1 to the event weights `#94 <https://github.com/scipp/scippnexus/pull/94>`_.
+
+Contributors
+~~~~~~~~~~~~
+
+Simon Heybrock :sup:`a`
+
 v0.4.2 (November 2022)
 ----------------------
 
diff --git a/src/scippnexus/nxevent_data.py b/src/scippnexus/nxevent_data.py
index 920dcee..59155cb 100644
--- a/src/scippnexus/nxevent_data.py
+++ b/src/scippnexus/nxevent_data.py
@@ -84,8 +84,7 @@ class NXevent_data(NXobject):
         weights = sc.ones(dims=[_event_dimension],
                           shape=event_time_offset.shape,
                           unit='counts',
-                          dtype=np.float32,
-                          with_variances=True)
+                          dtype=np.float32)
 
         events = sc.DataArray(data=weights,
                               coords={'event_time_offset': event_time_offset})


Test patch:
diff --git a/tests/nxdetector_test.py b/tests/nxdetector_test.py
index 5e9aeaf..93c2437 100644
--- a/tests/nxdetector_test.py
+++ b/tests/nxdetector_test.py
@@ -53,7 +53,9 @@ def test_loads_events_when_data_and_events_found(nxroot):
                                                         values=[1]))
     detector.create_field('event_time_zero', sc.array(dims=[''], unit='s', values=[1]))
     detector.create_field('event_index', sc.array(dims=[''], unit='None', values=[0]))
-    assert detector[...].bins is not None
+    loaded = detector[...]
+    assert loaded.bins is not None
+    assert loaded.values[0].variances is None
 
 
 def detector_numbers_xx_yy_1234():