def test_to_and_from_ascii(self, saxs_benchmark): saxs_prop_ref = ps.SaxsProperty() saxs_prop_ref.from_crysol_int(saxs_benchmark['crysol_int']) saxs_prop = ps.SaxsProperty() with tempfile.NamedTemporaryFile() as f: saxs_prop_ref.to_ascii(f.name) saxs_prop.from_ascii(f.name) np.testing.assert_array_almost_equal( saxs_prop.qvalues, saxs_prop_ref.qvalues)
def test_from_crysol_pdb(self, saxs_benchmark): saxs_prop = ps.SaxsProperty() saxs_prop.from_crysol_pdb(saxs_benchmark['crysol_pdb'], args='') saxs_prop_ref = ps.SaxsProperty() saxs_prop_ref.from_crysol_int(saxs_benchmark['crysol_int']) np.testing.assert_array_almost_equal( saxs_prop.qvalues, saxs_prop_ref.qvalues) np.testing.assert_array_almost_equal( saxs_prop.profile, saxs_prop_ref.profile)
def test_default_name(self): saxs_prop = ps.SaxsProperty() assert saxs_prop.name == 'saxs'
def test_from_crysol_int(self, saxs_benchmark): saxs_prop = ps.SaxsProperty() saxs_prop.from_crysol_int(saxs_benchmark['crysol_file']) assert saxs_prop.qvalues[8] == 0.008 assert saxs_prop.profile[8] == 1740900.0 assert saxs_prop.errors[8] == 0.0