Skip to content

Commit 38bbd29

Browse files
updated deprecation warnings in unitensor_py to follow python syntax
1 parent c987912 commit 38bbd29

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pybind/unitensor_py.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ void unitensor_binding(py::module &m) {
749749
.def("put_block",
750750
[](UniTensor &self, const cytnx::Tensor &in, const std::vector<cytnx_int64> &qnum,
751751
const bool &force) {
752-
py::warnings::warn("argument 'force' is deprecated and will be removed; use put_block(UniTensor &self, const cytnx::Tensor &in, const std::vector<cytnx_int64> &qnum) instead.",
752+
py::warnings::warn("Argument 'force' is deprecated and will be removed; use put_block(in, qnum) without force argument instead.",
753753
PyExc_FutureWarning, 2);
754754
self.put_block(in, qnum, force);
755755
},
@@ -758,7 +758,7 @@ void unitensor_binding(py::module &m) {
758758
.def("put_block",
759759
[](UniTensor &self, cytnx::Tensor &in, const std::vector<std::string> &lbls, const std::vector<cytnx_int64> &qnum,
760760
const bool &force) {
761-
py::warnings::warn("argument 'force' is deprecated and will be removed; use put_block((UniTensor &self, cytnx::Tensor &in, const std::vector<std::string> &lbls, const std::vector<cytnx_int64> &qnum) instead",
761+
py::warnings::warn("Argument 'force' is deprecated and will be removed; use put_block(in, lbls, qnum) without force argument instead.",
762762
PyExc_FutureWarning, 2);
763763
self.put_block(in, lbls, qnum, force);
764764
},
@@ -783,7 +783,7 @@ void unitensor_binding(py::module &m) {
783783
.def("put_block_",
784784
[](UniTensor &self, cytnx::Tensor &in, const std::vector<cytnx_int64> &qnum,
785785
const bool &force) {
786-
py::warnings::warn("argument 'force' is deprecated and will be removed; use put_block_(UniTensor &self, cytnx::Tensor &in, const std::vector<cytnx_int64> &qnum) instead.",
786+
py::warnings::warn("Argument 'force' is deprecated and will be removed; use put_block_(in, qnum) without force argument instead.",
787787
PyExc_FutureWarning, 2);
788788
self.put_block_(in, qnum, force);
789789
},
@@ -792,7 +792,7 @@ void unitensor_binding(py::module &m) {
792792
.def("put_block_",
793793
[](UniTensor &self, cytnx::Tensor &in, const std::vector<std::string> &lbls, const std::vector<cytnx_int64> &qnum,
794794
const bool &force) {
795-
py::warnings::warn("argument 'force' is deprecated and will be removed; use put_block_(UniTensor &self, cytnx::Tensor &in, const std::vector<std::string> &lbls, const std::vector<cytnx_int64> &qnum) instead.",
795+
py::warnings::warn("Argument 'force' is deprecated and will be removed; use put_block_(in, lbls, qnum) without force argument instead.",
796796
PyExc_FutureWarning, 2);
797797
self.put_block_(in, lbls, qnum, force);
798798
},
@@ -1597,7 +1597,7 @@ void unitensor_binding(py::module &m) {
15971597
const int &device, const std::string &name)
15981598
{
15991599
if(seed==-1){
1600-
// If user doesn't specify seed argument
1600+
// If no seed argument was specified by the user
16011601
seed = cytnx::random::__static_random_device();
16021602
}
16031603
return UniTensor::normal(Nelem, mean, std, in_labels, seed, dtype, device, name);
@@ -1612,7 +1612,7 @@ void unitensor_binding(py::module &m) {
16121612
const int &device, const std::string &name)
16131613
{
16141614
if(seed==-1){
1615-
// If user doesn't specify seed argument
1615+
// If no seed argument was specified by the user
16161616
seed = cytnx::random::__static_random_device();
16171617
}
16181618
return UniTensor::normal(shape, mean, std, in_labels, seed, dtype, device, name);
@@ -1627,7 +1627,7 @@ void unitensor_binding(py::module &m) {
16271627
const int &device, const std::string &name)
16281628
{
16291629
if(seed==-1){
1630-
// If user doesn't specify seed argument
1630+
// If no seed argument was specified by the user
16311631
seed = cytnx::random::__static_random_device();
16321632
}
16331633
return UniTensor::uniform(Nelem, low, high, in_labels, seed, dtype, device, name);
@@ -1642,7 +1642,7 @@ void unitensor_binding(py::module &m) {
16421642
const int &device, const std::string &name)
16431643
{
16441644
if(seed==-1){
1645-
// If user doesn't specify seed argument
1645+
// If no seed argument was specified by the user
16461646
seed = cytnx::random::__static_random_device();
16471647
}
16481648
return UniTensor::uniform(shape, low, high, in_labels, seed, dtype, device, name);
@@ -1655,7 +1655,7 @@ void unitensor_binding(py::module &m) {
16551655
int64_t &seed)
16561656
{
16571657
if(seed==-1){
1658-
// If user doesn't specify seed argument
1658+
// If no seed argument was specified by the user
16591659
seed = cytnx::random::__static_random_device();
16601660
}
16611661
self.normal_(mean, std, seed);
@@ -1665,7 +1665,7 @@ void unitensor_binding(py::module &m) {
16651665
int64_t &seed)
16661666
{
16671667
if(seed==-1){
1668-
// If user doesn't specify seed argument
1668+
// If no seed argument was specified by the user
16691669
seed = cytnx::random::__static_random_device();
16701670
}
16711671
self.uniform_(low, high, seed);

0 commit comments

Comments
 (0)