IMP logo
IMP Reference Guide  develop.345e71cb9a,2026/08/10
The Integrative Modeling Platform
cgal/__init__.py
1 # This file was automatically generated by SWIG (https://www.swig.org).
2 # Version 4.5.0
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 # This wrapper is part of IMP,
9 # Copyright 2007-2026 IMP Inventors. All rights reserved.
10 
11 
12 
13 
14 import typing
15 import _IMP_cgal
16 
17 import builtins as __builtin__
18 
19 def _swig_repr(self):
20  try:
21  strthis = "proxy of " + self.this.__repr__()
22  except __builtin__.Exception:
23  strthis = ""
24  return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
25 
26 
27 def _swig_setattr_nondynamic_instance_variable(set):
28  def set_instance_attr(self, name, value):
29  if name == "this":
30  set(self, name, value)
31  elif name == "thisown":
32  self.this.own(value)
33  elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
34  set(self, name, value)
35  else:
36  raise AttributeError("You cannot add instance attributes to %s" % self)
37  return set_instance_attr
38 
39 
40 def _swig_setattr_nondynamic_class_variable(set):
41  def set_class_attr(cls, name, value):
42  if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
43  set(cls, name, value)
44  else:
45  raise AttributeError("You cannot add class attributes to %s" % cls)
46  return set_class_attr
47 
48 
49 class _SwigNonDynamicMeta(type):
50  """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
51  __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
52 
53 
54 import weakref
55 
56 class IMP_CGAL_SwigPyIterator(object):
57  r"""Proxy of C++ swig::IMP_CGAL_SwigPyIterator class."""
58 
59  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
60 
61  def __init__(self, *args, **kwargs):
62  raise AttributeError("No constructor defined - class is abstract")
63  __repr__ = _swig_repr
64  __swig_destroy__ = _IMP_cgal.delete_IMP_CGAL_SwigPyIterator
65 
66  def value(self):
67  r"""value(IMP_CGAL_SwigPyIterator self) -> PyObject *"""
68  return _IMP_cgal.IMP_CGAL_SwigPyIterator_value(self)
69 
70  def incr(self, n=1):
71  r"""incr(IMP_CGAL_SwigPyIterator self, size_t n=1) -> IMP_CGAL_SwigPyIterator"""
72  return _IMP_cgal.IMP_CGAL_SwigPyIterator_incr(self, n)
73 
74  def decr(self, n=1):
75  r"""decr(IMP_CGAL_SwigPyIterator self, size_t n=1) -> IMP_CGAL_SwigPyIterator"""
76  return _IMP_cgal.IMP_CGAL_SwigPyIterator_decr(self, n)
77 
78  def distance(self, x):
79  r"""distance(IMP_CGAL_SwigPyIterator self, IMP_CGAL_SwigPyIterator x) -> ptrdiff_t"""
80  return _IMP_cgal.IMP_CGAL_SwigPyIterator_distance(self, x)
81 
82  def equal(self, x):
83  r"""equal(IMP_CGAL_SwigPyIterator self, IMP_CGAL_SwigPyIterator x) -> bool"""
84  return _IMP_cgal.IMP_CGAL_SwigPyIterator_equal(self, x)
85 
86  def copy(self):
87  r"""copy(IMP_CGAL_SwigPyIterator self) -> IMP_CGAL_SwigPyIterator"""
88  return _IMP_cgal.IMP_CGAL_SwigPyIterator_copy(self)
89 
90  def __next__(self):
91  r"""__next__(IMP_CGAL_SwigPyIterator self) -> PyObject *"""
92  return _IMP_cgal.IMP_CGAL_SwigPyIterator___next__(self)
93 
94  def previous(self):
95  r"""previous(IMP_CGAL_SwigPyIterator self) -> PyObject *"""
96  return _IMP_cgal.IMP_CGAL_SwigPyIterator_previous(self)
97 
98  def advance(self, n):
99  r"""advance(IMP_CGAL_SwigPyIterator self, ptrdiff_t n) -> IMP_CGAL_SwigPyIterator"""
100  return _IMP_cgal.IMP_CGAL_SwigPyIterator_advance(self, n)
101 
102  def __eq__(self, x):
103  r"""__eq__(IMP_CGAL_SwigPyIterator self, IMP_CGAL_SwigPyIterator x) -> bool"""
104  return _IMP_cgal.IMP_CGAL_SwigPyIterator___eq__(self, x)
105 
106  def __ne__(self, x):
107  r"""__ne__(IMP_CGAL_SwigPyIterator self, IMP_CGAL_SwigPyIterator x) -> bool"""
108  return _IMP_cgal.IMP_CGAL_SwigPyIterator___ne__(self, x)
109 
110  def __iadd__(self, n):
111  r"""__iadd__(IMP_CGAL_SwigPyIterator self, ptrdiff_t n) -> IMP_CGAL_SwigPyIterator"""
112  return _IMP_cgal.IMP_CGAL_SwigPyIterator___iadd__(self, n)
113 
114  def __isub__(self, n):
115  r"""__isub__(IMP_CGAL_SwigPyIterator self, ptrdiff_t n) -> IMP_CGAL_SwigPyIterator"""
116  return _IMP_cgal.IMP_CGAL_SwigPyIterator___isub__(self, n)
117 
118  def __add__(self, n):
119  r"""__add__(IMP_CGAL_SwigPyIterator self, ptrdiff_t n) -> IMP_CGAL_SwigPyIterator"""
120  return _IMP_cgal.IMP_CGAL_SwigPyIterator___add__(self, n)
121 
122  def __sub__(self, *args):
123  r"""
124  __sub__(IMP_CGAL_SwigPyIterator self, ptrdiff_t n) -> IMP_CGAL_SwigPyIterator
125  __sub__(IMP_CGAL_SwigPyIterator self, IMP_CGAL_SwigPyIterator x) -> ptrdiff_t
126  """
127  return _IMP_cgal.IMP_CGAL_SwigPyIterator___sub__(self, *args)
128  def __iter__(self):
129  return self
130 
131 # Register IMP_CGAL_SwigPyIterator in _IMP_cgal:
132 _IMP_cgal.IMP_CGAL_SwigPyIterator_swigregister(IMP_CGAL_SwigPyIterator)
133 
134 _value_types=[]
135 _object_types=[]
136 _raii_types=[]
137 _plural_types=[]
138 
139 IMP_DEBUG = _IMP_cgal.IMP_DEBUG
140 
141 IMP_RELEASE = _IMP_cgal.IMP_RELEASE
142 
143 IMP_SILENT = _IMP_cgal.IMP_SILENT
144 
145 IMP_PROGRESS = _IMP_cgal.IMP_PROGRESS
146 
147 IMP_TERSE = _IMP_cgal.IMP_TERSE
148 
149 IMP_VERBOSE = _IMP_cgal.IMP_VERBOSE
150 
151 IMP_MEMORY = _IMP_cgal.IMP_MEMORY
152 
153 IMP_NONE = _IMP_cgal.IMP_NONE
154 
155 IMP_USAGE = _IMP_cgal.IMP_USAGE
156 
157 IMP_INTERNAL = _IMP_cgal.IMP_INTERNAL
158 
159 IMP_KERNEL_HAS_LOG4CXX = _IMP_cgal.IMP_KERNEL_HAS_LOG4CXX
160 
161 IMP_COMPILER_HAS_CEREAL_RAW_POINTER = _IMP_cgal.IMP_COMPILER_HAS_CEREAL_RAW_POINTER
162 
163 IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_cgal.IMP_COMPILER_HAS_DEBUG_VECTOR
164 
165 IMP_COMPILER_HAS_RANDOM_SHUFFLE = _IMP_cgal.IMP_COMPILER_HAS_RANDOM_SHUFFLE
166 
167 IMP_COMPILER_HAS_THREE_WAY = _IMP_cgal.IMP_COMPILER_HAS_THREE_WAY
168 
169 IMP_KERNEL_HAS_BOOST_RANDOM = _IMP_cgal.IMP_KERNEL_HAS_BOOST_RANDOM
170 
171 IMP_KERNEL_HAS_NUMPY = _IMP_cgal.IMP_KERNEL_HAS_NUMPY
172 
173 IMP_KERNEL_HAS_BOOST_SYSTEM = _IMP_cgal.IMP_KERNEL_HAS_BOOST_SYSTEM
174 
175 IMP_KERNEL_HAS_GPERFTOOLS = _IMP_cgal.IMP_KERNEL_HAS_GPERFTOOLS
176 
177 IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER = _IMP_cgal.IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER
178 
179 IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER = _IMP_cgal.IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER
180 
181 IMPKERNEL_SHOW_WARNINGS = _IMP_cgal.IMPKERNEL_SHOW_WARNINGS
182 
183 
184 import sys
185 class _DirectorObjects:
186  """@internal Simple class to keep references to director objects
187  to prevent premature deletion."""
188  def __init__(self):
189  self._objects = []
190  def register(self, obj):
191  """Take a reference to a director object; will only work for
192  refcounted C++ classes"""
193  if hasattr(obj, 'get_ref_count'):
194  self._objects.append(obj)
195  def cleanup(self):
196  """Only drop our reference and allow cleanup by Python if no other
197  Python references exist (we hold 3 references: one in self._objects,
198  one in x, and one in the argument list for getrefcount) *and* no
199  other C++ references exist (the Python object always holds one)"""
200  objs = [x for x in self._objects if sys.getrefcount(x) > 3 \
201  or x.get_ref_count() > 1]
202 # Do in two steps so the references are kept until the end of the
203 # function (deleting references may trigger a fresh call to this method)
204  self._objects = objs
205  def get_object_count(self):
206  """Get number of director objects (useful for testing only)"""
207  return len(self._objects)
208 _director_objects = _DirectorObjects()
209 
210 class _ostream(object):
211  r"""Proxy of C++ std::ostream class."""
212 
213  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
214 
215  def __init__(self, *args, **kwargs):
216  raise AttributeError("No constructor defined")
217  __repr__ = _swig_repr
218 
219  def write(self, osa_buf):
220  r"""write(_ostream self, char const * osa_buf)"""
221  return _IMP_cgal._ostream_write(self, osa_buf)
222 
223 # Register _ostream in _IMP_cgal:
224 _IMP_cgal._ostream_swigregister(_ostream)
225 IMP_C_OPEN_BINARY = _IMP_cgal.IMP_C_OPEN_BINARY
226 
227 import IMP
228 IMP_CGAL_HAS_BOOST_FILESYSTEM = _IMP_cgal.IMP_CGAL_HAS_BOOST_FILESYSTEM
229 
230 IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS = _IMP_cgal.IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS
231 
232 IMP_CGAL_HAS_BOOST_RANDOM = _IMP_cgal.IMP_CGAL_HAS_BOOST_RANDOM
233 
234 IMP_CGAL_HAS_NUMPY = _IMP_cgal.IMP_CGAL_HAS_NUMPY
235 
236 IMPCGAL_SHOW_WARNINGS = _IMP_cgal.IMPCGAL_SHOW_WARNINGS
237 
238 
239 def get_module_name():
240  r"""get_module_name() -> std::string const"""
241  return _IMP_cgal.get_module_name()
242 
243 def get_module_version():
244  r"""get_module_version() -> std::string const"""
245  return _IMP_cgal.get_module_version()
246 
247 def get_example_path(fname):
248  r"""get_example_path(std::string fname) -> std::string"""
249  return _IMP_cgal.get_example_path(fname)
250 
251 def get_data_path(fname):
252  r"""get_data_path(std::string fname) -> std::string"""
253  return _IMP_cgal.get_data_path(fname)
254 
255 from . import _version_check
256 _version_check.check_version(get_module_version())
257 __version__ = get_module_version()
258 
259 
std::string get_data_path(std::string file_name)
Return the full path to one of this module's data files.
std::string get_module_version()
Return the version of this module, as a string.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.