Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions packages/essimaging/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,43 +91,6 @@ filterwarnings = [
'ignore:\n Sentinel is not a public part of the traitlets API:DeprecationWarning'
]

[tool.ruff]
line-length = 88
extend-include = ["*.ipynb"]
extend-exclude = [
".*", "__pycache__", "build", "dist", "install",
]

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
select = ["B", "C4", "DTZ", "E", "F", "G", "I", "PERF", "PGH", "PT", "PYI", "RUF", "S", "T20", "UP", "W"]
ignore = [
# Conflict with ruff format, see
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", "COM819", "D206", "D300", "E111", "E114", "E117", "ISC001", "ISC002", "Q000", "Q001", "Q002", "Q003", "W191",
]
fixable = ["B010", "I001", "PT001", "RUF022"]
isort.known-first-party = ["ess.imaging"]
pydocstyle.convention = "numpy"

[tool.ruff.lint.per-file-ignores]
# those files have an increased risk of relying on import order
"tests/*" = [
"S101", # asserts are fine in tests
"B018", # 'useless expressions' are ok because some tests just check for exceptions
]
"*.ipynb" = [
"E501", # longer lines are sometimes more readable
"F403", # *-imports used with domain types
"F405", # linter may fail to find names because of *-imports
"I", # we don't collect imports at the top
"S101", # asserts are used for demonstration and are safe in notebooks
"T201", # printing is ok for demonstration purposes
]

[tool.ruff.format]
quote-style = "preserve"

[tool.mypy]
strict = true
ignore_missing_imports = true
Expand Down
1 change: 1 addition & 0 deletions packages/essimaging/src/ess/imaging/masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import scipp as sc

from ess.reduce.nexus.types import RawDetector

from ..imaging.types import CorrectedDetector, MaskingRules, RunType
Expand Down
1 change: 1 addition & 0 deletions packages/essimaging/src/ess/imaging/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import sciline
import scipp as sc

from ess.reduce.nexus import types as reduce_t
from ess.reduce.uncertainty import UncertaintyBroadcastMode as _UncertaintyBroadcastMode
from ess.reduce.unwrap import types as unwrap_t
Expand Down
1 change: 1 addition & 0 deletions packages/essimaging/src/ess/odin/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import sciline

from ess.reduce.unwrap.workflow import GenericUnwrapWorkflow

from ..imaging.types import (
Expand Down
1 change: 1 addition & 0 deletions packages/essimaging/src/ess/tbl/orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import sciline as sl
import scipp as sc

from ess.reduce.nexus import GenericNeXusWorkflow, load_from_path
from ess.reduce.nexus.types import (
NeXusDetectorName,
Expand Down
1 change: 1 addition & 0 deletions packages/essimaging/src/ess/tbl/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import sciline

from ess.reduce.unwrap.workflow import GenericUnwrapWorkflow

from ..imaging.types import (
Expand Down
3 changes: 2 additions & 1 deletion packages/essimaging/src/ess/ymir/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import scipp as sc
import scippnexus as snx
import scitiff
from ess.reduce.nexus.types import FilePath
from tifffile import imwrite

from ess.reduce.nexus.types import FilePath

from .types import (
DEFAULT_HISTOGRAM_PATH,
HistogramModeDetectorsPath,
Expand Down
2 changes: 1 addition & 1 deletion packages/essimaging/tests/imaging/tools/analysis_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import numpy as np
import pytest
import scipp as sc
from ess import imaging as img
from scipp.testing import assert_identical
from scitiff.io import load_scitiff

from ess import imaging as img
from ess.imaging.data import siemens_star_path


Expand Down
4 changes: 2 additions & 2 deletions packages/essimaging/tests/odin/data_reduction_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2025 Scipp contributors (https://github.com/scipp)

import ess.odin.data # noqa: F401
import pytest
import sciline as sl

import ess.odin.data # noqa: F401
from ess import odin

from ess.imaging.types import (
Filename,
LookupTable,
Expand Down
8 changes: 4 additions & 4 deletions packages/essimaging/tests/tbl/data_reduction_test.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2025 Scipp contributors (https://github.com/scipp)

import ess.tbl.data # noqa: F401
import pytest
import sciline as sl
import scipp as sc
from ess.reduce import unwrap
from ess.reduce.nexus.types import AnyRun

import ess.tbl.data # noqa: F401
from ess import tbl

from ess.imaging.types import (
Filename,
LookupTable,
Expand All @@ -18,6 +16,8 @@
SampleRun,
WavelengthDetector,
)
from ess.reduce import unwrap
from ess.reduce.nexus.types import AnyRun


@pytest.fixture(scope="module")
Expand Down
6 changes: 3 additions & 3 deletions packages/essimaging/tests/tbl/orca_test.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2025 Scipp contributors (https://github.com/scipp)

import ess.tbl.data # noqa: F401
import pytest
import sciline as sl
import scipp as sc
import scippnexus as sx
from ess import tbl
from ess.tbl import orca
from scipp.testing import assert_identical

import ess.tbl.data # noqa: F401
from ess import tbl
from ess.imaging.types import (
BackgroundSubtractedDetector,
CorrectedDetector,
Expand All @@ -25,7 +26,6 @@
SampleRun,
UncertaintyBroadcastMode,
)
from ess.tbl import orca


@pytest.fixture
Expand Down
3 changes: 1 addition & 2 deletions packages/essimaging/tests/ymir/image_normalize_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Copyright (c) 2024 Scipp contributors (https://github.com/scipp)
import pytest
import scipp as sc
from scipp.testing.assertions import assert_allclose, assert_identical

from ess.ymir.io import (
DarkCurrentImageStacks,
OpenBeamImageStacks,
Expand All @@ -29,6 +27,7 @@
normalize_sample_images,
)
from ess.ymir.workflow import YmirImageNormalizationWorkflow
from scipp.testing.assertions import assert_allclose, assert_identical


@pytest.fixture
Expand Down
3 changes: 1 addition & 2 deletions packages/essimaging/tests/ymir/io_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Copyright (c) 2024 Scipp contributors (https://github.com/scipp)
import pytest
import scipp as sc
from scipp.testing import assert_identical

from ess.ymir.data import ymir_lego_images_path
from ess.ymir.io import (
FilePath,
Expand All @@ -14,6 +12,7 @@
load_nexus_rotation_logs,
)
from ess.ymir.types import DEFAULT_HISTOGRAM_PATH
from scipp.testing import assert_identical


def test_nexus_histogram_mode_detector_loading_warnings() -> None:
Expand Down
45 changes: 0 additions & 45 deletions packages/essnmx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,43 +97,6 @@ filterwarnings = [
"error",
]

[tool.ruff]
line-length = 88
extend-include = ["*.ipynb"]
extend-exclude = [
".*", "__pycache__", "build", "dist", "install",
]

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
select = ["B", "C4", "DTZ", "E", "F", "G", "I", "PERF", "PGH", "PT", "PYI", "RUF", "S", "T20", "UP", "W"]
ignore = [
# Conflict with ruff format, see
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", "COM819", "D206", "D300", "E111", "E114", "E117", "ISC001", "ISC002", "Q000", "Q001", "Q002", "Q003", "W191",
]
fixable = ["B010", "I001", "PT001", "RUF022"]
isort.known-first-party = ["ess.nmx"]
pydocstyle.convention = "numpy"

[tool.ruff.lint.per-file-ignores]
# those files have an increased risk of relying on import order
"tests/*" = [
"S101", # asserts are fine in tests
"B018", # 'useless expressions' are ok because some tests just check for exceptions
]
"*.ipynb" = [
"E501", # longer lines are sometimes more readable
"F403", # *-imports used with domain types
"F405", # linter may fail to find names because of *-imports
"I", # we don't collect imports at the top
"S101", # asserts are used for demonstration and are safe in notebooks
"T201", # printing is ok for demonstration purposes
]

[tool.ruff.format]
quote-style = "preserve"

[tool.mypy]
strict = true
ignore_missing_imports = true
Expand All @@ -143,11 +106,3 @@ enable_error_code = [
"truthy-bool",
]
warn_unreachable = true

[tool.codespell]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add this back into the global config?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already there

args: ["-L", "socio-economic"]

ignore-words-list = [
# Codespell wants "socioeconomic" which seems to be the standard spelling.
# But we use the word in our code of conduct which is the contributor covenant.
# Let's not modify it if we don't have to.
"socio-economic",
]
3 changes: 2 additions & 1 deletion packages/essnmx/src/ess/nmx/_nxlauetof_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import scipp as sc
import scippnexus as snx
from ess.reduce.nexus.types import FilePath, NeXusFile
from scippneutron.metadata import RadiationProbe, SourceType

from ess.reduce.nexus.types import FilePath, NeXusFile

from .types import ControlMode


Expand Down
1 change: 1 addition & 0 deletions packages/essnmx/src/ess/nmx/executables.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import numpy as np
import scipp as sc
import scippnexus as snx

from ess.reduce.nexus.types import Filename, NeXusName, RawDetector, SampleRun
from ess.reduce.unwrap.types import LookupTable

Expand Down
1 change: 1 addition & 0 deletions packages/essnmx/src/ess/nmx/mcstas/executables.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import sciline as sl
import scipp as sc

from ess.reduce.streaming import (
EternalAccumulator,
MaxAccumulator,
Expand Down
1 change: 1 addition & 0 deletions packages/essnmx/src/ess/nmx/mcstas/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import scipp as sc
import scippnexus as snx

from ess.reduce.streaming import Accumulator

from .load import _validate_chunk_size, load_event_data_bank_name
Expand Down
3 changes: 2 additions & 1 deletion packages/essnmx/src/ess/nmx/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import sciline as sl
import scipp as sc
import scippnexus as snx
from scippneutron.metadata import RadiationProbe, SourceType

from ess.reduce.nexus.types import RunType
from ess.reduce.unwrap.types import LookupTable
from scippneutron.metadata import RadiationProbe, SourceType

from ._display_helper import to_datagroup

Expand Down
3 changes: 2 additions & 1 deletion packages/essnmx/src/ess/nmx/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import scipp as sc
import scippnexus as snx
import tof
from scippneutron.conversion.tof import tof_from_wavelength

from ess.reduce.nexus.types import (
EmptyDetector,
Filename,
Expand All @@ -28,7 +30,6 @@
WavelengthDetector,
)
from ess.reduce.workflow import register_workflow
from scippneutron.conversion.tof import tof_from_wavelength

from .configurations import WorkflowConfig
from .types import (
Expand Down
3 changes: 1 addition & 2 deletions packages/essnmx/tests/executable_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,8 @@ def lut_file_path(tmp_path: pathlib.Path):
"""Fixture to provide the path to the small NMX NeXus file."""
from dataclasses import is_dataclass

from ess.reduce.unwrap import LookupTable

from ess.nmx.workflows import initialize_nmx_workflow
from ess.reduce.unwrap import LookupTable

# Simply use the default workflow for testing.
workflow = initialize_nmx_workflow(config=WorkflowConfig())
Expand Down
37 changes: 0 additions & 37 deletions packages/essreduce/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,43 +94,6 @@ filterwarnings = [
'ignore:Jupyter is migrating its paths:DeprecationWarning',
]

[tool.ruff]
line-length = 88
extend-include = ["*.ipynb"]
extend-exclude = [
".*", "__pycache__", "build", "dist", "install",
]

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
select = ["B", "C4", "DTZ", "E", "F", "G", "I", "PERF", "PGH", "PT", "PYI", "RUF", "S", "T20", "UP", "W"]
ignore = [
# Conflict with ruff format, see
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", "COM819", "D206", "D300", "E111", "E114", "E117", "ISC001", "ISC002", "Q000", "Q001", "Q002", "Q003", "W191",
]
fixable = ["B010", "I001", "PT001", "RUF022"]
isort.known-first-party = ["ess.reduce"]
pydocstyle.convention = "numpy"

[tool.ruff.lint.per-file-ignores]
# those files have an increased risk of relying on import order
"tests/*" = [
"S101", # asserts are fine in tests
"B018", # 'useless expressions' are ok because some tests just check for exceptions
]
"*.ipynb" = [
"E501", # longer lines are sometimes more readable
"F403", # *-imports used with domain types
"F405", # linter may fail to find names because of *-imports
"I", # we don't collect imports at the top
"S101", # asserts are used for demonstration and are safe in notebooks
"T201", # printing is ok for demonstration purposes
]

[tool.ruff.format]
quote-style = "preserve"

[tool.mypy]
strict = true
ignore_missing_imports = true
Expand Down
Loading
Loading