Skip to content

Commit

Permalink
test: check only output shape of generate_data
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Nov 11, 2020
1 parent a73dfa9 commit ff8f254
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions tests/data/test_generate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import expertsystem.amplitude.model as es
import numpy as np
import pytest

from tensorwaves.data.generate import generate_data, generate_phsp
Expand Down Expand Up @@ -58,15 +57,6 @@ def test_generate_data(canonical_model: es.AmplitudeModel):
assert len(data_sample) == len(model.kinematics.final_state)
for sample in data_sample:
assert len(sample) == n_data
data_sq = data_sample ** 2
e_sq = data_sq[:, :, 3]
p3_sq = data_sq[:, :, :3]
m_sq = np.abs(e_sq - p3_sq.sum(axis=2))
assert pytest.approx(list(np.sqrt(m_sq.mean(axis=1))), abs=1e-4) == [
0,
0.135,
0.135,
]
data_set = kinematics.convert(data_sample)
assert set(data_set) == {
"mSq_2",
Expand All @@ -79,6 +69,3 @@ def test_generate_data(canonical_model: es.AmplitudeModel):
"theta+3+4_vs_2",
"theta+3_4+2",
}
assert pytest.approx(data_set["mSq_2"].mean()) == 0
assert pytest.approx(data_set["mSq_3"].mean()) == data_set["mSq_4"].mean()
assert pytest.approx(data_set["mSq_3_4"].mean(), abs=1e-1) == 1

0 comments on commit ff8f254

Please sign in to comment.