Skip to content

Commit 3b3678c

Browse files
author
Charlles Abreu
committed
Fixed Python API
1 parent 128b209 commit 3b3678c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

devtools/conda-recipes/anaconda/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ requirements:
2121
- make
2222
- setuptools
2323
- pip
24+
- numpy >=1.19
2425
host:
2526
- python
2627
- openmm >=8.1

python/openmmcppforces/openmmcppforces.i

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "openmm/RPMDMonteCarloBarostat.h"
1111
#include "openmm/Force.h"
1212
#include "openmm/Vec3.h"
13+
#include "openmm/Context.h"
1314
#include <numpy/ndarrayobject.h>
1415

1516
using namespace OpenMM;
@@ -25,7 +26,16 @@ namespace std {
2526
};
2627

2728
%pythoncode %{
28-
__version__ = "@CMAKE_PROJECT_VERSION@"
29+
import simtk.openmm as mm
30+
import simtk.unit as unit
31+
%}
32+
33+
/*
34+
* Add units to function outputs.
35+
*/
36+
37+
%pythonappend OpenMMCPPForces::ConcertedRMSDForce::getReferencePositions() const %{
38+
val *= unit.nanometers
2939
%}
3040

3141
/*
@@ -130,7 +140,7 @@ public:
130140
* and setGroup() to modify this object's parameters, then call updateParametersInContext()
131141
* to copy them over to the Context.
132142
*/
133-
void updateParametersInContext(Context& context);
143+
void updateParametersInContext(OpenMM::Context& context);
134144
/**
135145
* Returns whether or not this force makes use of periodic boundary
136146
* conditions.

0 commit comments

Comments
 (0)