source: tests/Python/pyMoleCuilder/testsuite-python-pymolecuilder.at@ 923ce2

Candidate_v1.7.0 stable
Last change on this file since 923ce2 was 8c9cce, checked in by Frederik Heber <frederik.heber@…>, 4 years ago

Numpy exporters are fully operational.

  • TESTS: added test on working getter and setter.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1#
2# MoleCuilder - creates and alters molecular systems
3# Copyright (C) 2019 Frederik Heber
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#
18#
19# pyMoleCuilder
20
21AT_SETUP([Python scripts - getter and setter for x,v,f])
22AT_KEYWORDS([python getter setter])
23AT_DATA([pythontest.py], [[
24import pyMoleCuilder as mol
25import numpy as np
26mol.AtomAdd("H", "0.,0.,0.")
27mol.SelectionAllAtoms()
28mol.wait()
29print(mol.get_positions())
30a=np.zeros((1,3))
31a[0,0]=1.
32mol.set_positions(a)
33a[0,1]=1.
34mol.set_velocities(a)
35a[0,2]=1.
36mol.set_forces(a)
37print(mol.get_positions())
38print(mol.get_velocities())
39print(mol.get_forces())
40 sys.exit(1)
41]])
42AT_CHECK([../../run pythontest.py], 0, [stdout], [ignore])
43AT_CHECK([fgrep "[[ 1. 1. 1.]]" stdout], 0, [ignore], [ignore])
44AT_CLEANUP
Note: See TracBrowser for help on using the repository browser.