From 52e65b148ebb1fc1e11492788b39dc96c84789f2 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Mon, 7 Oct 2024 11:08:08 +0200 Subject: [PATCH] unit=None for ids --- pyproject.toml | 3 +++ src/tof/source.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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 c308b06..9b2b603 100644 --- a/src/tof/source.py +++ b/src/tof/source.py @@ -226,7 +226,7 @@ def __init__( "time": pulse_params["time"], "wavelength": pulse_params["wavelength"], "speed": pulse_params["speed"], - "id": sc.arange("event", pulse_params["time"].size).fold( + "id": sc.arange("event", pulse_params["time"].size, unit=None).fold( "event", sizes=pulse_params["time"].sizes ), }, @@ -273,7 +273,7 @@ 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).fold( + "id": sc.arange("event", birth_times.size, unit=None).fold( "event", sizes=birth_times.sizes ), }, @@ -332,7 +332,7 @@ def from_distribution( "time": pulse_params["time"], "wavelength": pulse_params["wavelength"], "speed": pulse_params["speed"], - "id": sc.arange("event", pulse_params["time"].size).fold( + "id": sc.arange("event", pulse_params["time"].size, unit=None).fold( "event", sizes=pulse_params["time"].sizes ), },