Changeset 802a9d
- Timestamp:
- Dec 21, 2025, 9:50:27 PM (5 days ago)
- Branches:
- Candidate_v1.7.1, stable
- Children:
- 2e7888
- Parents:
- e4b9d5
- git-author:
- Frederik Heber <frederik.heber@…> (11/18/25 19:34:57)
- git-committer:
- Frederik Heber <frederik.heber@…> (12/21/25 21:50:27)
- Files:
-
- 3 added
- 3 edited
-
configure.ac (modified) (1 diff)
-
src/Python/export_numpy.cpp (modified) (3 diffs)
-
utils/Python/HOWTO-generate_bondtable (added)
-
utils/Python/Makefile.am (modified) (2 diffs)
-
utils/Python/compute_pair_bondlength.py.in (added)
-
utils/Python/generate_bondtable.sh.in (added)
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
re4b9d5 r802a9d 631 631 AM_COND_IF([CONDPYTHON],[ 632 632 AC_CONFIG_FILES([utils/Python/boxmaker.py:utils/Python/boxmaker.py.in], [chmod +x utils/Python/boxmaker.py]) 633 AC_CONFIG_FILES([utils/Python/generate_bondtable.sh:utils/Python/generate_bondtable.sh.in], [chmod +x utils/Python/generate_bondtable.sh]) 634 AC_CONFIG_FILES([utils/Python/compute_pair_bondlength.py:utils/Python/compute_pair_bondlength.py.in], [chmod +x utils/Python/compute_pair_bondlength.py]) 633 635 AC_CONFIG_FILES([utils/Python/python_wrapper:utils/Python/python_wrapper.in], [chmod +x utils/Python/python_wrapper]) 634 636 AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run]) -
src/Python/export_numpy.cpp
re4b9d5 r802a9d 41 41 42 42 #include "CodePatterns/Assert.hpp" 43 43 #include "CodePatterns/Log.hpp" 44 45 #include "Geometry/GeometryRegistry.hpp" 44 46 #include "World.hpp" 45 47 … … 78 80 79 81 return positions; 82 } 83 84 np::ndarray get_geometryobject(const std::string &name) 85 { 86 LOG(1, "Getting GeometryObject of name " << name); 87 const GeometryObject *object = GeometryRegistry::getInstance().getByName(name); 88 p::tuple shape = p::make_tuple(3); 89 np::dtype dtype = np::dtype::get_builtin<double>(); 90 np::ndarray distance = np::zeros(shape, dtype); 91 if (object != NULL) { 92 for (unsigned int i=0;i<NDIM;++i) 93 distance[i] = object->getVector()[i]; 94 } 95 return distance; 80 96 } 81 97 … … 173 189 void export_numpy() 174 190 { 191 p::def("get_geometryobject", get_geometryobject, p::args("name")); 175 192 p::def("get_positions", get_positions); 176 193 p::def("get_velocities", get_velocities); -
utils/Python/Makefile.am
re4b9d5 r802a9d 1 1 if CONDPYTHON 2 2 PYTHON_TOOLS = \ 3 Python/boxmaker 3 Python/boxmaker \ 4 Python/generate_bondtable \ 5 Python/compute_pair_bondlength 4 6 endif 5 7 … … 13 15 BUILT_SOURCES += ${PYTHON_TOOLS} 14 16 CLEANFILES += ${PYTHON_TOOLS} 15 pyexec_SCRIPTS += Python/boxmaker.py 17 pyexec_SCRIPTS += \ 18 Python/boxmaker.py \ 19 Python/compute_pair_bondlength.py 16 20 endif
Note:
See TracChangeset
for help on using the changeset viewer.
