Skip to content

Commit

Permalink
Merge pull request #136 from scipp/update_to_scipp0.15
Browse files Browse the repository at this point in the history
Update to scippneutron=0.8
  • Loading branch information
nvaytet authored Aug 4, 2022
2 parents 8475ee9 + 0903261 commit 4a16288
Show file tree
Hide file tree
Showing 19 changed files with 92 additions and 103 deletions.
80 changes: 41 additions & 39 deletions .buildconfig/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)

# This file was autogenerated using:
# - conda create -f environment.yml
# - conda env create -f environment.yml
# - conda activate ess-developer
# - conda env export --no-builds --file ci.yml

Expand All @@ -11,6 +11,7 @@ channels:
- scipp
- mantid
- conda-forge
- nodefaults
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
Expand All @@ -20,7 +21,7 @@ dependencies:
- argon2-cffi-bindings=21.2.0
- asttokens=2.0.5
- atk-1.0=2.36.0
- attrs=21.4.0
- attrs=22.1.0
- babel=2.10.3
- backcall=0.2.0
- backports=1.0
Expand All @@ -39,10 +40,10 @@ dependencies:
- cached_property=1.5.2
- cairo=1.16.0
- certifi=2022.6.15
- cffi=1.15.0
- charset-normalizer=2.0.12
- cffi=1.15.1
- charset-normalizer=2.1.0
- colorama=0.4.5
- confuse=1.7.0
- confuse=2.0.0
- cryptography=36.0.2
- curl=7.82.0
- cycler=0.11.0
Expand All @@ -54,7 +55,7 @@ dependencies:
- double-conversion=3.1.7
- eigen=3.4.0
- entrypoints=0.4
- executing=0.8.3
- executing=0.9.1
- expat=2.4.8
- ffmpeg=4.3.2
- flake8=4.0.1
Expand All @@ -66,7 +67,7 @@ dependencies:
- fontconfig=2.14.0
- fonts-conda-ecosystem=1
- fonts-conda-forge=1
- fonttools=4.33.3
- fonttools=4.34.4
- freeimage=3.18.0
- freetype=2.10.4
- fribidi=1.0.10
Expand All @@ -79,23 +80,23 @@ dependencies:
- gnutls=3.6.13
- graphite2=1.3.13
- graphlib-backport=1.0.3
- graphviz=4.0.0
- graphviz=5.0.0
- gsl=2.6
- gtk2=2.24.33
- gts=0.7.6
- h5py=3.1.0
- harfbuzz=4.3.0
- harfbuzz=5.1.0
- hdf4=4.2.15
- hdf5=1.10.6
- icu=70.1
- idna=3.3
- imagesize=1.3.0
- imagesize=1.4.1
- imath=3.1.5
- importlib-metadata=4.11.4
- importlib_resources=5.8.0
- importlib_resources=5.9.0
- iniconfig=1.1.1
- ipydatawidgets=4.3.1.post1
- ipykernel=6.15.0
- ipykernel=6.15.1
- ipympl=0.9.1
- ipython=8.4.0
- ipython_genutils=0.2.0
Expand All @@ -104,19 +105,19 @@ dependencies:
- jinja2=3.1.2
- jpeg=9e
- jsoncpp=1.9.4
- jsonschema=4.6.0
- jsonschema=4.9.0
- jupyter_client=7.3.4
- jupyter_core=4.10.0
- jupyter_core=4.11.1
- jupyterlab_pygments=0.2.2
- jupyterlab_widgets=1.1.1
- jxrlib=1.1
- keyutils=1.6.1
- kiwisolver=1.4.3
- kiwisolver=1.4.4
- krb5=1.19.3
- lame=3.100
- lcms2=2.12
- ld_impl_linux-64=2.36.1
- lerc=3.0
- lerc=4.0.0
- libblas=3.9.0
- libbrotlicommon=1.0.9
- libbrotlidec=1.0.9
Expand All @@ -132,7 +133,7 @@ dependencies:
- libgd=2.3.3
- libgfortran-ng=12.1.0
- libgfortran5=12.1.0
- libglib=2.70.2
- libglib=2.72.1
- libglu=9.0.0
- libgomp=12.1.0
- libgpg-error=1.45
Expand All @@ -149,7 +150,7 @@ dependencies:
- libpng=1.6.37
- libraw=0.20.2
- librdkafka=1.8.2.post2
- librsvg=2.54.3
- librsvg=2.54.4
- libsodium=1.0.18
- libssh2=1.10.0
- libstdcxx-ng=12.1.0
Expand All @@ -158,8 +159,8 @@ dependencies:
- libtool=2.4.6
- libuuid=2.32.1
- libvorbis=1.3.7
- libwebp=1.2.2
- libwebp-base=1.2.2
- libwebp=1.2.3
- libwebp-base=1.2.3
- libxcb=1.13
- libxml2=2.9.14
- libzip=1.8.0
Expand All @@ -174,7 +175,7 @@ dependencies:
- mistune=0.8.4
- munkres=1.1.4
- muparser=2.3.2
- nbclient=0.6.4
- nbclient=0.6.6
- nbconvert=6.5.0
- nbconvert-core=6.5.0
- nbconvert-pandoc=6.5.0
Expand All @@ -194,14 +195,15 @@ dependencies:
- packaging=21.3
- pandoc=2.18
- pandocfilters=1.5.0
- pango=1.50.7
- pango=1.50.8
- parso=0.8.3
- pcre=8.45
- pexpect=4.8.0
- pickleshare=0.7.5
- pillow=9.1.1
- pip=22.1.2
- pillow=9.2.0
- pip=22.2.1
- pixman=0.40.0
- pkgutil-resolve-name=1.3.10
- pluggy=1.0.0
- poco=1.11.1
- pooch=1.6.0
Expand All @@ -226,25 +228,25 @@ dependencies:
- pytest=7.1.2
- python=3.8.12
- python-dateutil=2.8.2
- python-fastjsonschema=2.15.3
- python-graphviz=0.20
- python-fastjsonschema=2.16.1
- python-graphviz=0.20.1
- python_abi=3.8
- pythreejs=2.3.0
- pytz=2022.1
- pyyaml=6.0
- pyzmq=23.2.0
- rapidjson=1.1.0
- readline=8.1.2
- requests=2.28.0
- scipp=0.14.0
- scippneutron=0.7.0
- scippnexus=0.1.4
- scipy=1.8.1
- requests=2.28.1
- scipp=0.15.1
- scippneutron=0.8.0
- scippnexus=0.1.7
- scipy=1.9.0
- send2trash=1.8.0
- setuptools=62.6.0
- setuptools=63.3.0
- six=1.16.0
- snowballstemmer=2.2.0
- soupsieve=2.3.1
- soupsieve=2.3.2.post1
- sphinx=4.5.0
- sphinx-book-theme=0.2.0
- sphinx-copybutton=0.5.0
Expand All @@ -254,20 +256,20 @@ dependencies:
- sphinxcontrib-jsmath=1.0.1
- sphinxcontrib-qthelp=1.0.3
- sphinxcontrib-serializinghtml=1.1.5
- sqlite=3.39.0
- sqlite=3.39.2
- stack_data=0.3.0
- tbb=2020.2
- tbb-devel=2020.2
- terminado=0.15.0
- tinycss2=1.1.1
- tk=8.6.12
- tomli=2.0.1
- tornado=6.1
- tornado=6.2
- traitlets=5.3.0
- traittypes=0.2.1
- unicodedata2=14.0.0
- unixodbc=2.3.10
- urllib3=1.26.9
- urllib3=1.26.11
- utfcpp=3.2.1
- vtk=9.0.1
- wcwidth=0.2.5
Expand All @@ -291,10 +293,10 @@ dependencies:
- yaml=0.2.5
- yapf=0.32.0
- zeromq=4.3.4
- zipp=3.8.0
- zipp=3.8.1
- zlib=1.2.12
- zstd=1.5.2
- pip:
- nb-clean==2.1.0
- orsopy==1.0.0
- sphinx-autodoc-typehints==1.18.3
- orsopy==1.0.1
- sphinx-autodoc-typehints==1.19.1
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
# The master toctree document.
master_doc = 'index'

# Turn warnings into errors
warning_is_error = True

exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']

# The name of the Pygments (syntax highlighting) style to use.
Expand Down
3 changes: 1 addition & 2 deletions docs/instruments/amor/amor_reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,7 @@
"theta_edges = sc.linspace(dim='theta', start=0.0, stop=1.2, num=nbins, unit='deg')\n",
"wavelength_edges = sc.linspace(dim='wavelength', start=0, stop=15.0,\n",
" num=nbins, unit='angstrom')\n",
"binned = sc.bin(sample_theta,\n",
" edges=[sc.to_unit(theta_edges, 'rad'), wavelength_edges])\n",
"binned = sample_theta.bin(theta=theta_edges.to(unit='rad'), wavelength=wavelength_edges)\n",
"binned"
]
},
Expand Down
5 changes: 2 additions & 3 deletions docs/instruments/external/powgen/powgen_reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@
},
"outputs": [],
"source": [
"sample = sc.bin(sample, edges=[\n",
" sc.array(dims=['tof'], values=[0.0, 16666.67], unit='us')\n",
"])"
"sample = sample.bin(\n",
" tof=sc.array(dims=['tof'], values=[0.0, 16666.67], unit='us'))"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/instruments/loki/sans2d_reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"\n",
"binned = sc.Dataset()\n",
"for key in ds:\n",
" binned[key] = sc.bin(ds[key], edges=[tof_masked_region])\n",
" binned[key] = ds[key].bin(tof=tof_masked_region)\n",
" binned[key].masks['bragg_peaks'] = sc.array(dims=['tof'], values=[False, True, False])\n",
"binned"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/instruments/loki/sans2d_to_I_of_Q.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
" mask_tof_min, mask_tof_max,\n",
" sample.coords['tof']['tof', -1]], dim='tof')\n",
"\n",
"sample = sc.bin(sample, edges=[tof_masked_region])\n",
"sample = sample.bin(tof=tof_masked_region)\n",
"sample.masks['bragg_peaks'] = sc.array(dims=['tof'], values=[False, True, False])\n",
"sample"
]
Expand Down
28 changes: 10 additions & 18 deletions docs/techniques/wfm/reducing-wfm-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
" unit=sc.units.counts, with_variances=True),\n",
" coords={\n",
" 'time': sc.array(dims=['time'], values=item[\"valid_times\"], unit=sc.units.us)})\n",
" ds[key] = sc.histogram(da, bins=time_coord)\n",
" ds[key] = da.hist(time=time_coord)\n",
"\n",
"ds"
]
Expand Down Expand Up @@ -635,7 +635,7 @@
" unit=sc.units.counts, with_variances=True),\n",
" coords={\n",
" 'tof': sc.array(dims=['tof'], values=item[\"arrival_times\"].values, unit=sc.units.us)})\n",
" ds_no_wfm[key] = sc.histogram(da, bins=time_coord_no_wfm)\n",
" ds_no_wfm[key] = da.hist(tof=time_coord_no_wfm)\n",
"\n",
"ds_no_wfm"
]
Expand Down Expand Up @@ -777,7 +777,7 @@
" with_variances=True),\n",
" coords={\n",
" 'time': sc.array(dims=['event'], values=item[\"valid_times\"], unit=sc.units.us)})\n",
" ds_event[key] = sc.bin(da, edges=[time_coord])\n",
" ds_event[key] = da.bin(time=time_coord)\n",
"\n",
"ds_event"
]
Expand Down Expand Up @@ -815,7 +815,7 @@
"metadata": {},
"outputs": [],
"source": [
"sc.plot(ds_event.bins.sum())"
"sc.plot(ds_event.hist())"
]
},
{
Expand Down Expand Up @@ -853,17 +853,11 @@
{
"cell_type": "code",
"execution_count": null,
"id": "bab0141b",
"id": "a9b9f757-05f9-4566-bc5a-f67a7549332f",
"metadata": {},
"outputs": [],
"source": [
"sc.plot(sc.histogram(stitched_event,\n",
" bins=sc.linspace(\n",
" dim='tof',\n",
" start=stitched_event.coords['tof']['tof', 0].value,\n",
" stop=stitched_event.coords['tof']['tof', -1].value,\n",
" num=257,\n",
" unit=stitched_event.coords['tof'].unit)))"
"sc.plot({key: item.hist(tof=256) for key, item in stitched_event.items()})"
]
},
{
Expand All @@ -881,8 +875,8 @@
"metadata": {},
"outputs": [],
"source": [
"rebinned = sc.bin(stitched_event[\"sample\"], edges=[stitched[\"sample\"].coords['tof']])\n",
"sc.plot({\"events\": rebinned.bins.sum(), \"histogram\": stitched[\"sample\"]}, errorbars=False)"
"rebinned = stitched_event[\"sample\"].bin(tof=stitched[\"sample\"].coords['tof'])\n",
"sc.plot({\"events\": rebinned.hist(), \"histogram\": stitched[\"sample\"]}, errorbars=False)"
]
},
{
Expand Down Expand Up @@ -913,8 +907,7 @@
"outputs": [],
"source": [
"# Normalizing binned data is done using the sc.lookup helper\n",
"hist = sc.histogram(\n",
" converted_event[\"vanadium\"], bins=converted[\"sample\"].coords['wavelength'])\n",
"hist = converted_event[\"vanadium\"].hist(wavelength=converted[\"sample\"].coords['wavelength'])\n",
"normalized_event = converted_event[\"sample\"].bins / sc.lookup(func=hist, dim='wavelength')"
]
},
Expand All @@ -933,8 +926,7 @@
"metadata": {},
"outputs": [],
"source": [
"to_plot = sc.bin(normalized_event,\n",
" edges=[converted[\"sample\"].coords['wavelength']]).bins.sum()\n",
"to_plot = normalized_event.bin(wavelength=converted[\"sample\"].coords['wavelength']).hist()\n",
"sc.plot({\"stitched_event\": to_plot, \"original\": original})"
]
},
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- pytest
- pythreejs
- python-graphviz
- scippneutron>=0.7
- scippneutron>=0.8
- sphinx
- sphinx-book-theme=0.2 # custom buttons in top bar do not work with version 0.3
- sphinx-copybutton
Expand Down
Loading

0 comments on commit 4a16288

Please sign in to comment.