Commit b9d3f32c authored by Philipp  Trunschke's avatar Philipp Trunschke
Browse files

bugfix in py-bindings to measurement sets

parent a8b6d40a
Pipeline #1677 failed with stages
in 15 minutes and 55 seconds
......@@ -4,6 +4,11 @@ import numpy as np
from numpy.polynomial.legendre import legval
class TestReconstruction(unittest.TestCase):
def test_constructors(self):
xe.RankOneMeasurementSet(xe.RankOneMeasurementSet())
xe.SinglePointMeasurementSet(xe.SinglePointMeasurementSet())
xe.UQMeasurementSet(xe.UQMeasurementSet())
def test_small_reconstruction_weighted(self):
# the function to approximate
def fnc(x, y):
......
......@@ -4,6 +4,7 @@ void expose_recoveryAlgorithms(module& m) {
// ------------------------------------------------------------- measurements
class_<SinglePointMeasurementSet>(m, "SinglePointMeasurementSet")
.def(init<>(), "constructs an empty measurement set")
.def(init<const SinglePointMeasurementSet&>())
.def_readwrite("positions", &SinglePointMeasurementSet::positions)
.def_readwrite("measuredValues", &SinglePointMeasurementSet::measuredValues)
......@@ -40,6 +41,7 @@ void expose_recoveryAlgorithms(module& m) {
m.def("IHT", &IHT, arg("x"), arg("measurements"), arg("perfData")=NoPerfData);
class_<RankOneMeasurementSet>(m, "RankOneMeasurementSet")
.def(init<>(), "constructs an empty measurement set")
.def(init<const RankOneMeasurementSet&>())
.def("get_position", +[](RankOneMeasurementSet &_this, size_t _i){
return _this.positions[_i];
......@@ -113,6 +115,7 @@ void expose_recoveryAlgorithms(module& m) {
m.attr("ADF") = ADF;
class_<uq::UQMeasurementSet>(m, "UQMeasurementSet")
.def(init<>(), "constructs an empty measurement set")
.def(init<const uq::UQMeasurementSet&>())
.def("add", &uq::UQMeasurementSet::add)
;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment