/[escript]/trunk/ripley/src/ripleycpp.cpp
ViewVC logotype

Contents of /trunk/ripley/src/ripleycpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4657 - (show annotations)
Thu Feb 6 06:12:20 2014 UTC (5 years, 8 months ago) by jfenwick
File size: 22039 byte(s)
I changed some files.
Updated copyright notices, added GeoComp.



1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #include <ripley/Brick.h>
18 #include <ripley/Rectangle.h>
19 #include <esysUtils/esysExceptionTranslator.h>
20
21 #include <boost/python.hpp>
22 #include <boost/python/module.hpp>
23 #include <boost/python/def.hpp>
24 #include <boost/python/detail/defaults_gen.hpp>
25 #include <boost/version.hpp>
26
27 using namespace boost::python;
28
29 namespace ripley {
30
31 template<typename T>
32 std::vector<T> extractPyArray(const object& obj, const std::string& name,
33 int expectedLength=0)
34 {
35 std::vector<T> result;
36 if (extract<tuple>(obj).check() || extract<list>(obj).check()) {
37 if (expectedLength==0 || len(obj)==expectedLength) {
38 for (int i=0; i<len(obj); i++) {
39 result.push_back(extract<T>(obj[i]));
40 }
41 } else {
42 std::stringstream ssError;
43 ssError << "argument '" << name << "' has wrong length";
44 std::string error(ssError.str());
45 throw RipleyException(error.c_str());
46 }
47 } else {
48 std::stringstream ssError;
49 ssError << "argument '" << name << "' must be a tuple or list";
50 std::string error(ssError.str());
51 throw RipleyException(error.c_str());
52 }
53
54 return result;
55 }
56
57 escript::Data readBinaryGrid(std::string filename, escript::FunctionSpace fs,
58 const object& pyShape, double fill, int byteOrder, int dataType,
59 const object& pyFirst, const object& pyNum, const object& pyMultiplier,
60 const object& pyReverse)
61 {
62 int dim=fs.getDim();
63 ReaderParameters params;
64
65 params.first = extractPyArray<int>(pyFirst, "first", dim);
66 params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
67 params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
68 params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
69 params.byteOrder = byteOrder;
70 params.dataType = dataType;
71 std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
72
73 const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
74 if (!dom)
75 throw RipleyException("Function space must be on a ripley domain");
76
77 escript::Data res(fill, shape, fs, true);
78 dom->readBinaryGrid(res, filename, params);
79 return res;
80 }
81
82 escript::Data readNcGrid(std::string filename, std::string varname,
83 escript::FunctionSpace fs, const object& pyShape, double fill,
84 const object& pyFirst, const object& pyNum, const object& pyMultiplier,
85 const object& pyReverse)
86 {
87 int dim=fs.getDim();
88 ReaderParameters params;
89
90 params.first = extractPyArray<int>(pyFirst, "first", dim);
91 params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
92 params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
93 params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
94 std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
95
96 const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
97 if (!dom)
98 throw RipleyException("Function space must be on a ripley domain");
99
100 escript::Data res(fill, shape, fs, true);
101 dom->readNcGrid(res, filename, varname, params);
102 return res;
103 }
104
105 // These wrappers are required to make the shared pointers work through the
106 // Python wrapper
107
108 // The double for n? is just to keep python happy when people need to deal with
109 // truediv
110 escript::Domain_ptr _brick(double _n0, double _n1, double _n2, const object& l0,
111 const object& l1, const object& l2, int d0, int d1, int d2,
112 const object& objpoints, const object& objtags)
113 {
114 int n0=static_cast<int>(_n0), n1=static_cast<int>(_n1), n2=static_cast<int>(_n2);
115 double x0=0., x1=1., y0=0., y1=1., z0=0., z1=1.;
116 if (extract<tuple>(l0).check()) {
117 tuple x=extract<tuple>(l0);
118 if (len(x)==2) {
119 x0=extract<double>(x[0]);
120 x1=extract<double>(x[1]);
121 } else
122 throw RipleyException("Argument l0 must be a float or 2-tuple");
123 } else if (extract<double>(l0).check()) {
124 x1=extract<double>(l0);
125 } else
126 throw RipleyException("Argument l0 must be a float or 2-tuple");
127
128 if (extract<tuple>(l1).check()) {
129 tuple y=extract<tuple>(l1);
130 if (len(y)==2) {
131 y0=extract<double>(y[0]);
132 y1=extract<double>(y[1]);
133 } else
134 throw RipleyException("Argument l1 must be a float or 2-tuple");
135 } else if (extract<double>(l1).check()) {
136 y1=extract<double>(l1);
137 } else
138 throw RipleyException("Argument l1 must be a float or 2-tuple");
139
140 if (extract<tuple>(l2).check()) {
141 tuple z=extract<tuple>(l2);
142 if (len(z)==2) {
143 z0=extract<double>(z[0]);
144 z1=extract<double>(z[1]);
145 } else
146 throw RipleyException("Argument l2 must be a float or 2-tuple");
147 } else if (extract<double>(l2).check()) {
148 z1=extract<double>(l2);
149 } else
150 throw RipleyException("Argument l2 must be a float or 2-tuple");
151
152 boost::python::list pypoints=extract<boost::python::list>(objpoints);
153 boost::python::list pytags=extract<boost::python::list>(objtags);
154 int numpts=extract<int>(pypoints.attr("__len__")());
155 int numtags=extract<int>(pytags.attr("__len__")());
156 std::vector<double> points;
157 std::vector<int> tags;
158 tags.resize(numtags, -1);
159 for (int i=0;i<numpts;++i) {
160 boost::python::object temp=pypoints[i];
161 int l=extract<int>(temp.attr("__len__")());
162 for (int k=0;k<l;++k) {
163 points.push_back(extract<double>(temp[k]));
164 }
165 }
166 std::map<std::string, int> tagstonames;
167 int curmax=40;
168 // but which order to assign tags to names?????
169 for (int i=0;i<numtags;++i) {
170 extract<int> ex_int(pytags[i]);
171 extract<std::string> ex_str(pytags[i]);
172 if (ex_int.check()) {
173 tags[i]=ex_int();
174 if (tags[i]>= curmax) {
175 curmax=tags[i]+1;
176 }
177 } else if (ex_str.check()) {
178 std::string s=ex_str();
179 std::map<std::string, int>::iterator it=tagstonames.find(s);
180 if (it!=tagstonames.end()) {
181 // we have the tag already so look it up
182 tags[i]=it->second;
183 } else {
184 tagstonames[s]=curmax;
185 tags[i]=curmax;
186 curmax++;
187 }
188 } else {
189 throw RipleyException("Error - Unable to extract tag value.");
190 }
191 }
192 return escript::Domain_ptr(new Brick(n0,n1,n2, x0,y0,z0, x1,y1,z1, d0,d1,d2,
193 points, tags, tagstonames));
194 }
195
196 const int _q[]={0x61686969,0x746c4144,0x79616e43};
197 escript::Domain_ptr _rectangle(double _n0, double _n1, const object& l0,
198 const object& l1, int d0, int d1,
199 const object& objpoints, const object& objtags)
200 {
201 int n0=static_cast<int>(_n0), n1=static_cast<int>(_n1);
202 double x0=0., x1=1., y0=0., y1=1.;
203 if (extract<tuple>(l0).check()) {
204 tuple x=extract<tuple>(l0);
205 if (len(x)==2) {
206 x0=extract<double>(x[0]);
207 x1=extract<double>(x[1]);
208 } else
209 throw RipleyException("Argument l0 must be a float or 2-tuple");
210 } else if (extract<double>(l0).check()) {
211 x1=extract<double>(l0);
212 } else
213 throw RipleyException("Argument l0 must be a float or 2-tuple");
214
215 if (extract<tuple>(l1).check()) {
216 tuple y=extract<tuple>(l1);
217 if (len(y)==2) {
218 y0=extract<double>(y[0]);
219 y1=extract<double>(y[1]);
220 } else
221 throw RipleyException("Argument l1 must be a float or 2-tuple");
222 } else if (extract<double>(l1).check()) {
223 y1=extract<double>(l1);
224 } else
225 throw RipleyException("Argument l1 must be a float or 2-tuple");
226
227 boost::python::list pypoints=extract<boost::python::list>(objpoints);
228 boost::python::list pytags=extract<boost::python::list>(objtags);
229 int numpts=extract<int>(pypoints.attr("__len__")());
230 int numtags=extract<int>(pytags.attr("__len__")());
231 std::vector<double> points;
232 std::vector<int> tags;
233 tags.resize(numtags, -1);
234 for (int i=0;i<numpts;++i) {
235 boost::python::object temp=pypoints[i];
236 int l=extract<int>(temp.attr("__len__")());
237 for (int k=0;k<l;++k) {
238 points.push_back(extract<double>(temp[k]));
239 }
240 }
241 std::map<std::string, int> tagstonames;
242 int curmax=40;
243 // but which order to assign tags to names?????
244 for (int i=0;i<numtags;++i) {
245 extract<int> ex_int(pytags[i]);
246 extract<std::string> ex_str(pytags[i]);
247 if (ex_int.check()) {
248 tags[i]=ex_int();
249 if (tags[i]>= curmax) {
250 curmax=tags[i]+1;
251 }
252 } else if (ex_str.check()) {
253 std::string s=ex_str();
254 std::map<std::string, int>::iterator it=tagstonames.find(s);
255 if (it!=tagstonames.end()) {
256 // we have the tag already so look it up
257 tags[i]=it->second;
258 } else {
259 tagstonames[s]=curmax;
260 tags[i]=curmax;
261 curmax++;
262 }
263 } else {
264 throw RipleyException("Error - Unable to extract tag value.");
265 }
266 }
267 return escript::Domain_ptr(new Rectangle(n0,n1, x0,y0, x1,y1, d0,d1,
268 points, tags, tagstonames));
269 }
270 std::string _who(){int a[]={_q[0]^42,_q[1]^42,_q[2]^42,0};return (char*)&a[0];}
271
272 } // end of namespace ripley
273
274
275 BOOST_PYTHON_MODULE(ripleycpp)
276 {
277 // This feature was added in boost v1.34
278 #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
279 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
280 docstring_options docopt(true, true, false);
281 #endif
282
283 register_exception_translator<ripley::RipleyException>(&(esysUtils::esysExceptionTranslator));
284
285 scope().attr("__doc__") = "To use this module, please import esys.ripley";
286 scope().attr("BYTEORDER_NATIVE") = (int)ripley::BYTEORDER_NATIVE;
287 scope().attr("BYTEORDER_LITTLE_ENDIAN") = (int)ripley::BYTEORDER_LITTLE_ENDIAN;
288 scope().attr("BYTEORDER_BIG_ENDIAN") = (int)ripley::BYTEORDER_BIG_ENDIAN;
289 scope().attr("DATATYPE_INT32") = (int)ripley::DATATYPE_INT32;
290 scope().attr("DATATYPE_FLOAT32") = (int)ripley::DATATYPE_FLOAT32;
291 scope().attr("DATATYPE_FLOAT64") = (int)ripley::DATATYPE_FLOAT64;
292
293 def("Brick", ripley::_brick, (arg("n0"),arg("n1"),arg("n2"),arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,arg("d0")=-1,arg("d1")=-1,arg("d2")=-1,arg("diracPoints")=list(),arg("diracTags")=list()),
294 "Creates a hexagonal mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].\n\n"
295 ":param n0: number of elements in direction 0\n:type n0: ``int``\n"
296 ":param n1: number of elements in direction 1\n:type n1: ``int``\n"
297 ":param n2: number of elements in direction 2\n:type n2: ``int``\n"
298 ":param l0: length of side 0 or coordinate range of side 0\n:type l0: ``float`` or ``tuple``\n"
299 ":param l1: length of side 1 or coordinate range of side 1\n:type l1: ``float`` or ``tuple``\n"
300 ":param l2: length of side 2 or coordinate range of side 2\n:type l2: ``float`` or ``tuple``\n"
301 ":param d0: number of subdivisions in direction 0\n:type d0: ``int``\n"
302 ":param d1: number of subdivisions in direction 1\n:type d1: ``int``\n"
303 ":param d2: number of subdivisions in direction 2\n:type d2: ``int``");
304
305 def("Rectangle", ripley::_rectangle, (arg("n0"),arg("n1"),arg("l0")=1.0,arg("l1")=1.0,arg("d0")=-1,arg("d1")=-1,arg("diracPoints")=list(),arg("diracTags")=list()),
306 "Creates a rectangular mesh with n0 x n1 elements over the rectangle [0,l0] x [0,l1].\n\n"
307 ":param n0: number of elements in direction 0\n:type n0: ``int``\n"
308 ":param n1: number of elements in direction 1\n:type n1: ``int``\n"
309 ":param l0: length of side 0 or coordinate range of side 0\n:type l0: ``float`` or ``tuple``\n"
310 ":param l1: length of side 1 or coordinate range of side 1\n:type l1: ``float`` or ``tuple``\n"
311 ":param d0: number of subdivisions in direction 0\n:type d0: ``int``\n"
312 ":param d1: number of subdivisions in direction 1\n:type d1: ``int``");
313 def("_theculprit_", ripley::_who);
314
315 def("_readBinaryGrid", &ripley::readBinaryGrid, (arg("filename"),
316 arg("functionspace"), arg("shape"), arg("fill")=0.,
317 arg("byteOrder"), arg("dataType"), arg("first"),
318 arg("numValues"), arg("multiplier"), arg("reverse")),
319 "Reads a binary Grid");
320
321 def("_readNcGrid", &ripley::readNcGrid, (arg("filename"), arg("varname"),
322 arg("functionspace"), arg("shape"), arg("fill"), arg("first"),
323 arg("numValues"), arg("multiplier"), arg("reverse")),
324 "Reads a grid from a netCDF file");
325
326 class_<ripley::RipleyDomain, bases<escript::AbstractContinuousDomain>, boost::noncopyable >
327 ("RipleyDomain", "", no_init)
328 .def("print_mesh_info", &ripley::RipleyDomain::Print_Mesh_Info, (arg("full")=false),
329 "Prints out a summary about the mesh.\n"
330 ":param full: whether to output additional data\n:type full: ``bool``")
331 .def("writeBinaryGrid", &ripley::RipleyDomain::writeBinaryGrid)
332
333 .def("dump", &ripley::RipleyDomain::dump, args("filename"),
334 "Dumps the mesh to a file with the given name.")
335 .def("getGridParameters", &ripley::RipleyDomain::getGridParameters,
336 "Returns the tuple (origin, spacing, elements) where the entries are tuples:\n"
337 "``origin``=the coordinates of the domain's global origin,\n"
338 "``spacing``=the element size (=node spacing) of the domain,\n"
339 "``elements``=the global number of elements in all dimensions\n\n"
340 ":rtype: ``tuple``")
341 .def("getDescription", &ripley::RipleyDomain::getDescription,
342 ":return: a description for this domain\n:rtype: ``string``")
343 .def("getDim", &ripley::RipleyDomain::getDim, ":rtype: ``int``")
344 .def("getDataShape", &ripley::RipleyDomain::getDataShape, args("functionSpaceCode"),
345 ":return: a pair (dps, ns) where dps=the number of data points per sample, and ns=the number of samples\n:rtype: ``tuple``")
346 .def("getNumDataPointsGlobal", &ripley::RipleyDomain::getNumDataPointsGlobal,
347 ":return: the number of data points summed across all MPI processes\n"
348 ":rtype: ``int``")
349 .def("addToSystem",&ripley::RipleyDomain::addToSystemFromPython,
350 args("mat", "rhs", "data"),
351 "adds a PDE to the system, results depend on domain\n\n"
352 ":param mat:\n:type mat: `OperatorAdapter`\n"
353 ":param rhs:\n:type rhs: `Data`\n"
354 ":param data:\ntype data: `list`")
355 .def("addPDEToSystem",&ripley::RipleyDomain::addPDEToSystem,
356 args("mat", "rhs", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
357 "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
358 ":param mat:\n:type mat: `OperatorAdapter`\n:param rhs:\n:type rhs: `Data`\n"
359 ":param A:\n:type A: `Data`\n"
360 ":param B:\n:type B: `Data`\n"
361 ":param C:\n:type C: `Data`\n"
362 ":param D:\n:type D: `Data`\n"
363 ":param X:\n:type X: `Data`\n"
364 ":param Y:\n:type Y: `Data`\n"
365 ":param d:\n:type d: `Data`\n"
366 ":param d_contact:\n:type d_contact: `Data`\n"
367 ":param y_contact:\n:type y_contact: `Data`"
368 )
369
370 .def("addPDEToRHS",&ripley::RipleyDomain::addPDEToRHS,
371 args("rhs", "X", "Y", "y", "y_contact"),
372 "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
373 ":param rhs:\n:type rhs: `Data`\n"
374 ":param X:\n:type X: `Data`\n"
375 ":param Y:\n:type Y: `Data`\n"
376 ":param y:\n:type y: `Data`\n"
377 ":param y_contact:\n:type y_contact: `Data`"
378 )
379 .def("addToRHS",&ripley::RipleyDomain::addToRHSFromPython,
380 args("rhs", "data"),
381 "adds a PDE onto the stiffness matrix mat and a rhs, "
382 "results depends on domain\n\n"
383 ":param rhs:\n:type rhs: `Data`\n"
384 ":param data:\ntype data: `list`")
385 .def("setAssembler", &ripley::RipleyDomain::setAssemblerFromPython,
386 args("typename", "options"),
387 "sets the domain to use the named assembler, if supported, using"
388 "the options if provided"
389 ":param typename:\n:type typename: `string`\n"
390 ":param options:\n:type options: `list`\n")
391 .def("addPDEToTransportProblem",&ripley::RipleyDomain::addPDEToTransportProblem,
392 args( "tp", "source", "M", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
393 ":param tp:\n:type tp: `TransportProblemAdapter`\n"
394 ":param source:\n:type source: `Data`\n"
395 ":param M:\n:type M: `Data`\n"
396 ":param A:\n:type A: `Data`\n"
397 ":param B:\n:type B: `Data`\n"
398 ":param C:\n:type C: `Data`\n"
399 ":param D:\n:type D: `Data`\n"
400 ":param X:\n:type X: `Data`\n"
401 ":param Y:\n:type Y: `Data`\n"
402 ":param d:\n:type d: `Data`\n"
403 ":param y:\n:type y: `Data`\n"
404 ":param d_contact:\n:type d_contact: `Data`\n"
405 ":param y_contact:\n:type y_contact: `Data`"
406 )
407 .def("newOperator",&ripley::RipleyDomain::newSystemMatrix,
408 args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),
409 "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"
410 ":param row_blocksize:\n:type row_blocksize: ``int``\n"
411 ":param row_functionspace:\n:type row_functionspace: `FunctionSpace`\n"
412 ":param column_blocksize:\n:type column_blocksize: ``int``\n"
413 ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"
414 ":param type:\n:type type: ``int``"
415 )
416 .def("newTransportProblem",&ripley::RipleyDomain::newTransportProblem,
417 args("theta", "blocksize", "functionspace", "type"),
418 "creates a TransportProblemAdapter\n\n"
419 ":param theta:\n:type theta: ``float``\n"
420 ":param blocksize:\n:type blocksize: ``int``\n"
421 ":param functionspace:\n:type functionspace: `FunctionSpace`\n"
422 ":param type:\n:type type: ``int``"
423 )
424 .def("getSystemMatrixTypeId",&ripley::RipleyDomain::getSystemMatrixTypeId,
425 args("solver", "preconditioner", "package", "symmetry"),
426 ":return: the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, preconditioner, and symmetric matrix is used.\n"
427 ":rtype: ``int``\n"
428 ":param solver:\n:type solver: ``int``\n"
429 ":param preconditioner:\n:type preconditioner: ``int``\n"
430 ":param package:\n:type package: ``int``\n"
431 ":param symmetry:\n:type symmetry: ``int``"
432 )
433 .def("getTransportTypeId",&ripley::RipleyDomain::getTransportTypeId,
434 args("solver", "preconditioner", "package", "symmetry"),
435 ":return: the identifier of the transport problem type to be used when a particular solver, preconditioner, package and symmetric matrix is used.\n"
436 ":rtype: ``int``\n"
437 ":param solver:\n:type solver: ``int``\n"
438 ":param preconditioner:\n:type preconditioner: ``int``\n"
439 ":param package:\n:type package: ``int``\n"
440 ":param symmetry:\n:type symmetry: ``int``"
441 )
442 .def("getX",&ripley::RipleyDomain::getX, ":return: locations in the FEM nodes\n\n"
443 ":rtype: `Data`")
444 .def("getNormal",&ripley::RipleyDomain::getNormal,
445 ":return: boundary normals at the quadrature point on the face elements\n"
446 ":rtype: `Data`")
447 .def("getSize",&ripley::RipleyDomain::getSize,":return: the element size\n"
448 ":rtype: `Data`")
449 .def("setTagMap",&ripley::RipleyDomain::setTagMap,args("name","tag"),
450 "Give a tag number a name.\n\n:param name: Name for the tag\n:type name: ``string``\n"
451 ":param tag: numeric id\n:type tag: ``int``\n:note: Tag names must be unique within a domain")
452 .def("getTag",&ripley::RipleyDomain::getTag,args("name"),":return: tag id for "
453 "``name``\n:rtype: ``string``")
454 .def("isValidTagName",&ripley::RipleyDomain::isValidTagName,args("name"),
455 ":return: True if ``name`` corresponds to a tag, otherwise False\n:rtype: ``bool``")
456 .def("showTagNames",&ripley::RipleyDomain::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")
457 .def("getMPISize",&ripley::RipleyDomain::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")
458 .def("getMPIRank",&ripley::RipleyDomain::getMPIRank,":return: the rank of this process\n:rtype: ``int``")
459 .def("MPIBarrier",&ripley::RipleyDomain::MPIBarrier,"Wait until all processes have reached this point")
460 .def("onMasterProcessor",&ripley::RipleyDomain::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");
461
462 class_<ripley::Brick, bases<ripley::RipleyDomain> >("RipleyBrick", "", no_init)
463 .def("randomFill", &ripley::Brick::randomFill,":return: random data\n:rtype: `Data`\n:param seed: pass zero to use system generated seed\n:type seed: `int`\n"
464 ":param details: more info about the type of randomness\nCurrently, the only acceptable value for this tuple is ('gaussian', r, s) where r is the radius of the"
465 "guassian blur and s is the sigma parameter."
466 );
467 class_<ripley::Rectangle, bases<ripley::RipleyDomain> >("RipleyRectangle", "", no_init)
468 .def("randomFill", &ripley::Rectangle::randomFill,":return: random data\n:rtype: `Data`\n:param seed: pass zero to use system generated seed\n:type seed: `int`\n"
469 ":param details: more info about the type of randomness\nCurrently, the only acceptable value for this tuple is ('gaussian', r, s) where r is the radius of the"
470 "guassian blur and s is the sigma parameter."
471 );
472 }
473

  ViewVC Help
Powered by ViewVC 1.1.26