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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 101e594
_commit: a052529
_src_path: gh:scipp/copier_template
description: Reflectometry data reduction for the European Spallation Source
max_python: '3.12'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
- uses: pre-commit-ci/lite-action@v1.0.2
- uses: pre-commit-ci/lite-action@v1.0.3
if: always()
with:
msg: Apply automatic formatting
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
name: docs_html
path: html/

- uses: JamesIves/github-pages-deploy-action@v4.6.3
- uses: JamesIves/github-pages-deploy-action@v4.6.4
if: ${{ inputs.publish }}
with:
branch: gh-pages
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ on:
type: string

jobs:
package-test:
runs-on: ${{ inputs.os-variant }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- run: python -m pip install --upgrade pip
- run: python -m pip install .
- run: python tests/package_test.py
name: Run package tests

test:
runs-on: ${{ inputs.os-variant }}
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ dist
html
.tox
*.egg-info
uv.lock # we lock dependencies with pip-compile, not uv

*.sw?

# Environments
venv
.venv

# Caches
.clangd/
Expand Down Expand Up @@ -39,3 +41,4 @@ docs/generated/
*.cif
*.rcif
*.ort
*.zip
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-json
Expand All @@ -14,22 +14,22 @@ repos:
args: [ --markdown-linebreak-ext=md ]
exclude: '\.svg'
- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
rev: 0.7.1
hooks:
- id: nbstripout
types: [ "jupyter" ]
args: [ "--drop-empty-cells",
"--extra-keys 'metadata.language_info.version cell.metadata.jp-MarkdownHeadingCollapsed cell.metadata.pycharm'" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.6.2
hooks:
- id: ruff
args: [ --fix ]
types_or: [ python, pyi, jupyter ]
- id: ruff-format
types_or: [ python, pyi ]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand Down
9 changes: 7 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ source:

{% set pyproject = load_file_data('pyproject.toml') %}
{% set dependencies = pyproject.get('project', {}).get('dependencies', {}) %}
{% set test_dependencies = pyproject.get('project', {}).get('optional-dependencies', {}).get('test', {}) %}


requirements:
Expand All @@ -29,8 +30,12 @@ test:
- ess.reflectometry
- ess.amor
requires:
- pytest
- pooch

{# Conda does not allow spaces between package name and version, so remove them #}
{% for package in test_dependencies %}
- {% if package == "graphviz" %}python-graphviz{% else %}{{ package|replace(" ", "") }}{% endif %}
{% endfor %}

source_files:
- pyproject.toml
- tests/
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2024 Scipp contributors (https://github.com/scipp)

import doctest
import os
import sys
Expand Down
22 changes: 11 additions & 11 deletions docs/user-guide/amor/compare-to-eos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "b97647a4-29ab-45a3-870e-aa49fbddb0c5",
"id": "0",
"metadata": {},
"source": [
"# Comparison with PSI reduction software\n",
Expand All @@ -14,7 +14,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9aaa5e0c-def6-4da5-9f63-b4c72a0de8f1",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -31,7 +31,7 @@
},
{
"cell_type": "markdown",
"id": "f9f28ab3-b9fd-4cfd-88bd-d290ea5cdf4f",
"id": "2",
"metadata": {},
"source": [
"## Recreate reference files using Jochens Amor data reduction software\n",
Expand Down Expand Up @@ -60,7 +60,7 @@
},
{
"cell_type": "markdown",
"id": "a1d7fc35-d958-44ce-83a5-b8d877c47735",
"id": "3",
"metadata": {},
"source": [
"## Run essreflectometry on the same files"
Expand All @@ -69,7 +69,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fccf8385-b2ec-4c14-990f-9083a89f46a2",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -103,7 +103,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5a220b29-5115-4594-9c75-ed0f34be74f7",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -132,7 +132,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9311bc67-6edf-4f90-9280-f4bee8df9da3",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -147,7 +147,7 @@
},
{
"cell_type": "markdown",
"id": "64b685cb-654e-46a5-9eae-b9bf76dadb8d",
"id": "7",
"metadata": {},
"source": [
"## Plot reflectivity curve comparison"
Expand All @@ -156,7 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8e248ada-0db0-4e9e-a208-64e2ff74c7bb",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -181,7 +181,7 @@
},
{
"cell_type": "markdown",
"id": "9d97eff4-77cf-4ea1-8be7-1390bebfcb84",
"id": "9",
"metadata": {},
"source": [
"## Overlay curves from same sample at different angle, should be on top of each other"
Expand All @@ -190,7 +190,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4758e245-c47a-454c-9788-97b05b49f356",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand Down
20 changes: 18 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ dependencies = [
"sciline>=24.6.0",
"scipp>=24.09.1", # Fixed new hist/bin API
"scippneutron>=24.7.0",
"scippnexus>=24.9.1",
"essreduce",
]

dynamic = ["version"]

[project.optional-dependencies]
test = [
"pytest",
"pooch",
]

[project.urls]
"Bug Tracker" = "https://github.com/scipp/essreflectometry/issues"
"Documentation" = "https://scipp.github.io/essreflectometry"
Expand All @@ -65,6 +72,7 @@ filterwarnings = [
"error",
'ignore:\n.*Sentinel is not a public part of the traitlets API.*:DeprecationWarning',
"ignore:.*metadata to be logged in the data array, it is necessary to install the orsopy package.:UserWarning",
"ignore:.*A transformation needs a vector attribute. Falling back to returning underlying value.:UserWarning",
]

[tool.ruff]
Expand All @@ -82,8 +90,8 @@ ignore = [
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", "COM819", "D206", "D300", "E111", "E114", "E117", "ISC001", "ISC002", "Q000", "Q001", "Q002", "Q003", "W191",
]
fixable = ["I001", "B010"]
isort.known-first-party = ["essreflectometry"]
fixable = ["B010", "I001", "PT001"]
isort.known-first-party = ["ess.reflectometry"]
pydocstyle.convention = "numpy"

[tool.ruff.lint.per-file-ignores]
Expand Down Expand Up @@ -114,3 +122,11 @@ enable_error_code = [
"truthy-bool",
]
warn_unreachable = true

[tool.codespell]
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",
]
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ orsopy
sciline>=24.6.0
scipp>=24.09.1
scippneutron>=24.7.0
scippnexus>=24.9.1
essreduce
23 changes: 12 additions & 11 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:c59f85e6dbc38ae7eeef3ce1e4f681c07f43ff24
# SHA1:3401cd389c29441d88f259ef065f189c2f02bfcb
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -19,27 +19,27 @@ cyclebane==24.6.0
# via sciline
cycler==0.12.1
# via matplotlib
dask==2024.8.2
dask==2024.9.0
# via -r base.in
decorator==5.1.1
# via ipython
essreduce==24.9.0
essreduce==24.9.1
# via -r base.in
exceptiongroup==1.2.2
# via ipython
executing==2.1.0
# via stack-data
fonttools==4.53.1
fonttools==4.54.1
# via matplotlib
fsspec==2024.6.1
fsspec==2024.9.0
# via dask
graphviz==0.20.3
# via -r base.in
h5py==3.11.0
# via
# scippneutron
# scippnexus
importlib-metadata==8.4.0
importlib-metadata==8.5.0
# via dask
ipydatawidgets==4.3.5
# via pythreejs
Expand Down Expand Up @@ -92,11 +92,11 @@ pexpect==4.9.0
# via ipython
pillow==10.4.0
# via matplotlib
plopp==24.6.0
plopp==24.9.3
# via
# -r base.in
# scippneutron
prompt-toolkit==3.0.47
prompt-toolkit==3.0.48
# via ipython
ptyprocess==0.7.0
# via pexpect
Expand Down Expand Up @@ -127,10 +127,11 @@ scipp==24.9.1
# essreduce
# scippneutron
# scippnexus
scippneutron==24.8.0
scippneutron==24.9.0
# via -r base.in
scippnexus==24.8.1
scippnexus==24.9.1
# via
# -r base.in
# essreduce
# scippneutron
scipy==1.14.1
Expand Down Expand Up @@ -163,5 +164,5 @@ wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.13
# via ipywidgets
zipp==3.20.1
zipp==3.20.2
# via importlib-metadata
6 changes: 6 additions & 0 deletions requirements/basetest.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Dependencies that are only used by tests.
# Do not make an environment from this file, use test.txt instead!
# Add more dependencies in the ``test`` list
# under ``[project.optional-dependencies]`` section, in ``pyproject.toml``

# Anything above "--- END OF CUSTOM SECTION ---"
# will not be touched by ``make_base.py``
# --- END OF CUSTOM SECTION ---
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
pytest
pooch
Loading