IMP  2.2.1
The Integrative Modeling Platform
benchmark/__init__.py
1 # This file was automatically generated by SWIG (http://www.swig.org).
2 # Version 3.0.2
3 #
4 # Do not make changes to this file unless you know what you are doing--modify
5 # the SWIG interface file instead.
6 
7 
8 
9 
10 
11 from sys import version_info
12 if version_info >= (2,6,0):
13  def swig_import_helper():
14  from os.path import dirname
15  import imp
16  fp = None
17  try:
18  fp, pathname, description = imp.find_module('_IMP_benchmark', [dirname(__file__)])
19  except ImportError:
20  import _IMP_benchmark
21  return _IMP_benchmark
22  if fp is not None:
23  try:
24  _mod = imp.load_module('_IMP_benchmark', fp, pathname, description)
25  finally:
26  fp.close()
27  return _mod
28  _IMP_benchmark = swig_import_helper()
29  del swig_import_helper
30 else:
31  import _IMP_benchmark
32 del version_info
33 try:
34  _swig_property = property
35 except NameError:
36  pass # Python < 2.2 doesn't have 'property'.
37 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
38  if (name == "thisown"): return self.this.own(value)
39  if (name == "this"):
40  if type(value).__name__ == 'SwigPyObject':
41  self.__dict__[name] = value
42  return
43  method = class_type.__swig_setmethods__.get(name,None)
44  if method: return method(self,value)
45  if (not static):
46  self.__dict__[name] = value
47  else:
48  raise AttributeError("You cannot add attributes to %s" % self)
49 
50 def _swig_setattr(self,class_type,name,value):
51  return _swig_setattr_nondynamic(self,class_type,name,value,0)
52 
53 def _swig_getattr(self,class_type,name):
54  if (name == "thisown"): return self.this.own()
55  method = class_type.__swig_getmethods__.get(name,None)
56  if method: return method(self)
57  raise AttributeError(name)
58 
59 def _swig_repr(self):
60  try: strthis = "proxy of " + self.this.__repr__()
61  except: strthis = ""
62  return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
63 
64 try:
65  _object = object
66  _newclass = 1
67 except AttributeError:
68  class _object : pass
69  _newclass = 0
70 
71 
72 try:
73  import weakref
74  weakref_proxy = weakref.proxy
75 except:
76  weakref_proxy = lambda x: x
77 
78 
79 class IMP_BENCHMARK_SwigPyIterator(_object):
80  """Proxy of C++ swig::IMP_BENCHMARK_SwigPyIterator class"""
81  __swig_setmethods__ = {}
82  __setattr__ = lambda self, name, value: _swig_setattr(self, IMP_BENCHMARK_SwigPyIterator, name, value)
83  __swig_getmethods__ = {}
84  __getattr__ = lambda self, name: _swig_getattr(self, IMP_BENCHMARK_SwigPyIterator, name)
85  def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
86  __repr__ = _swig_repr
87  __swig_destroy__ = _IMP_benchmark.delete_IMP_BENCHMARK_SwigPyIterator
88  __del__ = lambda self : None;
89  def value(self):
90  """value(IMP_BENCHMARK_SwigPyIterator self) -> PyObject *"""
91  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_value(self)
92 
93  def incr(self, n=1):
94  """
95  incr(IMP_BENCHMARK_SwigPyIterator self, size_t n=1) -> IMP_BENCHMARK_SwigPyIterator
96  incr(IMP_BENCHMARK_SwigPyIterator self) -> IMP_BENCHMARK_SwigPyIterator
97  """
98  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_incr(self, n)
99 
100  def decr(self, n=1):
101  """
102  decr(IMP_BENCHMARK_SwigPyIterator self, size_t n=1) -> IMP_BENCHMARK_SwigPyIterator
103  decr(IMP_BENCHMARK_SwigPyIterator self) -> IMP_BENCHMARK_SwigPyIterator
104  """
105  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_decr(self, n)
106 
107  def distance(self, *args):
108  """distance(IMP_BENCHMARK_SwigPyIterator self, IMP_BENCHMARK_SwigPyIterator x) -> ptrdiff_t"""
109  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_distance(self, *args)
110 
111  def equal(self, *args):
112  """equal(IMP_BENCHMARK_SwigPyIterator self, IMP_BENCHMARK_SwigPyIterator x) -> bool"""
113  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_equal(self, *args)
114 
115  def copy(self):
116  """copy(IMP_BENCHMARK_SwigPyIterator self) -> IMP_BENCHMARK_SwigPyIterator"""
117  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_copy(self)
118 
119  def next(self):
120  """next(IMP_BENCHMARK_SwigPyIterator self) -> PyObject *"""
121  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_next(self)
122 
123  def __next__(self):
124  """__next__(IMP_BENCHMARK_SwigPyIterator self) -> PyObject *"""
125  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___next__(self)
126 
127  def previous(self):
128  """previous(IMP_BENCHMARK_SwigPyIterator self) -> PyObject *"""
129  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_previous(self)
130 
131  def advance(self, *args):
132  """advance(IMP_BENCHMARK_SwigPyIterator self, ptrdiff_t n) -> IMP_BENCHMARK_SwigPyIterator"""
133  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_advance(self, *args)
134 
135  def __eq__(self, *args):
136  """__eq__(IMP_BENCHMARK_SwigPyIterator self, IMP_BENCHMARK_SwigPyIterator x) -> bool"""
137  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___eq__(self, *args)
138 
139  def __ne__(self, *args):
140  """__ne__(IMP_BENCHMARK_SwigPyIterator self, IMP_BENCHMARK_SwigPyIterator x) -> bool"""
141  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___ne__(self, *args)
142 
143  def __iadd__(self, *args):
144  """__iadd__(IMP_BENCHMARK_SwigPyIterator self, ptrdiff_t n) -> IMP_BENCHMARK_SwigPyIterator"""
145  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___iadd__(self, *args)
146 
147  def __isub__(self, *args):
148  """__isub__(IMP_BENCHMARK_SwigPyIterator self, ptrdiff_t n) -> IMP_BENCHMARK_SwigPyIterator"""
149  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___isub__(self, *args)
150 
151  def __add__(self, *args):
152  """__add__(IMP_BENCHMARK_SwigPyIterator self, ptrdiff_t n) -> IMP_BENCHMARK_SwigPyIterator"""
153  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___add__(self, *args)
154 
155  def __sub__(self, *args):
156  """
157  __sub__(IMP_BENCHMARK_SwigPyIterator self, ptrdiff_t n) -> IMP_BENCHMARK_SwigPyIterator
158  __sub__(IMP_BENCHMARK_SwigPyIterator self, IMP_BENCHMARK_SwigPyIterator x) -> ptrdiff_t
159  """
160  return _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator___sub__(self, *args)
161 
162  def __iter__(self): return self
163 IMP_BENCHMARK_SwigPyIterator_swigregister = _IMP_benchmark.IMP_BENCHMARK_SwigPyIterator_swigregister
164 IMP_BENCHMARK_SwigPyIterator_swigregister(IMP_BENCHMARK_SwigPyIterator)
165 
166 _value_types=[]
167 _object_types=[]
168 _raii_types=[]
169 _plural_types=[]
170 
171 IMP_DEBUG = _IMP_benchmark.IMP_DEBUG
172 IMP_RELEASE = _IMP_benchmark.IMP_RELEASE
173 IMP_SILENT = _IMP_benchmark.IMP_SILENT
174 IMP_PROGRESS = _IMP_benchmark.IMP_PROGRESS
175 IMP_TERSE = _IMP_benchmark.IMP_TERSE
176 IMP_VERBOSE = _IMP_benchmark.IMP_VERBOSE
177 IMP_MEMORY = _IMP_benchmark.IMP_MEMORY
178 IMP_NONE = _IMP_benchmark.IMP_NONE
179 IMP_USAGE = _IMP_benchmark.IMP_USAGE
180 IMP_INTERNAL = _IMP_benchmark.IMP_INTERNAL
181 IMP_BASE_HAS_LOG4CXX = _IMP_benchmark.IMP_BASE_HAS_LOG4CXX
182 IMP_COMPILER_HAS_AUTO = _IMP_benchmark.IMP_COMPILER_HAS_AUTO
183 IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_benchmark.IMP_COMPILER_HAS_DEBUG_VECTOR
184 IMP_BASE_HAS_BOOST_RANDOM = _IMP_benchmark.IMP_BASE_HAS_BOOST_RANDOM
185 IMP_BASE_HAS_GPERFTOOLS = _IMP_benchmark.IMP_BASE_HAS_GPERFTOOLS
186 IMP_BASE_HAS_TCMALLOC_HEAPCHECKER = _IMP_benchmark.IMP_BASE_HAS_TCMALLOC_HEAPCHECKER
187 IMP_BASE_HAS_TCMALLOC_HEAPPROFILER = _IMP_benchmark.IMP_BASE_HAS_TCMALLOC_HEAPPROFILER
188 IMPBASE_SHOW_WARNINGS = _IMP_benchmark.IMPBASE_SHOW_WARNINGS
189 import sys
190 class _DirectorObjects(object):
191  """@internal Simple class to keep references to director objects
192  to prevent premature deletion."""
193  def __init__(self):
194  self._objects = []
195  def register(self, obj):
196  """Take a reference to a director object; will only work for
197  refcounted C++ classes"""
198  if hasattr(obj, 'get_ref_count'):
199  self._objects.append(obj)
200  def cleanup(self):
201  """Only drop our reference and allow cleanup by Python if no other
202  Python references exist (we hold 3 references: one in self._objects,
203  one in x, and one in the argument list for getrefcount) *and* no
204  other C++ references exist (the Python object always holds one)"""
205  objs = [x for x in self._objects if sys.getrefcount(x) > 3 \
206  or x.get_ref_count() > 1]
207 
208 
209  self._objects = objs
210  def get_object_count(self):
211  """Get number of director objects (useful for testing only)"""
212  return len(self._objects)
213 _director_objects = _DirectorObjects()
214 
215 DEFAULT_CHECK = _IMP_benchmark.DEFAULT_CHECK
216 NONE = _IMP_benchmark.NONE
217 USAGE = _IMP_benchmark.USAGE
218 USAGE_AND_INTERNAL = _IMP_benchmark.USAGE_AND_INTERNAL
219 
220 def set_check_level(*args):
221  """set_check_level(IMP::base::CheckLevel tf)"""
222  return _IMP_benchmark.set_check_level(*args)
223 
224 def get_check_level():
225  """get_check_level() -> IMP::base::CheckLevel"""
226  return _IMP_benchmark.get_check_level()
227 class _ostream(_object):
228  """Proxy of C++ std::ostream class"""
229  __swig_setmethods__ = {}
230  __setattr__ = lambda self, name, value: _swig_setattr(self, _ostream, name, value)
231  __swig_getmethods__ = {}
232  __getattr__ = lambda self, name: _swig_getattr(self, _ostream, name)
233  def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
234  __repr__ = _swig_repr
235  def write(self, *args):
236  """write(_ostream self, char const * osa_buf)"""
237  return _IMP_benchmark._ostream_write(self, *args)
238 
239 _ostream_swigregister = _IMP_benchmark._ostream_swigregister
240 _ostream_swigregister(_ostream)
241 
242 IMP_COMPILER_HAS_OVERRIDE = _IMP_benchmark.IMP_COMPILER_HAS_OVERRIDE
243 IMP_COMPILER_HAS_FINAL = _IMP_benchmark.IMP_COMPILER_HAS_FINAL
244 IMP_HAS_NOEXCEPT = _IMP_benchmark.IMP_HAS_NOEXCEPT
245 import IMP.base
246 IMP_BENCHMARK_HAS_BOOST_FILESYSTEM = _IMP_benchmark.IMP_BENCHMARK_HAS_BOOST_FILESYSTEM
247 IMP_BENCHMARK_HAS_BOOST_PROGRAMOPTIONS = _IMP_benchmark.IMP_BENCHMARK_HAS_BOOST_PROGRAMOPTIONS
248 IMP_BENCHMARK_HAS_BOOST_RANDOM = _IMP_benchmark.IMP_BENCHMARK_HAS_BOOST_RANDOM
249 IMP_BENCHMARK_HAS_BOOST_SYSTEM = _IMP_benchmark.IMP_BENCHMARK_HAS_BOOST_SYSTEM
250 IMPBENCHMARK_SHOW_WARNINGS = _IMP_benchmark.IMPBENCHMARK_SHOW_WARNINGS
251 _raii_types.append("Profiler")
252 
253 
254 def report(*args):
255  """
256  report(std::string benchmark, std::string algorithm, double time, double check)
257  report(std::string benchmark, double time, double check)
258  """
259  return _IMP_benchmark.report(*args)
260 
261 def get_return_value():
262  """get_return_value() -> int"""
263  return _IMP_benchmark.get_return_value()
264 class Profiler(IMP.base._RAII):
265  """Proxy of C++ IMP::benchmark::Profiler class"""
266  __swig_setmethods__ = {}
267  for _s in [IMP.base._RAII]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
268  __setattr__ = lambda self, name, value: _swig_setattr(self, Profiler, name, value)
269  __swig_getmethods__ = {}
270  for _s in [IMP.base._RAII]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
271  __getattr__ = lambda self, name: _swig_getattr(self, Profiler, name)
272  def __init__(self, *args):
273  """
274  __init__(IMP::benchmark::Profiler self) -> Profiler
275  __init__(IMP::benchmark::Profiler self, std::string name) -> Profiler
276  """
277  this = _IMP_benchmark.new_Profiler(*args)
278  try: self.this.append(this)
279  except: self.this = this
280  def set(self, *args):
281  """set(Profiler self, std::string name)"""
282  return _IMP_benchmark.Profiler_set(self, *args)
283 
284  def reset(self):
285  """reset(Profiler self)"""
286  return _IMP_benchmark.Profiler_reset(self)
287 
288  __swig_destroy__ = _IMP_benchmark.delete_Profiler
289  __del__ = lambda self : None;
290  def show(self, *args):
291  """
292  show(Profiler self, _ostream out=std::cout)
293  show(Profiler self)
294  """
295  return _IMP_benchmark.Profiler_show(self, *args)
296 
297  def __str__(self):
298  """__str__(Profiler self) -> std::string"""
299  return _IMP_benchmark.Profiler___str__(self)
300 
301  def __repr__(self):
302  """__repr__(Profiler self) -> std::string"""
303  return _IMP_benchmark.Profiler___repr__(self)
304 
305 Profiler_swigregister = _IMP_benchmark.Profiler_swigregister
306 Profiler_swigregister(Profiler)
307 
308 
309 def get_module_version():
310  """get_module_version() -> std::string const"""
311  return _IMP_benchmark.get_module_version()
312 
313 def get_example_path(*args):
314  """get_example_path(std::string fname) -> std::string"""
315  return _IMP_benchmark.get_example_path(*args)
316 
317 def get_data_path(*args):
318  """get_data_path(std::string fname) -> std::string"""
319  return _IMP_benchmark.get_data_path(*args)
320 import _version_check
321 _version_check.check_version(get_module_version())
322 
323 # This file is compatible with both classic and new-style classes.
324 
325 
void report(std::string benchmark, std::string algorithm, double time, double check)
Report a benchmark result in a standard way.
void set_check_level(CheckLevel tf)
Control runtime checks in the code.
See IMP.base for more information.
Definition: base/Array.h:20
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.
CheckLevel get_check_level()
Get the current audit mode.