Re-correcting direction and updating _Position tests.

This commit is contained in:
Patrick Shriwise 2019-03-19 08:41:11 -05:00
parent abd417c5f6
commit 43914d4204
2 changed files with 6 additions and 16 deletions

View file

@ -145,7 +145,7 @@ T PlotBase::get_map() const {
xyz[out_i] = origin_[out_i] + width_[1] / 2. - out_pixel / 2.;
// arbitrary direction
Direction dir = {0.5, 0.5, 0.5};
Direction dir = {0.7071, 0.7071, 0.0};
#pragma omp parallel
{

View file

@ -442,22 +442,12 @@ def test_property_map(capi_init):
def test_position(capi_init):
pos = openmc.capi.plot._Position(1.0, 1.0, 1.0)
pos = openmc.capi.plot._Position(1.0, 2.0, 3.0)
assert pos[0] == 1.0
assert pos[1] == 1.0
assert pos[2] == 1.0
assert tuple(pos) == (1.0, 2.0, 3.0)
pos[0] = 1.3
pos[1] = 1.3
pos[2] = 1.3
pos[1] = 2.3
pos[2] = 3.3
assert pos[0] == 1.3
assert pos[1] == 1.3
assert pos[2] == 1.3
with pytest.raises(IndexError) as e:
pos[3] = 1.3
with pytest.raises(IndexError) as e:
pos[-1] = 1.3
assert tuple(pos) == (1.3, 2.3, 3.3)