diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst index 8033080bf6392be1ea18bb0a88320feb8f34b3cd..45688670ea42d9abe9213728a0826f11b29ef565 100644 --- a/modules/mol/base/doc/entity.rst +++ b/modules/mol/base/doc/entity.rst @@ -624,6 +624,18 @@ The Handle Classes :type: :class:`AtomHandleList` (list of :class:`AtomHandle`) + .. attribute:: atom_count + + Number of atoms. Read-only. See :meth:`GetAtomCount`. + + :type: :class:`int` + + .. attribute:: bond_count + + Number of bonds. Read-only. See :meth:`GetBondCount`. + + :type: :class:`int` + .. attribute:: bounds Axis-aligned bounding box of the residue. Read-only. @@ -858,6 +870,14 @@ The Handle Classes See :attr:`atoms` + .. method:: GetAtomCount() + + See :attr:`atom_count` + + .. method:: GetBondCount() + + See :attr:`bond_count` + .. method:: GetBounds() See :attr:`bounds` @@ -1927,6 +1947,12 @@ The View Classes :type: :class:`AtomViewList` (list of :class:`AtomView`) + .. attribute:: atom_count + + Number of atoms included in the view. Read-only. See :meth:`GetAtomCount`. + + :type: :class:`int` + .. attribute:: chain The chain this residue belongs to. Read-only. Also available as @@ -2015,6 +2041,10 @@ The View Classes See :attr:`atoms` + .. method:: GetAtomCount() + + See :attr:`atom_count` + .. method:: GetIndex() See :attr:`index` diff --git a/modules/mol/base/pymod/export_residue.cc b/modules/mol/base/pymod/export_residue.cc index d4b741d3bc1a173974c28067d71debf8342131e5..40fbfe260a7643e9c9adf63f655d6e42ce2e331f 100644 --- a/modules/mol/base/pymod/export_residue.cc +++ b/modules/mol/base/pymod/export_residue.cc @@ -261,6 +261,7 @@ void export_Residue() .def("GetAtomCount", &ResidueHandle::GetAtomCount) .def("GetBondCount", &ResidueHandle::GetBondCount) .add_property("atom_count", &ResidueHandle::GetAtomCount) + .add_property("bond_count", &ResidueHandle::GetBondCount) .add_property("index", &ResidueHandle::GetIndex) .def("Select", select_string, arg("flags")=0) .def("Select", select_query, arg("flags")=0) diff --git a/modules/mol/base/pymod/export_residue_view.cc b/modules/mol/base/pymod/export_residue_view.cc index a3a7f16eaa232216a97b1091fd9048ff3a7e87c0..9d14320de594bb3220792085258551f9e1d82cbe 100644 --- a/modules/mol/base/pymod/export_residue_view.cc +++ b/modules/mol/base/pymod/export_residue_view.cc @@ -64,6 +64,7 @@ void export_ResidueView() .add_property("atoms", make_function(&ResidueView::GetAtomList, return_value_policy<copy_const_reference>())) + .add_property("atom_count", &ResidueView::GetAtomCount) .def("FindAtom", string_find_atom, args("atom_name")) .def("AddAtom", add_atom_handle, X_add_atom_overloads(args("atom_handle", "flags"))) .def("AddAtom", add_atom_view, X_add_atom_overloads(args("atom_view", "flags")))