doc_inherit decorator
Usage:
@doc_inherit def foo(self):
pass
Now, Bar.foo.__doc__ == Bar().foo.__doc__ == Foo.foo.__doc__ == “Frobber”
Bases: object
Docstring inheriting method descriptor
The class itself is also used as a decorator
Methods
| get_no_inst(cls) | |
| get_with_inst(obj, cls) | |
| use_parent_doc(func, source) |
alias of DocInherit
Bases: _abcoll.MutableSet
Set that remembers original insertion order
Based on the following code: http://code.activestate.com/recipes/576694/
Methods
| add(key) | |
| clear() | This is slow (creates N new iterators!) but effective. |
| discard(key) | |
| isdisjoint(other) | Return True if two sets have a null intersection. |
| pop([last]) | |
| remove(value) | Remove an element. |
Bases: TASSELpy.utils.OrderedSet.OrderedSet
Methods
| add(key) | |
| clear() | This is slow (creates N new iterators!) but effective. |
| discard(key) | |
| isdisjoint(other) | Return True if two sets have a null intersection. |
| pop([last]) | |
| remove(value) | Remove an element. |
Bases: dict
Methods
| clear(() -> None. Remove all items from D.) | |
| copy(() -> a shallow copy of D) | |
| fromkeys(...) | v defaults to None. |
| get((k[,d]) -> D[k] if k in D, ...) | |
| has_key((k) -> True if D has a key k, else False) | |
| items(() -> list of D’s (key, value) pairs, ...) | |
| iteritems(() -> an iterator over the (key, ...) | |
| iterkeys(() -> an iterator over the keys of D) | |
| itervalues(...) | |
| keys(() -> list of D’s keys) | |
| pop((k[,d]) -> v, ...) | If key is not found, d is returned if given, otherwise KeyError is raised |
| popitem(() -> (k, v), ...) | 2-tuple; but raise KeyError if D is empty. |
| setdefault((k[,d]) -> D.get(k,d), ...) | |
| update(([E, ...) | If E present and has a .keys() method, does: for k in E: D[k] = E[k] |
| values(() -> list of D’s values) | |
| viewitems(...) | |
| viewkeys(...) | |
| viewvalues(...) |
Bases: object
Creates a function decorator for a javabridge function that is a constructor for an instantiated class
Arguments:
class_name – The name of the java class, as in path/to/class args – tuples of form (java signature,(python arg types))
e.g. (“(I)V”,(int,))
Methods
| __call__(f) |
Bases: object
Creates a function decorator for a javabridge function that is the member of a class and returns and/or accepts a generic type
Arguments:
func_name – The name of the java function args – tuples of form (java_signature, (python arg types),post_process_func)
Java signatures should have java/lang/Object where generic types go.
In the Python arg types, a generic types specified as, say (type1,type2) in the generic argument of the constructor should be specified as a string “/@1/” or “/@2/”, corresponding to type1 and type2 respectively.
In the post_process_func, you can specify None or a function as usual in order to deal with pre-specified types. Alternatively, you can put in the string “/@1/” or whatever the corresponding string is for a given type in order to send the return object through the constructor of that type (e.g. type1(obj=x)). In the case of types that should receive generic arguments, you can specify a dictionary with ‘type’ and ‘generic’ keys. For instance, to send the return object to a wrapper class named MyClass that should receive type1 as its one and only generic type argument, you can put in the following dictionary:
dict(type=MyClass, generic=(“/@1/”,))
Methods
| __call__(f) |
Creates a function decorator for a javabridge function that is the member of a class
Arguments:
func_name – The name of the java function args – tuples of form (java_signature, (python arg types or None),post_process_func)
For java signature, put /@/ sign where the actual type of the generic should be placed. For python args/return type put None where it should be Note that if the returned type is the generic, the post-process function will cast to the specified type unless otherwise specified e.g. (“(/@/)I”,(None,),None) or (“(/@/)[L”,(None,),lambda x: javabridge.get_env().get_long_array_elements(x))
Bases: object
Creates a function decorator for a javabridge function that is the member of a class
Arguments:
func_name – The name of the java function args – tuples of form (java_signature, (python arg types),post_process_func)
e.g. (“(I)I”,(int,),None) or (“(I)[L”,(int,),lambda x: javabridge.get_env().get_long_array_elements(x))
Methods
| __call__(f) |
Creates a function decorator for a javabridge function that is the member of a class
Arguments:
func_name – The name of the java function args – tuples of form (java_signature, (python arg types),post_process_func)
e.g. (“(I)I”,(int,),None) or (“(I)[L”,(int,),lambda x: javabridge.get_env().get_long_array_elements(x))
Bases: object
Creates a function decorator for a javabridge static function
Arguments:
class_name – The name of the java class containing the method, as in path/to/class func_name – The name of the java function args – tuples of form (java signature, (python arg types), post process function)
e.g. (“(I)I”,(int,),None) or (“(I)[L”,(int,),lambda x: javabridge.get_env().get_long_array_elements(x))
Methods
| __call__(f) |
Creates a function decorator for a javabridge static function
Arguments:
class_name – The name of the java class containing the method, as in path/to/class func_name – The name of the java function args – tuples of form (java signature, (python arg types), post process function)
e.g. (“(I)I”,(int,),None) or (“(I)[L”,(int,),lambda x: javabridge.get_env().get_long_array_elements(x))
Bases: dict
Methods
| clear(() -> None. Remove all items from D.) | |
| copy(() -> a shallow copy of D) | |
| fromkeys(...) | v defaults to None. |
| get((k[,d]) -> D[k] if k in D, ...) | |
| has_key((k) -> True if D has a key k, else False) | |
| items(() -> list of D’s (key, value) pairs, ...) | |
| iteritems(() -> an iterator over the (key, ...) | |
| iterkeys(() -> an iterator over the keys of D) | |
| itervalues(...) | |
| keys(() -> list of D’s keys) | |
| pop((k[,d]) -> v, ...) | If key is not found, d is returned if given, otherwise KeyError is raised |
| popitem(() -> (k, v), ...) | 2-tuple; but raise KeyError if D is empty. |
| setdefault((k[,d]) -> D.get(k,d), ...) | |
| update(([E, ...) | If E present and has a .keys() method, does: for k in E: D[k] = E[k] |
| values(() -> list of D’s values) | |
| viewitems(...) | |
| viewkeys(...) | |
| viewvalues(...) |
Bases: dict
A least recently used cache
Methods
| clear(() -> None. Remove all items from D.) | |
| copy(() -> a shallow copy of D) | |
| fromkeys(...) | v defaults to None. |
| get((k[,d]) -> D[k] if k in D, ...) | |
| has_key((k) -> True if D has a key k, else False) | |
| items(() -> list of D’s (key, value) pairs, ...) | |
| iteritems(() -> an iterator over the (key, ...) | |
| iterkeys(() -> an iterator over the keys of D) | |
| itervalues(...) | |
| keys(() -> list of D’s keys) | |
| pop((k[,d]) -> v, ...) | If key is not found, d is returned if given, otherwise KeyError is raised |
| popitem(() -> (k, v), ...) | 2-tuple; but raise KeyError if D is empty. |
| setdefault((k[,d]) -> D.get(k,d), ...) | |
| update(([E, ...) | If E present and has a .keys() method, does: for k in E: D[k] = E[k] |
| values(() -> list of D’s values) | |
| viewitems(...) | |
| viewkeys(...) | |
| viewvalues(...) |
Bases: object
A list of items that have pointers to previous and succeeding items
Methods
| append(element) | Appends an element to the linked list |
| getFirst() | Gets the first element in the linked list |
| getLast() | Gets the last element in the linked list |
| pop() | Gets and removes the last element in the linked list |
| popleft() | Gets and removes the first element in the linked list |
| removeNode(node) | Removes a node from the linked list |
Appends an element to the linked list
| Parameters: | element : object
|
|---|
Gets the last element in the linked list
| Returns: | The last element in the linked list |
|---|
Gets and removes the last element in the linked list
| Returns: | The last element in the list |
|---|
Bases: object
A node in a double linked list
Methods
| getElement() | Gets the element for this node |
| getPredecessor() | Gets the predecessor of the node |
| getSuccessor() | Gets the successor node |
| setElement(element) | Sets the element in this node |
| setPredecessor(predecessor) | Sets the predecessor of the node |
| setSuccessor(successor) | Sets the successor of the node |
Sets the element in this node
| Parameters: | element : object
|
|---|
Constructs the signature needed by javabridge for a function
Arguments:
Returns:
The signature for the java constructor
Constructs the signature needed by javabridge for a function
Arguments:
return_type – The return type of the function, specified in the same way as the arguments
Returns:
The signature for the java method
Bases: TASSELpy.javaObj.javaArray
Wraps arrays of primative types
Methods
| getArray(size) | Gets an empty wrapped java array that can accept the type of the wrapped |
| getDblArray(rows[, cols]) | Gets an empty wrapped java array that can accept the type of other wrapped java arrays: i.e. |
| get_array_type(primative_name) | |
| make_array(primative_name, length) | Makes a wrapped java array for some java primative |
| make_array_from_obj(primative_name, obj) | Sends a returned java object of a wrapped java array |
| make_dbl_array(primative_name, rows[, cols]) | Makes an empty wrapped java array that can accept the type of other wrapped java arrays of a primative type: e.g. |
| to_numpy_array() | Makes a numpy array copy of the Java primative array |
| to_wrapped_array(arr_instance, pyType) | Wraps a current array |
| wrap_existing_array(arr_instance) | Wraps a java array of this class’s type |
Makes a wrapped java array for some java primative
Arguments:
primative_name – The name of the java primative (e.g. ‘int’) length – The length of the array
Returns:
The wrapped java array
Sends a returned java object of a wrapped java array
Arguments:
primative_name – The name of the java primative (e.g. ‘int’) obj – The java object
Returns:
The wrapped java array
Makes an empty wrapped java array that can accept the type of other wrapped java arrays of a primative type: e.g. double[][]
Arguments:
rows – The number of rows that should be in the array (the first dimension) cols – The number of columns that should be in the array (if not specified, the
array objects will not be instantiated at these locations)
Returns:
An instance of an array of arrays
Makes a numpy array copy of the Java primative array
Returns:
Numpy array containing data
Bases: object
Attributes
| java_arr_type |
Bases: object
Attributes
| java_arr_type |
Bases: object
Attributes
| java_arr_type |