-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for reading NXopt based nexus file (#144)
* Adds support for reading NXopt based nexus file * Index both observables for nexus file * Clean up errors
- Loading branch information
Showing
3 changed files
with
117 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
"""Tests for a TiO2/SiO2/Si reference layer""" | ||
from __future__ import unicode_literals | ||
|
||
from pytest import fixture | ||
import pytest | ||
|
||
from fixtures import datadir # pylint: disable=unused-import | ||
import elli | ||
|
||
|
||
@fixture | ||
@pytest.mark.parametrize( | ||
"filename", | ||
["ellips.test.nxs", "ellips_nx_opt.test.nxs"], | ||
) | ||
# pylint: disable=redefined-outer-name | ||
def nexus_psi_delta_file(datadir): | ||
""" | ||
Fixture which returns the nexus file containting the psi / delta measurement data. | ||
""" | ||
return datadir / "ellips.test.nxs" | ||
|
||
|
||
# pylint: disable=redefined-outer-name | ||
def test_reading_of_psi_delta_nxs(nexus_psi_delta_file): | ||
def test_reading_of_psi_delta_nxs(datadir, filename): | ||
"""Psi/delta NeXus file is read w/o errors""" | ||
elli.read_nexus_psi_delta(nexus_psi_delta_file) | ||
elli.read_nexus_psi_delta(datadir / filename) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"filename", | ||
["ellips.test.nxs", "ellips_nx_opt.test.nxs"], | ||
) | ||
# pylint: disable=redefined-outer-name | ||
def test_reading_and_conv_to_rho(nexus_psi_delta_file): | ||
def test_reading_and_conv_to_rho(datadir, filename): | ||
"""Rho values are read from Psi / Delta file""" | ||
elli.read_nexus_rho(nexus_psi_delta_file) | ||
elli.read_nexus_rho(datadir / filename) |
Binary file not shown.