Commit 01e6e0dc authored by Sebastian Wolf's avatar Sebastian Wolf

Add Python warning for degree

parent 5d4eb714
Pipeline #1145 failed with stages
in 17 minutes and 47 seconds
......@@ -131,7 +131,10 @@ void expose_tensor() {
.add_property("dimensions", +[](Tensor &_A) {
return _A.dimensions;
})
.def("degree", &Tensor::order) // TODO Deprecated, should print some kind of warning.
.def("degree", +[](const Tensor& _A){
XERUS_LOG(warning, "Tensor::degree() is deprecated and will be removed in a future version. Use Tensor::order() instead.");
return _A.degree();
})
.def("order", &Tensor::order)
.def_readonly("factor", &Tensor::factor)
.def_readonly("size", &Tensor::size)
......
......@@ -37,7 +37,10 @@ void expose_tensorNetwork() {
.add_property("dimensions", +[](TensorNetwork &_A) {
return _A.dimensions;
})
.def("degree", &TensorNetwork::order) // TODO Deprecated, should print some kind of warning.
.def("degree", +[](const TensorNetwork& _A){
XERUS_LOG(warning, "TensorNetwork::degree() is deprecated and will be removed in a future version. Use TensorNetwork::order() instead.");
return _A.degree();
})
.def("order", &TensorNetwork::order)
.def("datasize", &TensorNetwork::datasize)
.add_property("nodes", +[](TensorNetwork &_this){
......
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