|
5 | 5 |
|
6 | 6 | import pytest |
7 | 7 | import scipp as sc |
8 | | -from scippneutron import metadata |
9 | 8 | from scippneutron.io import cif |
| 9 | +from scippneutron.metadata import ESS_SOURCE, Person |
10 | 10 |
|
11 | 11 | import ess.dream.io.cif |
12 | 12 | from ess.powder.calibration import OutputCalibrationData |
13 | | -from ess.powder.types import CIFAuthors, IofTof |
| 13 | +from ess.powder.types import Beamline, CIFAuthors, IofTof, ReducerSoftwares, Software |
14 | 14 |
|
15 | 15 |
|
16 | 16 | @pytest.fixture |
@@ -44,14 +44,33 @@ def save_reduced_tof_to_str(cif_: cif.CIF) -> str: |
44 | 44 | def test_save_reduced_tof(ioftof: IofTof, cal: OutputCalibrationData) -> None: |
45 | 45 | from ess.dream import __version__ |
46 | 46 |
|
47 | | - author = metadata.Person(name='John Doe', corresponding=True) |
| 47 | + author = Person(name='John Doe', corresponding=True) |
48 | 48 | cif_ = ess.dream.io.cif.prepare_reduced_tof_cif( |
49 | | - ioftof, authors=CIFAuthors([author]), calibration=cal |
| 49 | + ioftof, |
| 50 | + authors=CIFAuthors([author]), |
| 51 | + beamline=Beamline( |
| 52 | + name="DREAM", |
| 53 | + facility="ESS", |
| 54 | + site="ESS", |
| 55 | + ), |
| 56 | + source=ESS_SOURCE, |
| 57 | + reducers=ReducerSoftwares( |
| 58 | + [ |
| 59 | + Software.from_package_metadata('ess.diffraction'), |
| 60 | + Software.from_package_metadata('ess.dream'), |
| 61 | + Software.from_package_metadata('ess.powder'), |
| 62 | + Software.from_package_metadata('scippneutron'), |
| 63 | + Software.from_package_metadata('scipp'), |
| 64 | + ] |
| 65 | + ), |
| 66 | + calibration=cal, |
50 | 67 | ) |
51 | 68 | result = save_reduced_tof_to_str(cif_) |
52 | 69 |
|
53 | 70 | assert "_audit_contact_author.name 'John Doe'" in result |
54 | | - assert f"_computing.diffrn_reduction 'ess.dream v{__version__}'" in result |
| 71 | + assert f"_computing.diffrn_reduction\n'ess.diffraction {__version__}'" in result |
| 72 | + assert f"ess.dream {__version__}" in result |
| 73 | + assert f"ess.powder {__version__}" in result |
55 | 74 | assert '_diffrn_source.beamline DREAM' in result |
56 | 75 | assert 'ZERO 0 0.2' in result |
57 | 76 | assert 'DIFC 1 1.2' in result |
|
0 commit comments