Changeset e4b9d5


Ignore:
Timestamp:
Dec 21, 2025, 9:50:22 PM (8 days ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.1, stable
Children:
802a9d
Parents:
bc58f2
git-author:
Frederik Heber <frederik.heber@…> (11/20/25 17:20:49)
git-committer:
Frederik Heber <frederik.heber@…> (12/21/25 21:50:22)
Message:

Adds python command getSelectedAtomCount().

  • this avoids needing to copy all ids first to python and counting them in python instead.
Location:
src/Python
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Python/Makefile.am

    rbc58f2 re4b9d5  
    88        Python/getDomainVolume.cpp \
    99        Python/getGraph6String.cpp \
     10        Python/getSelectedAtomCount.cpp \
    1011        Python/getSelectedAtomElements.cpp \
    1112        Python/getSelectedAtomIds.cpp \
  • src/Python/PythonScripting_impl.hpp

    rbc58f2 re4b9d5  
    140140      "returns the positions of all currently selected atoms."
    141141  );
     142  boost::python::def< int() >(
     143      "getSelectedAtomCount",
     144      MoleCuilder::detail::module_getSelectedAtomCount,
     145      "returns the number of all currently selected atoms."
     146  );
    142147  boost::python::def< MoleCuilder::detail::atomIdVec() >(
    143148      "getSelectedAtomIds",
  • src/Python/export_numpy.cpp

    rbc58f2 re4b9d5  
    126126    boost::function<void (atom &, const Vector &)> &_set_function)
    127127{
     128#ifndef NDEBUG
    128129  unsigned int num_atoms = get_num_atoms();
    129  
     130#endif
    130131  // check whether shape of array is correct
    131132  ASSERT( _positions.shape(0) == num_atoms,
  • src/Python/modules.hpp

    rbc58f2 re4b9d5  
    3535doubleVec module_getBoundingBox();
    3636double module_getDomainVolume();
     37int module_getSelectedAtomCount();
    3738atomIdVec module_getSelectedAtomIds();
    3839atomPositionsVec module_getSelectedAtomPositions();
Note: See TracChangeset for help on using the changeset viewer.