-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DES python bindings #508
base: main
Are you sure you want to change the base?
Add DES python bindings #508
Conversation
f909e81
to
951faac
Compare
951faac
to
3395d12
Compare
21d8424
to
637813d
Compare
637813d
to
b93e464
Compare
for i in range(0, len(hound_row_strings)): | ||
if i-1 in red_line_indices: | ||
print(CLR['red_bg'], hound_row_strings[i], CLR['default_bg']) | ||
else: | ||
print(hound_row_strings[i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i in range(0, len(hound_row_strings)): | |
if i-1 in red_line_indices: | |
print(CLR['red_bg'], hound_row_strings[i], CLR['default_bg']) | |
else: | |
print(hound_row_strings[i]) | |
for i, hound_row_string in enumerate(hound_row_strings, start=-1): | |
if i in red_line_indices: | |
print(CLR['red_bg'], hound_row_string, CLR['default_bg']) | |
else: | |
print(hound_row_string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That -1
doesn't look right, are you sure that's what's supposed to be here?
.def_property_readonly("ante", &NAR::GetAnte, py::return_value_policy::move) | ||
.def_property_readonly("cons", &NAR::GetCons, py::return_value_policy::move); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the move will do anything, it will try to std::move
a const
.
.def_property_readonly("ante", &NAR::GetAnte, py::return_value_policy::move) | |
.def_property_readonly("cons", &NAR::GetCons, py::return_value_policy::move); | |
.def_property_readonly("ante", &NAR::GetAnte) | |
.def_property_readonly("cons", &NAR::GetCons); |
py::class_<NARAlgorithm, Algorithm>(nar_module, "NarAlgorithm") | ||
.def("get_nars", &NARAlgorithm::GetNARVector); | ||
|
||
auto algos_module = nar_module.def_submodule("algorithms"); | ||
auto default_algorithm = detail::RegisterAlgorithm<DES, NARAlgorithm>(algos_module, "des"); | ||
algos_module.attr("Default") = default_algorithm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
py::class_<NARAlgorithm, Algorithm>(nar_module, "NarAlgorithm") | |
.def("get_nars", &NARAlgorithm::GetNARVector); | |
auto algos_module = nar_module.def_submodule("algorithms"); | |
auto default_algorithm = detail::RegisterAlgorithm<DES, NARAlgorithm>(algos_module, "des"); | |
algos_module.attr("Default") = default_algorithm; | |
BindPrimitive<DES>(nar_module, &NARAlgorithm::GetNARVector, "NarAlgorithm", "get_nars", {"DES"}, pybind11::return_value_policy::copy); |
No description provided.