Skip to content

Commit

Permalink
python: fix bindings to Atom::pos
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Oct 16, 2024
1 parent 146cb39 commit 1a6b03d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/mol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <nanobind/stl/string.h>
#include <nanobind/stl/vector.h>
#include <nanobind/stl/variant.h>
#include "meta.h"
#include "meta.h" // IWYU pragma: export

using namespace gemmi;

Expand Down Expand Up @@ -511,7 +511,7 @@ void add_mol(nb::module_& m) {
.def_rw("charge", &Atom::charge)
.def_rw("element", &Atom::element)
.def_prop_rw("pos",
[](const Atom& self) { return self.pos; },
[](Atom& self) -> Position& { return self.pos; },
[](Atom& self, const std::variant<Position, std::array<double,3>>& v) {
if (const Position* p = std::get_if<0>(&v)) {
self.pos = *p;
Expand Down

0 comments on commit 1a6b03d

Please sign in to comment.