%pythoncode %{ def _forward_add_attribute(self, name, value, opt=None): if opt is not None: self.get_particle().add_attribute(name, value, opt) else: self.get_particle().add_attribute(name, value) def _forward_get_value(self, name): self.get_particle().get_value(name) def _forward_set_value(self, name, value): self.get_particle().set_value(name, value) %} #if IMP_BUILD == IMP_FAST %pythoncode %{ build="fast" %} #elif IMP_BUILD == IMP_RELEASE %pythoncode %{ build="release" %} #else %pythoncode %{ build="debug" %} #endif namespace IMP { %warnfilter(403) FailureHandlerBase; %warnfilter(403) DecomposableRestraint; %warnfilter(473) Refiner; %warnfilter(473) SingletonContainer; %warnfilter(473) PairContainer; %warnfilter(403) Constraint; %warnfilter(473) Sampler; } // to avoid extend clash IMP_SWIG_OBJECT(IMP, Object, Objects); IMP_SWIG_DIRECTOR(IMP, Object); IMP_SWIG_BASE_OBJECT(IMP,Constraint, Constraints); IMP_SWIG_BASE_OBJECT(IMP,Container, Containers); IMP_SWIG_BASE_OBJECT(IMP,FailureHandler, FailureHandlers); IMP_SWIG_BASE_OBJECT(IMP,Optimizer, Optimizers); IMP_SWIG_BASE_OBJECT(IMP,OptimizerState, OptimizerStates); IMP_SWIG_BASE_OBJECT(IMP,PairContainer, PairContainers); IMP_SWIG_BASE_OBJECT(IMP,PairFilter, PairFilters); IMP_SWIG_BASE_OBJECT(IMP,PairModifier, PairModifiers); IMP_SWIG_BASE_OBJECT(IMP,PairScore, PairScores); IMP_SWIG_BASE_OBJECT(IMP,QuadContainer, QuadContainers); IMP_SWIG_BASE_OBJECT(IMP,QuadFilter, QuadFilters); IMP_SWIG_BASE_OBJECT(IMP,QuadModifier, QuadModifiers); IMP_SWIG_BASE_OBJECT(IMP,QuadScore, QuadScores); IMP_SWIG_BASE_OBJECT(IMP,Refiner, Refiners); IMP_SWIG_BASE_OBJECT(IMP,Restraint, Restraints); IMP_SWIG_BASE_OBJECT(IMP,Sampler, Samplers); IMP_SWIG_BASE_OBJECT(IMP,ScoreState, ScoreStates); IMP_SWIG_BASE_OBJECT(IMP,SingletonContainer, SingletonContainers); IMP_SWIG_BASE_OBJECT(IMP,SingletonFilter, SingletonFilters); IMP_SWIG_BASE_OBJECT(IMP,SingletonModifier, SingletonModifiers); IMP_SWIG_BASE_OBJECT(IMP,SingletonScore, SingletonScores); IMP_SWIG_BASE_OBJECT(IMP,TripletContainer, TripletContainers); IMP_SWIG_BASE_OBJECT(IMP,TripletFilter, TripletFilters); IMP_SWIG_BASE_OBJECT(IMP,TripletModifier, TripletModifiers); IMP_SWIG_BASE_OBJECT(IMP,TripletScore, TripletScores); IMP_SWIG_BASE_OBJECT(IMP,UnaryFunction, UnaryFunctions); IMP_SWIG_OBJECT(IMP,ConfigurationSet, ConfigurationSets); IMP_SWIG_OBJECT(IMP,Model, Models); //IMP_SWIG_OBJECT(IMP,Object, Objects); IMP_SWIG_OBJECT(IMP,Particle, Particles); IMP_SWIG_OBJECT(IMP,RestraintSet, RestraintSets); IMP_SWIG_OBJECT(IMP,DecomposableRestraint, DecomposableRestraints); IMP_SWIG_OBJECT_TUPLE(IMP, ParticlePair, ParticlePairs); IMP_SWIG_OBJECT_TUPLE(IMP, ParticleTriplet, ParticleTriplets); IMP_SWIG_OBJECT_TUPLE(IMP, ParticleQuad, ParticleQuads); IMP_SWIG_OBJECT(IMP, PairScoreRestraint,PairScoreRestraints); IMP_SWIG_OBJECT(IMP, PairsScoreRestraint,PairsScoreRestraints); IMP_SWIG_OBJECT(IMP, QuadScoreRestraint,QuadScoreRestraints); IMP_SWIG_OBJECT(IMP, QuadsScoreRestraint,QuadsScoreRestraints); IMP_SWIG_OBJECT(IMP, SingletonScoreRestraint,SingletonScoreRestraints); IMP_SWIG_OBJECT(IMP, SingletonsScoreRestraint,SingletonsScoreRestraints); IMP_SWIG_OBJECT(IMP, TripletScoreRestraint,TripletScoreRestraints); IMP_SWIG_OBJECT(IMP, TripletsScoreRestraint, TripletsScoreRestraints); IMP_SWIG_OBJECT(IMP, WriteOptimizerState, WriteOptimizerStates); IMP_SWIG_OBJECT(IMP, WriteBinaryOptimizerState, WriteBinaryOptimizerStates); IMP_SWIG_OBJECT(IMP, WriteFailureHandler, WriteFailureHandlers); IMP_SWIG_OBJECT(IMP, WriteBinaryFailureHandler, WriteBinaryFailureHandlers); IMP_SWIG_OBJECT(IMP, SaveToConfigurationSetOptimizerState, SaveToConfigurationSetOptimizerStates); IMP_SWIG_OBJECT(IMP, SaveToConfigurationSetFailureHandler, SaveToConfigurationSetFailureHandlers); IMP_SWIG_PAIR(IMP, Double, DerivativePair, DerivativePairs); IMP_SWIG_PAIR(IMP, Double, FloatRange, FloatRanges); IMP_SWIG_PAIR(IMP, Double, FloatPair, FloatPairs); IMP_SWIG_PAIR(IMP, Int, IntRange, IntRanges); IMP_SWIG_SEQUENCE_PAIR(IMP, IMP::Restraint*, double, RestraintsAndWeights); IMP_SWIG_VALUE(IMP, VersionInfo, VersionInfos); IMP_SWIG_VALUE(IMP, TextOutput, TextOutputs); IMP_SWIG_VALUE(IMP, TextInput, TextInputs); IMP_SWIG_VALUE(IMP, DerivativeAccumulator, DerivativeAccumulators); IMP_SWIG_VALUE(IMP, FloatKey, FloatKeys); IMP_SWIG_VALUE(IMP, IntKey, IntKeys); IMP_SWIG_VALUE(IMP, StringKey, StringKeys); IMP_SWIG_VALUE(IMP, ParticleKey, ParticleKeys); IMP_SWIG_VALUE(IMP, ObjectKey, ObjectKeys); IMP_SWIG_VALUE(IMP, Float, Floats); IMP_SWIG_VALUE(IMP, Int, Ints); IMP_SWIG_VALUE(IMP, String, Strings); IMP_SWIG_VALUE(IMP, SetLogState, SetLogStates); IMP_SWIG_DECORATOR(IMP::internal, _TrivialDecorator, _TrivialDecorators); IMP_SWIG_DECORATOR(IMP::internal, _TrivialDerivedDecorator, _TrivialDerivedDecorators); IMP_SWIG_DECORATOR_WITH_TRAITS(IMP::internal, _TrivialTraitsDecorator, _TrivialTraitsDecorators); IMP_SWIG_OBJECT(IMP::internal, _ConstRestraint, _ConstRestraints); IMP_SWIG_OBJECT(IMP::internal, _ConstOptimizer, _ConstOptimizers); IMP_SWIG_GRAPH(IMP, DependencyGraph, DependencyGraph, IMP::Object*); %extend IMP::Object { bool __eq__(const Object *o) const { return self ==o; } bool __ne__(const Object *o) const { return self !=o; } bool __le__(const Object *o) const { return self <= o; } bool __lt__(const Object *o) const { return self < o; } bool __ge__(const Object *o) const { return self >= o; } bool __gt__(const Object *o) const { return self > o; } bool __eq__(const IMP::Decorator &d) const { return self == d.get_particle(); } bool __ne__(const IMP::Decorator &d) const { return self != d.get_particle(); } bool __le__(const IMP::Decorator &d) const { return self <= d.get_particle(); } bool __lt__(const IMP::Decorator &d) const { return self < d.get_particle(); } bool __ge__(const IMP::Decorator &d) const { return self >= d.get_particle(); } bool __gt__(const IMP::Decorator &d) const { return self > d.get_particle(); } } %feature("ref") IMP::RefCounted "IMP::internal::ref($this);" %feature("unref") IMP::RefCounted "IMP::internal::unref($this);" IMP_SWIG_CONTAINER(IMP, IMP, RestraintSet, Restraint, restraint) IMP_SWIG_CONTAINER(IMP, IMP, Model, ScoreState, score_state) IMP_SWIG_CONTAINER(IMP, IMP, Model, Restraint, restraint) IMP_SWIG_CONTAINER(IMP, IMP, Model, Particle, particle) IMP_SWIG_CONTAINER(IMP, IMP, Optimizer, OptimizerState, optimizer_state) %include "IMP/utility.h" %include "IMP/Key.h" namespace IMP { %template(FloatKey) ::IMP::Key<0, true>; %template(IntKey) ::IMP::Key<1, true>; %template(StringKey) ::IMP::Key<2, true>; %template(ParticleKey) ::IMP::Key<3, true>; %template(ObjectKey) ::IMP::Key<4, true>; %implicitconv InputFile; %implicitconv OutputFile; } %inline %{ namespace IMP { template class VectorOfRefCounted; template class Decorators; template class ParticleTuple; // just let swig know which namespace they are in #ifdef SWIG class ParticlePair; class ParticleTriplet; class ParticleQuad; class ParticlePairs; class ParticleTriplets; class ParticleQuads; class ParticlePairsTemp; class ParticleTripletsTemp; class ParticleQuadsTemp; #endif } %} %pythoncode %{ def ParticlePair(a, b): return (a,b) def ParticleTriplet(a, b, c): return (a,b,c) def ParticleQuad(a, b, c, d): return (a,b,c,d) %} %include "IMP/log.h" %include "IMP/base_types.h" %include "IMP/file.h" %include "IMP/utility.h" %include "IMP/deprecation.h" %include "IMP/VersionInfo.h" %include "IMP/RefCounted.h" //%include "IMP/VectorOfRefCounted.h" %include "IMP/Object.h" %include "IMP/FailureHandler.h" %include "IMP/DerivativeAccumulator.h" %include "IMP/container_base.h" %include "IMP_particle.i" %include "IMP/Decorator.h" namespace IMP { class Restraints; class ScoreStates; } %include "IMP/Restraint.h" %include "IMP/RestraintSet.h" %include "IMP/ScoreState.h" %include "IMP/Model.h" %include "IMP/UnaryFunction.h" %include "IMP/DecomposableRestraint.h" %include "IMP/Constraint.h" %include "IMP/OptimizerState.h" %include "IMP/Refiner.h" %include "IMP_random.i" %include "IMP/Optimizer.h" %include "IMP/ConfigurationSet.h" %include "IMP/Sampler.h" %include "IMP/SingletonScore.h" %include "IMP/PairScore.h" %include "IMP/SingletonModifier.h" %include "IMP/PairModifier.h" %include "IMP/SingletonContainer.h" %include "IMP/PairContainer.h" %include "IMP/SingletonFilter.h" %include "IMP/PairFilter.h" %include "IMP/TripletScore.h" %include "IMP/QuadScore.h" %include "IMP/TripletModifier.h" %include "IMP/QuadModifier.h" %include "IMP/TripletContainer.h" %include "IMP/QuadContainer.h" %include "IMP/TripletFilter.h" %include "IMP/QuadFilter.h" %include "IMP/SetLogState.h" %include "IMP/io.h" %include "IMP/internal/swig.h" %include "IMP/scoped.h" namespace IMP { %template(DependencyGraph) ::IMP::internal::BoostDigraph< IMP::DependencyGraph, IMP::Object*>; %template(ScopedScoreState) ::IMP::GenericScopedScoreState< IMP::ScoreState>; %template(ScopedRestraint) ::IMP::GenericScopedRestraint< IMP::Restraint>; } %pythoncode %{ used_modules=[] def show_used_modules(): for m in used_modules: print "%-20s %s" % (m.get_module(), m.get_version()) %}