From ab9469a37b2eda35a9df2a1b97bf3513e3e6ad49 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Thu, 1 May 2025 16:56:03 +0200 Subject: [PATCH 1/4] docs: add more example files and change data fetching functions --- docs/user-guide/amor/amor-reduction.ipynb | 14 +++++------ docs/user-guide/amor/compare-to-eos.ipynb | 4 ++-- src/ess/amor/data.py | 29 ++++++++++++++++------- tests/amor/pipeline_test.py | 22 ++++++++--------- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/docs/user-guide/amor/amor-reduction.ipynb b/docs/user-guide/amor/amor-reduction.ipynb index b9495fa0..ad6f6d9a 100644 --- a/docs/user-guide/amor/amor-reduction.ipynb +++ b/docs/user-guide/amor/amor-reduction.ipynb @@ -98,7 +98,7 @@ "metadata": {}, "outputs": [], "source": [ - "workflow[Filename[ReferenceRun]] = amor.data.amor_reference_run()\n", + "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614, year=2023)\n", "# The sample rotation value in the file is slightly off, so we set it manually\n", "workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n", "\n", @@ -147,14 +147,14 @@ "metadata": {}, "outputs": [], "source": [ - "amor.data.amor_sample_run('608')" + "amor.data.amor_run('608', year='2023')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "When you encounter `amor.data.amor_sample_run` you should imagining replacing that with a path to your own dataset." + "When you encounter `amor.data.amor_run` you should imagining replacing that with a path to your own dataset." ] }, { @@ -168,19 +168,19 @@ " # The sample rotation values in the files are slightly off, so we replace\n", " # them with corrected values.\n", " SampleRotation[SampleRun]: sc.scalar(0.85, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_sample_run('608'),\n", + " Filename[SampleRun]: amor.data.amor_run('608', year='2023'),\n", " },\n", " '609': {\n", " SampleRotation[SampleRun]: sc.scalar(2.25, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_sample_run('609'),\n", + " Filename[SampleRun]: amor.data.amor_run('609', year='2023'),\n", " },\n", " '610': {\n", " SampleRotation[SampleRun]: sc.scalar(3.65, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_sample_run('610'),\n", + " Filename[SampleRun]: amor.data.amor_run('610', year='2023'),\n", " },\n", " '611': {\n", " SampleRotation[SampleRun]: sc.scalar(5.05, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_sample_run('611'),\n", + " Filename[SampleRun]: amor.data.amor_run('611', year='2023'),\n", " },\n", "}\n", "\n", diff --git a/docs/user-guide/amor/compare-to-eos.ipynb b/docs/user-guide/amor/compare-to-eos.ipynb index bbbf3ca7..eeae2095 100644 --- a/docs/user-guide/amor/compare-to-eos.ipynb +++ b/docs/user-guide/amor/compare-to-eos.ipynb @@ -97,7 +97,7 @@ "workflow[ChopperPhase[ReferenceRun]] = sc.scalar(-7.5, unit='deg')\n", "# The sample rotation value in the file is slightly off, so we set it manually\n", "workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n", - "workflow[Filename[ReferenceRun]] = amor.data.amor_reference_run()\n", + "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614, year=2023)\n", "\n", "reference_result = workflow.compute(ReducedReference)\n", "# Set the result back onto the pipeline to cache it\n", @@ -126,7 +126,7 @@ "for key, angle in mu.items():\n", " print(key, '... ', end='')\n", " workflow[SampleRotation[SampleRun]] = sc.scalar(angle + 0.05, unit='deg')\n", - " workflow[Filename[SampleRun]] = amor.data.amor_sample_run(key)\n", + " workflow[Filename[SampleRun]] = amor.data.amor_sample_run(key, year=2023)\n", " da = workflow.compute(ReflectivityOverQ).hist()\n", " da.coords['Q'] = sc.midpoints(da.coords['Q'], dim='Q')\n", " results['ess'][key] = da\n", diff --git a/src/ess/amor/data.py b/src/ess/amor/data.py index aefa5b23..02ba51e7 100644 --- a/src/ess/amor/data.py +++ b/src/ess/amor/data.py @@ -50,6 +50,24 @@ def _make_pooch(): "611.Rqz.ort": "md5:0c51e8ac5c00041434417673be186151", "612.Rqz.ort": "md5:d785d27151e7f1edc05e86d35bef6a63", "613.Rqz.ort": "md5:e999c85f7a47665c4ddd1538b19d402d", + "amor2024n001632.hdf": "md5:2253f0ec6d2e96a986a6aa35d43a7480", + "amor2024n001634.hdf": "md5:7cdd87bbd96fb3fb1e046800a9b1d77e", + "amor2024n001635.hdf": "md5:fb9eb0e7b803c13f1804d085b3b0058f", + "amor2024n001636.hdf": "md5:f7deb51d22652d1f5d0e4b51927af5a3", + "amor2024n001637.hdf": "md5:06e5957d34d82035cfece40cbbf47d7a", + "amor2024n001638.hdf": "md5:1193fe808af2afeb0f48d3b0022fe40b", + "amor2024n001639.hdf": "md5:ff24e31a07c4020927aaa6df9f2ee05f", + "amor2024n001640.hdf": "md5:051335fea1c369322a2328d530dedb77", + "amor2024n001641.hdf": "md5:d543b5890b63707cf8d7f6666e8830a4", + "amor2024n001642.hdf": "md5:b1474e32cc64371e1005f44f2c5b6ae7", + "amor2024n004079.hdf": "md5:5bf1dabc2ff902a57ed7593903c8e1a5", + "amor2024n004080.hdf": "md5:7dcaa5da00b7eedc178b9e55209bfbce", + "amor2024n004081.hdf": "md5:2f4f46f0e56ab75aad0c2933060df504", + "amor2024n004083.hdf": "md5:ffd13420e44cbf966b94bd532e293c1c", + "amor2024n004084.hdf": "md5:5041a9486b3cd6407a9b9f44104c9b54", + "amor2024n004085.hdf": "md5:152ac63bad6f3b2b5cf1c4e4c7df5e30", + "amor2024n004152.hdf": "md5:244459be7a3caeac523c289815c5b7dc", + "amor2024n004154.hdf": "md5:6184553f795fd2b230baab9a421da9e4", }, ) @@ -65,12 +83,8 @@ def amor_old_reference_run() -> Filename[ReferenceRun]: return Filename[ReferenceRun](_pooch.fetch("reference.nxs")) -def amor_reference_run() -> Filename[ReferenceRun]: - return Filename[ReferenceRun](_pooch.fetch("amor2023n000614.hdf")) - - -def amor_sample_run(number: int | str) -> Filename[SampleRun]: - return Filename[SampleRun](_pooch.fetch(f"amor2023n{int(number):06d}.hdf")) +def amor_run(number: int | str, year: int | str = 2024) -> Filename[SampleRun]: + return Filename[SampleRun](_pooch.fetch(f"amor{year}n{int(number):06d}.hdf")) def amor_psi_software_result(number: int | str) -> Filename[SampleRun]: @@ -79,6 +93,5 @@ def amor_psi_software_result(number: int | str) -> Filename[SampleRun]: __all__ = [ "amor_psi_software_result", - "amor_reference_run", - "amor_sample_run", + "amor_run", ] diff --git a/tests/amor/pipeline_test.py b/tests/amor/pipeline_test.py index 2caedfca..4c6fa87b 100644 --- a/tests/amor/pipeline_test.py +++ b/tests/amor/pipeline_test.py @@ -48,7 +48,7 @@ def amor_pipeline() -> sciline.Pipeline: ) # The sample rotation value in the file is slightly off, so we set it manually pl[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit="deg") - pl[Filename[ReferenceRun]] = amor.data.amor_reference_run() + pl[Filename[ReferenceRun]] = amor.data.amor_run(614, year=2023) pl[orso.OrsoCreator] = orso.OrsoCreator( fileio.base.Person( @@ -65,7 +65,7 @@ def amor_pipeline() -> sciline.Pipeline: def test_has_expected_coordinates(amor_pipeline: sciline.Pipeline): # The sample rotation value in the file is slightly off, so we set it manually amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_sample_run(608) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) reflectivity_over_q = amor_pipeline.compute(ReflectivityOverQ) assert "Q" in reflectivity_over_q.coords assert "Q_resolution" in reflectivity_over_q.coords @@ -76,7 +76,7 @@ def test_has_expected_coordinates(amor_pipeline: sciline.Pipeline): def test_pipeline_no_gravity_correction(amor_pipeline: sciline.Pipeline): # The sample rotation value in the file is slightly off, so we set it manually amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_sample_run(608) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) amor_pipeline[amor.types.GravityToggle] = False reflectivity_over_q = amor_pipeline.compute(ReflectivityOverQ) assert "Q" in reflectivity_over_q.coords @@ -88,7 +88,7 @@ def test_pipeline_no_gravity_correction(amor_pipeline: sciline.Pipeline): def test_orso_pipeline(amor_pipeline: sciline.Pipeline): # The sample rotation value in the file is slightly off, so we set it manually amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_sample_run(608) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) res = amor_pipeline.compute(orso.OrsoIofQDataset) assert res.info.data_source.experiment.instrument == "Amor" assert res.info.reduction.software.name == "ess.reflectometry" @@ -109,7 +109,7 @@ def test_save_reduced_orso_file(amor_pipeline: sciline.Pipeline, output_folder: from orsopy import fileio amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_sample_run(608) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) res = amor_pipeline.compute(orso.OrsoIofQDataset) fileio.orso.save_orso(datasets=[res], fname=output_folder / 'amor_reduced_iofq.ort') @@ -120,8 +120,8 @@ def test_pipeline_can_compute_reflectivity_merging_events_from_multiple_runs( amor_pipeline: sciline.Pipeline, ): sample_runs = [ - amor.data.amor_sample_run(608), - amor.data.amor_sample_run(609), + amor.data.amor_run(608, year=2023), + amor.data.amor_run(609, year=2023), ] pipeline = with_filenames(amor_pipeline, SampleRun, sample_runs) pipeline[SampleRotation[SampleRun]] = pipeline.compute( @@ -135,7 +135,7 @@ def test_pipeline_can_compute_reflectivity_merging_events_from_multiple_runs( @pytest.mark.filterwarnings("ignore:Invalid transformation, missing attribute") def test_pipeline_merging_events_result_unchanged(amor_pipeline: sciline.Pipeline): sample_runs = [ - amor.data.amor_sample_run(608), + amor.data.amor_run(608, year=2023), ] pipeline = with_filenames(amor_pipeline, SampleRun, sample_runs) pipeline[SampleRotation[SampleRun]] = pipeline.compute( @@ -143,8 +143,8 @@ def test_pipeline_merging_events_result_unchanged(amor_pipeline: sciline.Pipelin ) + sc.scalar(0.05, unit="deg") result = pipeline.compute(ReflectivityOverQ).hist() sample_runs = [ - amor.data.amor_sample_run(608), - amor.data.amor_sample_run(608), + amor.data.amor_run(608, year=2023), + amor.data.amor_run(608, year=2023), ] pipeline = with_filenames(amor_pipeline, SampleRun, sample_runs) pipeline[SampleRotation[SampleRun]] = pipeline.compute( @@ -162,7 +162,7 @@ def test_pipeline_merging_events_result_unchanged(amor_pipeline: sciline.Pipelin @pytest.mark.filterwarnings("ignore:Failed to convert .* into a transformation") @pytest.mark.filterwarnings("ignore:Invalid transformation, missing attribute") def test_proton_current(amor_pipeline: sciline.Pipeline): - amor_pipeline[Filename[SampleRun]] = amor.data.amor_sample_run(611) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(611, year=2023) da_without_proton_current = amor_pipeline.compute(ReducibleData[SampleRun]) proton_current = [1, 2, 0.1] From 86193489b089970b7f76183909f724f8242f559e Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Fri, 2 May 2025 10:06:04 +0200 Subject: [PATCH 2/4] fix: remove year --- docs/user-guide/amor/amor-reduction.ipynb | 12 ++++++------ docs/user-guide/amor/compare-to-eos.ipynb | 4 ++-- src/ess/amor/data.py | 12 ++++++++++-- tests/amor/pipeline_test.py | 22 +++++++++++----------- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/docs/user-guide/amor/amor-reduction.ipynb b/docs/user-guide/amor/amor-reduction.ipynb index ad6f6d9a..a003e2f6 100644 --- a/docs/user-guide/amor/amor-reduction.ipynb +++ b/docs/user-guide/amor/amor-reduction.ipynb @@ -98,7 +98,7 @@ "metadata": {}, "outputs": [], "source": [ - "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614, year=2023)\n", + "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n", "# The sample rotation value in the file is slightly off, so we set it manually\n", "workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n", "\n", @@ -147,7 +147,7 @@ "metadata": {}, "outputs": [], "source": [ - "amor.data.amor_run('608', year='2023')" + "amor.data.amor_run('608')" ] }, { @@ -168,19 +168,19 @@ " # The sample rotation values in the files are slightly off, so we replace\n", " # them with corrected values.\n", " SampleRotation[SampleRun]: sc.scalar(0.85, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('608', year='2023'),\n", + " Filename[SampleRun]: amor.data.amor_run('608'),\n", " },\n", " '609': {\n", " SampleRotation[SampleRun]: sc.scalar(2.25, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('609', year='2023'),\n", + " Filename[SampleRun]: amor.data.amor_run('609'),\n", " },\n", " '610': {\n", " SampleRotation[SampleRun]: sc.scalar(3.65, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('610', year='2023'),\n", + " Filename[SampleRun]: amor.data.amor_run('610'),\n", " },\n", " '611': {\n", " SampleRotation[SampleRun]: sc.scalar(5.05, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('611', year='2023'),\n", + " Filename[SampleRun]: amor.data.amor_run('611'),\n", " },\n", "}\n", "\n", diff --git a/docs/user-guide/amor/compare-to-eos.ipynb b/docs/user-guide/amor/compare-to-eos.ipynb index eeae2095..0fa4e52c 100644 --- a/docs/user-guide/amor/compare-to-eos.ipynb +++ b/docs/user-guide/amor/compare-to-eos.ipynb @@ -97,7 +97,7 @@ "workflow[ChopperPhase[ReferenceRun]] = sc.scalar(-7.5, unit='deg')\n", "# The sample rotation value in the file is slightly off, so we set it manually\n", "workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n", - "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614, year=2023)\n", + "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n", "\n", "reference_result = workflow.compute(ReducedReference)\n", "# Set the result back onto the pipeline to cache it\n", @@ -126,7 +126,7 @@ "for key, angle in mu.items():\n", " print(key, '... ', end='')\n", " workflow[SampleRotation[SampleRun]] = sc.scalar(angle + 0.05, unit='deg')\n", - " workflow[Filename[SampleRun]] = amor.data.amor_sample_run(key, year=2023)\n", + " workflow[Filename[SampleRun]] = amor.data.amor_sample_run(key)\n", " da = workflow.compute(ReflectivityOverQ).hist()\n", " da.coords['Q'] = sc.midpoints(da.coords['Q'], dim='Q')\n", " results['ess'][key] = da\n", diff --git a/src/ess/amor/data.py b/src/ess/amor/data.py index 02ba51e7..2129e383 100644 --- a/src/ess/amor/data.py +++ b/src/ess/amor/data.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2025 Scipp contributors (https://github.com/scipp) +import re from ..reflectometry.types import Filename, ReferenceRun, SampleRun @@ -83,8 +84,15 @@ def amor_old_reference_run() -> Filename[ReferenceRun]: return Filename[ReferenceRun](_pooch.fetch("reference.nxs")) -def amor_run(number: int | str, year: int | str = 2024) -> Filename[SampleRun]: - return Filename[SampleRun](_pooch.fetch(f"amor{year}n{int(number):06d}.hdf")) +def amor_run(number: int | str) -> Filename[SampleRun]: + fnames = [ + name + for name in _pooch.registry.keys() + if re.match(f'amor\\d{{4}}n{int(number):06d}.hdf', name) + ] + if len(fnames) != 1: + raise ValueError(f'Expected exactly one matching file, found {len(fnames)}') + return Filename[SampleRun](_pooch.fetch(fnames[0])) def amor_psi_software_result(number: int | str) -> Filename[SampleRun]: diff --git a/tests/amor/pipeline_test.py b/tests/amor/pipeline_test.py index 4c6fa87b..4f119eb5 100644 --- a/tests/amor/pipeline_test.py +++ b/tests/amor/pipeline_test.py @@ -48,7 +48,7 @@ def amor_pipeline() -> sciline.Pipeline: ) # The sample rotation value in the file is slightly off, so we set it manually pl[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit="deg") - pl[Filename[ReferenceRun]] = amor.data.amor_run(614, year=2023) + pl[Filename[ReferenceRun]] = amor.data.amor_run(614) pl[orso.OrsoCreator] = orso.OrsoCreator( fileio.base.Person( @@ -65,7 +65,7 @@ def amor_pipeline() -> sciline.Pipeline: def test_has_expected_coordinates(amor_pipeline: sciline.Pipeline): # The sample rotation value in the file is slightly off, so we set it manually amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608) reflectivity_over_q = amor_pipeline.compute(ReflectivityOverQ) assert "Q" in reflectivity_over_q.coords assert "Q_resolution" in reflectivity_over_q.coords @@ -76,7 +76,7 @@ def test_has_expected_coordinates(amor_pipeline: sciline.Pipeline): def test_pipeline_no_gravity_correction(amor_pipeline: sciline.Pipeline): # The sample rotation value in the file is slightly off, so we set it manually amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608) amor_pipeline[amor.types.GravityToggle] = False reflectivity_over_q = amor_pipeline.compute(ReflectivityOverQ) assert "Q" in reflectivity_over_q.coords @@ -88,7 +88,7 @@ def test_pipeline_no_gravity_correction(amor_pipeline: sciline.Pipeline): def test_orso_pipeline(amor_pipeline: sciline.Pipeline): # The sample rotation value in the file is slightly off, so we set it manually amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608) res = amor_pipeline.compute(orso.OrsoIofQDataset) assert res.info.data_source.experiment.instrument == "Amor" assert res.info.reduction.software.name == "ess.reflectometry" @@ -109,7 +109,7 @@ def test_save_reduced_orso_file(amor_pipeline: sciline.Pipeline, output_folder: from orsopy import fileio amor_pipeline[SampleRotation[SampleRun]] = sc.scalar(0.85, unit="deg") - amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608, year=2023) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608) res = amor_pipeline.compute(orso.OrsoIofQDataset) fileio.orso.save_orso(datasets=[res], fname=output_folder / 'amor_reduced_iofq.ort') @@ -120,8 +120,8 @@ def test_pipeline_can_compute_reflectivity_merging_events_from_multiple_runs( amor_pipeline: sciline.Pipeline, ): sample_runs = [ - amor.data.amor_run(608, year=2023), - amor.data.amor_run(609, year=2023), + amor.data.amor_run(608), + amor.data.amor_run(609), ] pipeline = with_filenames(amor_pipeline, SampleRun, sample_runs) pipeline[SampleRotation[SampleRun]] = pipeline.compute( @@ -135,7 +135,7 @@ def test_pipeline_can_compute_reflectivity_merging_events_from_multiple_runs( @pytest.mark.filterwarnings("ignore:Invalid transformation, missing attribute") def test_pipeline_merging_events_result_unchanged(amor_pipeline: sciline.Pipeline): sample_runs = [ - amor.data.amor_run(608, year=2023), + amor.data.amor_run(608), ] pipeline = with_filenames(amor_pipeline, SampleRun, sample_runs) pipeline[SampleRotation[SampleRun]] = pipeline.compute( @@ -143,8 +143,8 @@ def test_pipeline_merging_events_result_unchanged(amor_pipeline: sciline.Pipelin ) + sc.scalar(0.05, unit="deg") result = pipeline.compute(ReflectivityOverQ).hist() sample_runs = [ - amor.data.amor_run(608, year=2023), - amor.data.amor_run(608, year=2023), + amor.data.amor_run(608), + amor.data.amor_run(608), ] pipeline = with_filenames(amor_pipeline, SampleRun, sample_runs) pipeline[SampleRotation[SampleRun]] = pipeline.compute( @@ -162,7 +162,7 @@ def test_pipeline_merging_events_result_unchanged(amor_pipeline: sciline.Pipelin @pytest.mark.filterwarnings("ignore:Failed to convert .* into a transformation") @pytest.mark.filterwarnings("ignore:Invalid transformation, missing attribute") def test_proton_current(amor_pipeline: sciline.Pipeline): - amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(611, year=2023) + amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(611) da_without_proton_current = amor_pipeline.compute(ReducibleData[SampleRun]) proton_current = [1, 2, 0.1] From d743be605e27abab7ffcaeb09feb9917a37afc37 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Fri, 2 May 2025 10:13:06 +0200 Subject: [PATCH 3/4] fix --- docs/user-guide/amor/compare-to-eos.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/amor/compare-to-eos.ipynb b/docs/user-guide/amor/compare-to-eos.ipynb index 0fa4e52c..5f109f7a 100644 --- a/docs/user-guide/amor/compare-to-eos.ipynb +++ b/docs/user-guide/amor/compare-to-eos.ipynb @@ -126,7 +126,7 @@ "for key, angle in mu.items():\n", " print(key, '... ', end='')\n", " workflow[SampleRotation[SampleRun]] = sc.scalar(angle + 0.05, unit='deg')\n", - " workflow[Filename[SampleRun]] = amor.data.amor_sample_run(key)\n", + " workflow[Filename[SampleRun]] = amor.data.amor_run(key)\n", " da = workflow.compute(ReflectivityOverQ).hist()\n", " da.coords['Q'] = sc.midpoints(da.coords['Q'], dim='Q')\n", " results['ess'][key] = da\n", From 94335f67037cad8efaeb118653df7623a6b873fd Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Fri, 2 May 2025 10:16:47 +0200 Subject: [PATCH 4/4] fix: use int --- docs/user-guide/amor/amor-reduction.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/user-guide/amor/amor-reduction.ipynb b/docs/user-guide/amor/amor-reduction.ipynb index a003e2f6..3331c4de 100644 --- a/docs/user-guide/amor/amor-reduction.ipynb +++ b/docs/user-guide/amor/amor-reduction.ipynb @@ -147,7 +147,7 @@ "metadata": {}, "outputs": [], "source": [ - "amor.data.amor_run('608')" + "amor.data.amor_run(608)" ] }, { @@ -168,19 +168,19 @@ " # The sample rotation values in the files are slightly off, so we replace\n", " # them with corrected values.\n", " SampleRotation[SampleRun]: sc.scalar(0.85, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('608'),\n", + " Filename[SampleRun]: amor.data.amor_run(608),\n", " },\n", " '609': {\n", " SampleRotation[SampleRun]: sc.scalar(2.25, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('609'),\n", + " Filename[SampleRun]: amor.data.amor_run(609),\n", " },\n", " '610': {\n", " SampleRotation[SampleRun]: sc.scalar(3.65, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('610'),\n", + " Filename[SampleRun]: amor.data.amor_run(610),\n", " },\n", " '611': {\n", " SampleRotation[SampleRun]: sc.scalar(5.05, unit='deg'),\n", - " Filename[SampleRun]: amor.data.amor_run('611'),\n", + " Filename[SampleRun]: amor.data.amor_run(611),\n", " },\n", "}\n", "\n",