IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
range_restriction.py
1## \example example/range_restriction.py
2# This example shows how to use the example singleton modifier to constrain the
3# coordinates of a set of particles to remain within a box.
4
5import IMP.example
6import IMP.core
7import IMP.container
8import sys
9
10# you can use this argument to shorten the test, if necessary
11IMP.add_bool_flag("test", "Run a minimal test on the script")
12
13# parse standard IMP flags
14IMP.setup_from_argv(sys.argv, "A trivial example of an example.")
15
16
18 IMP.algebra.Vector3D(10, 10, 10))
19
20m = IMP.Model()
23
24# apply the range restriction modifier to each each particle in sc
27m.add_score_state(ss)
28
29# now optimize and things
30# ...
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Apply a SingletonFunction to a SingletonContainer to maintain an invariant.
VectorD< 3 > Vector3D
Definition VectorD.h:407
Various classes to hold sets of particles.
Basic functionality that is expected to be used by a wide variety of IMP users.
XYZRs create_xyzr_particles(Model *m, unsigned int num, Float radius, Float box_side=10)
Create a set of particles with random coordinates.
Example module.
void add_bool_flag(std::string name, std::string description)
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.