diff --git a/pyproject.toml b/pyproject.toml index 133f573..6d5ef05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,3 +42,6 @@ skip-string-normalization = true [tool.isort] skip_gitignore = true profile = "black" + +[tool.ruff.format] +quote-style = "preserve" diff --git a/src/tof/source.py b/src/tof/source.py index 38896de..9b2b603 100644 --- a/src/tof/source.py +++ b/src/tof/source.py @@ -226,6 +226,9 @@ def __init__( "time": pulse_params["time"], "wavelength": pulse_params["wavelength"], "speed": pulse_params["speed"], + "id": sc.arange("event", pulse_params["time"].size, unit=None).fold( + "event", sizes=pulse_params["time"].sizes + ), }, ) @@ -270,6 +273,9 @@ def from_neutrons( "time": birth_times, "wavelength": wavelengths, "speed": wavelength_to_speed(wavelengths).to(unit="m/s", copy=False), + "id": sc.arange("event", birth_times.size, unit=None).fold( + "event", sizes=birth_times.sizes + ), }, ) @@ -326,6 +332,9 @@ def from_distribution( "time": pulse_params["time"], "wavelength": pulse_params["wavelength"], "speed": pulse_params["speed"], + "id": sc.arange("event", pulse_params["time"].size, unit=None).fold( + "event", sizes=pulse_params["time"].sizes + ), }, ) return source