Skip to content

Commit

Permalink
Merge pull request #591 from scipp/metadata-util
Browse files Browse the repository at this point in the history
Add metadata utililites
  • Loading branch information
jl-wynen authored Feb 7, 2025
2 parents a6065d7 + 22484e8 commit e497870
Show file tree
Hide file tree
Showing 23 changed files with 3,590 additions and 96 deletions.
3 changes: 3 additions & 0 deletions .buildconfig/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ channels:
- scipp
- nodefaults
dependencies:
- email-validator==2.2.0
- h5py==3.12.1
- hypothesis==6.119.4
- ipykernel==6.29.5
Expand All @@ -20,8 +21,10 @@ dependencies:
- mpltoolbox==24.05.1
- plopp==24.10.0
- pooch==1.8.2
- pydantic==2.10.5
- pytest==8.3.3
- pytest-asyncio==0.24.0
- python-dateutil==2.9.0
- python-graphviz==0.20.3
- pythreejs==2.4.2
- scipp==24.11.1
Expand Down
45 changes: 45 additions & 0 deletions Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "0",
"metadata": {},
"outputs": [],
"source": [
"import scipp as sc"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"source": [
"sc.data.table_xyz(10)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
17 changes: 17 additions & 0 deletions docs/_templates/model-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
1 change: 1 addition & 0 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ and possible confusion of `theta` (from Bragg’s law) with `theta` in spherical
conversion
io
logging
metadata
peaks
tof
```
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ dynamic = ["version"]
# Run 'tox -e deps' after making changes here. This will update requirement files.
# Make sure to list one dependency per line.
dependencies = [
"lazy_loader",
"python-dateutil",
"email-validator>=2",
"h5py",
"lazy_loader",
"mpltoolbox",
"numpy>=1.20",
"plopp>=24.09.1",
"pydantic>=2",
"scipp>=23.07.0",
"scippnexus>=23.11.0",
"scipy>=1.7.0",
Expand Down Expand Up @@ -151,6 +154,7 @@ enable_error_code = [
"truthy-bool",
]
warn_unreachable = true
plugins = ["pydantic.mypy"]

[tool.codespell]
ignore-words-list = [
Expand Down
5 changes: 4 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
# will not be touched by ``make_base.py``
# --- END OF CUSTOM SECTION ---
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
lazy_loader
python-dateutil
email-validator>=2
h5py
lazy_loader
mpltoolbox
numpy>=1.20
plopp>=24.09.1
pydantic>=2
scipp>=23.07.0
scippnexus>=23.11.0
scipy>=1.7.0
21 changes: 19 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# SHA1:0d828cbacfc7cf912a961c413fba99e70fc9dde0
# SHA1:a27fe80e794a66dbedb9ec12032e8412ba2163b8
#
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile-multi
#
annotated-types==0.7.0
# via pydantic
contourpy==1.3.1
# via matplotlib
cycler==0.12.1
# via matplotlib
fonttools==4.55.6
dnspython==2.7.0
# via email-validator
email-validator==2.2.0
# via -r base.in
fonttools==4.55.8
# via matplotlib
h5py==3.12.1
# via
# -r base.in
# scippnexus
idna==3.10
# via email-validator
kiwisolver==1.4.8
# via matplotlib
lazy-loader==0.4
Expand Down Expand Up @@ -42,10 +50,15 @@ pillow==11.1.0
# via matplotlib
plopp==24.10.0
# via -r base.in
pydantic==2.10.6
# via -r base.in
pydantic-core==2.27.2
# via pydantic
pyparsing==3.2.1
# via matplotlib
python-dateutil==2.9.0.post0
# via
# -r base.in
# matplotlib
# scippnexus
scipp==25.2.0
Expand All @@ -60,3 +73,7 @@ scipy==1.15.1
# scippnexus
six==1.17.0
# via python-dateutil
typing-extensions==4.12.2
# via
# pydantic
# pydantic-core
8 changes: 4 additions & 4 deletions requirements/basetest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ attrs==25.1.0
# via hypothesis
brille==0.8.0
# via pace-neutrons
certifi==2024.12.14
certifi==2025.1.31
# via requests
charset-normalizer==3.4.1
# via requests
Expand Down Expand Up @@ -42,11 +42,11 @@ flexcache==0.3
# via pint
flexparser==0.4
# via pint
fonttools==4.55.6
fonttools==4.55.8
# via matplotlib
h5py==3.12.1
# via euphonic
hypothesis==6.124.7
hypothesis==6.125.2
# via -r basetest.in
idna==3.10
# via requests
Expand All @@ -56,7 +56,7 @@ ipydatawidgets==4.3.5
# via pythreejs
ipympl==0.9.6
# via -r basetest.in
ipython==8.31.0
ipython==8.32.0
# via
# ipympl
# ipywidgets
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
cachetools==5.5.1
# via tox
certifi==2024.12.14
certifi==2025.1.31
# via requests
chardet==5.2.0
# via tox
Expand Down
10 changes: 2 additions & 8 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
-r static.txt
-r test.txt
-r wheels.txt
annotated-types==0.7.0
# via pydantic
anyio==4.8.0
# via
# httpx
Expand Down Expand Up @@ -59,7 +57,7 @@ jsonschema[format-nongpl]==4.23.0
# jupyter-events
# jupyterlab-server
# nbformat
jupyter-events==0.11.0
jupyter-events==0.12.0
# via jupyter-server
jupyter-lsp==2.2.5
# via jupyterlab
Expand All @@ -71,7 +69,7 @@ jupyter-server==2.15.0
# notebook-shim
jupyter-server-terminals==0.5.3
# via jupyter-server
jupyterlab==4.3.4
jupyterlab==4.3.5
# via -r dev.in
jupyterlab-server==2.27.3
# via jupyterlab
Expand All @@ -91,10 +89,6 @@ prometheus-client==0.21.1
# via jupyter-server
pycparser==2.22
# via cffi
pydantic==2.10.6
# via copier
pydantic-core==2.27.2
# via pydantic
python-json-logger==3.2.1
# via jupyter-events
questionary==2.1.0
Expand Down
24 changes: 8 additions & 16 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ attrs==25.1.0
# via
# jsonschema
# referencing
babel==2.16.0
babel==2.17.0
# via
# pydata-sphinx-theme
# sphinx
beautifulsoup4==4.12.3
beautifulsoup4==4.13.3
# via
# nbconvert
# pydata-sphinx-theme
bleach[css]==6.2.0
# via nbconvert
certifi==2024.12.14
certifi==2025.1.31
# via requests
charset-normalizer==3.4.1
# via requests
Expand Down Expand Up @@ -54,8 +54,6 @@ executing==2.2.0
# via stack-data
fastjsonschema==2.21.1
# via nbformat
idna==3.10
# via requests
imagesize==1.4.1
# via sphinx
importlib-resources==6.5.2
Expand All @@ -64,7 +62,7 @@ ipykernel==6.29.5
# via -r docs.in
ipympl==0.9.6
# via -r docs.in
ipython==8.31.0
ipython==8.32.0
# via
# -r docs.in
# ipykernel
Expand Down Expand Up @@ -117,13 +115,13 @@ mdit-py-plugins==0.4.2
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
mistune==3.1.0
mistune==3.1.1
# via nbconvert
myst-parser==4.0.0
# via -r docs.in
nbclient==0.10.2
# via nbconvert
nbconvert==7.16.5
nbconvert==7.16.6
# via nbsphinx
nbformat==5.10.4
# via
Expand Down Expand Up @@ -173,7 +171,7 @@ pyyaml==6.0.2
# via
# myst-parser
# pybtex
pyzmq==26.2.0
pyzmq==26.2.1
# via
# ipykernel
# jupyter-client
Expand Down Expand Up @@ -227,7 +225,7 @@ stack-data==0.6.3
# via ipython
tinycss2==1.4.0
# via bleach
tof==25.1.2
tof==25.2.0
# via -r docs.in
tomli==2.2.1
# via sphinx
Expand All @@ -249,12 +247,6 @@ traitlets==5.14.3
# nbconvert
# nbformat
# nbsphinx
typing-extensions==4.12.2
# via
# ipython
# mistune
# pydata-sphinx-theme
# referencing
urllib3==2.3.0
# via requests
wcwidth==0.2.13
Expand Down
2 changes: 1 addition & 1 deletion requirements/mypy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# pip-compile-multi
#
-r test.txt
mypy==1.14.1
mypy==1.15.0
# via -r mypy.in
mypy-extensions==1.0.0
# via mypy
5 changes: 4 additions & 1 deletion requirements/nightly.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

# --- END OF CUSTOM SECTION ---
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
lazy_loader
python-dateutil
email-validator>=2
h5py
lazy_loader
numpy>=1.20
pydantic>=2
scipy>=1.7.0
hypothesis
ipympl
Expand Down
Loading

0 comments on commit e497870

Please sign in to comment.