Skip to content

Commit 6c57ffc

Browse files
authored
lower bound scippnexus + copier update + tox -e deps (#82)
* copier update + tox -e deps * fix: ignore warning because test files are broken
1 parent 9c7e949 commit 6c57ffc

30 files changed

+151
-75
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: 101e594
2+
_commit: a052529
33
_src_path: gh:scipp/copier_template
44
description: Reflectometry data reduction for the European Spallation Source
55
max_python: '3.12'

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: pre-commit/[email protected]
2828
with:
2929
extra_args: --all-files
30-
- uses: pre-commit-ci/[email protected].2
30+
- uses: pre-commit-ci/[email protected].3
3131
if: always()
3232
with:
3333
msg: Apply automatic formatting

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
name: docs_html
7070
path: html/
7171

72-
- uses: JamesIves/[email protected].3
72+
- uses: JamesIves/[email protected].4
7373
if: ${{ inputs.publish }}
7474
with:
7575
branch: gh-pages

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ on:
4141
type: string
4242

4343
jobs:
44+
package-test:
45+
runs-on: ${{ inputs.os-variant }}
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
ref: ${{ inputs.checkout_ref }}
51+
- uses: actions/setup-python@v5
52+
with:
53+
python-version: ${{ inputs.python-version }}
54+
- run: python -m pip install --upgrade pip
55+
- run: python -m pip install .
56+
- run: python tests/package_test.py
57+
name: Run package tests
58+
4459
test:
4560
runs-on: ${{ inputs.os-variant }}
4661
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ dist
44
html
55
.tox
66
*.egg-info
7+
uv.lock # we lock dependencies with pip-compile, not uv
78

89
*.sw?
910

1011
# Environments
1112
venv
13+
.venv
1214

1315
# Caches
1416
.clangd/
@@ -39,3 +41,4 @@ docs/generated/
3941
*.cif
4042
*.rcif
4143
*.ort
44+
*.zip

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v4.6.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-json
@@ -14,22 +14,22 @@ repos:
1414
args: [ --markdown-linebreak-ext=md ]
1515
exclude: '\.svg'
1616
- repo: https://github.com/kynan/nbstripout
17-
rev: 0.6.0
17+
rev: 0.7.1
1818
hooks:
1919
- id: nbstripout
2020
types: [ "jupyter" ]
2121
args: [ "--drop-empty-cells",
2222
"--extra-keys 'metadata.language_info.version cell.metadata.jp-MarkdownHeadingCollapsed cell.metadata.pycharm'" ]
2323
- repo: https://github.com/astral-sh/ruff-pre-commit
24-
rev: v0.4.3
24+
rev: v0.6.2
2525
hooks:
2626
- id: ruff
2727
args: [ --fix ]
2828
types_or: [ python, pyi, jupyter ]
2929
- id: ruff-format
3030
types_or: [ python, pyi ]
3131
- repo: https://github.com/codespell-project/codespell
32-
rev: v2.2.6
32+
rev: v2.3.0
3333
hooks:
3434
- id: codespell
3535
additional_dependencies:

conda/meta.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ source:
99

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

1314

1415
requirements:
@@ -29,8 +30,12 @@ test:
2930
- ess.reflectometry
3031
- ess.amor
3132
requires:
32-
- pytest
33-
- pooch
33+
34+
{# Conda does not allow spaces between package name and version, so remove them #}
35+
{% for package in test_dependencies %}
36+
- {% if package == "graphviz" %}python-graphviz{% else %}{{ package|replace(" ", "") }}{% endif %}
37+
{% endfor %}
38+
3439
source_files:
3540
- pyproject.toml
3641
- tests/

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2024 Scipp contributors (https://github.com/scipp)
3+
14
import doctest
25
import os
36
import sys

docs/user-guide/amor/compare-to-eos.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "b97647a4-29ab-45a3-870e-aa49fbddb0c5",
5+
"id": "0",
66
"metadata": {},
77
"source": [
88
"# Comparison with PSI reduction software\n",
@@ -14,7 +14,7 @@
1414
{
1515
"cell_type": "code",
1616
"execution_count": null,
17-
"id": "9aaa5e0c-def6-4da5-9f63-b4c72a0de8f1",
17+
"id": "1",
1818
"metadata": {},
1919
"outputs": [],
2020
"source": [
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"cell_type": "markdown",
34-
"id": "f9f28ab3-b9fd-4cfd-88bd-d290ea5cdf4f",
34+
"id": "2",
3535
"metadata": {},
3636
"source": [
3737
"## Recreate reference files using Jochens Amor data reduction software\n",
@@ -60,7 +60,7 @@
6060
},
6161
{
6262
"cell_type": "markdown",
63-
"id": "a1d7fc35-d958-44ce-83a5-b8d877c47735",
63+
"id": "3",
6464
"metadata": {},
6565
"source": [
6666
"## Run essreflectometry on the same files"
@@ -69,7 +69,7 @@
6969
{
7070
"cell_type": "code",
7171
"execution_count": null,
72-
"id": "fccf8385-b2ec-4c14-990f-9083a89f46a2",
72+
"id": "4",
7373
"metadata": {},
7474
"outputs": [],
7575
"source": [
@@ -103,7 +103,7 @@
103103
{
104104
"cell_type": "code",
105105
"execution_count": null,
106-
"id": "5a220b29-5115-4594-9c75-ed0f34be74f7",
106+
"id": "5",
107107
"metadata": {},
108108
"outputs": [],
109109
"source": [
@@ -132,7 +132,7 @@
132132
{
133133
"cell_type": "code",
134134
"execution_count": null,
135-
"id": "9311bc67-6edf-4f90-9280-f4bee8df9da3",
135+
"id": "6",
136136
"metadata": {},
137137
"outputs": [],
138138
"source": [
@@ -147,7 +147,7 @@
147147
},
148148
{
149149
"cell_type": "markdown",
150-
"id": "64b685cb-654e-46a5-9eae-b9bf76dadb8d",
150+
"id": "7",
151151
"metadata": {},
152152
"source": [
153153
"## Plot reflectivity curve comparison"
@@ -156,7 +156,7 @@
156156
{
157157
"cell_type": "code",
158158
"execution_count": null,
159-
"id": "8e248ada-0db0-4e9e-a208-64e2ff74c7bb",
159+
"id": "8",
160160
"metadata": {},
161161
"outputs": [],
162162
"source": [
@@ -181,7 +181,7 @@
181181
},
182182
{
183183
"cell_type": "markdown",
184-
"id": "9d97eff4-77cf-4ea1-8be7-1390bebfcb84",
184+
"id": "9",
185185
"metadata": {},
186186
"source": [
187187
"## Overlay curves from same sample at different angle, should be on top of each other"
@@ -190,7 +190,7 @@
190190
{
191191
"cell_type": "code",
192192
"execution_count": null,
193-
"id": "4758e245-c47a-454c-9788-97b05b49f356",
193+
"id": "10",
194194
"metadata": {},
195195
"outputs": [],
196196
"source": [

pyproject.toml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,18 @@ dependencies = [
3939
"sciline>=24.6.0",
4040
"scipp>=24.09.1", # Fixed new hist/bin API
4141
"scippneutron>=24.7.0",
42+
"scippnexus>=24.9.1",
4243
"essreduce",
4344
]
4445

4546
dynamic = ["version"]
4647

48+
[project.optional-dependencies]
49+
test = [
50+
"pytest",
51+
"pooch",
52+
]
53+
4754
[project.urls]
4855
"Bug Tracker" = "https://github.com/scipp/essreflectometry/issues"
4956
"Documentation" = "https://scipp.github.io/essreflectometry"
@@ -65,6 +72,7 @@ filterwarnings = [
6572
"error",
6673
'ignore:\n.*Sentinel is not a public part of the traitlets API.*:DeprecationWarning',
6774
"ignore:.*metadata to be logged in the data array, it is necessary to install the orsopy package.:UserWarning",
75+
"ignore:.*A transformation needs a vector attribute. Falling back to returning underlying value.:UserWarning",
6876
]
6977

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

8997
[tool.ruff.lint.per-file-ignores]
@@ -114,3 +122,11 @@ enable_error_code = [
114122
"truthy-bool",
115123
]
116124
warn_unreachable = true
125+
126+
[tool.codespell]
127+
ignore-words-list = [
128+
# Codespell wants "socioeconomic" which seems to be the standard spelling.
129+
# But we use the word in our code of conduct which is the contributor covenant.
130+
# Let's not modify it if we don't have to.
131+
"socio-economic",
132+
]

0 commit comments

Comments
 (0)