bluecellulab.utils¶
Utility functions used within BlueCellulab.
Functions
|
A decorator to ensure a function is only called once. |
Classes
|
|
|
Class that represents a MultiProcessing nested pool. |
|
Class that represents a non-daemon process. |
|
- class bluecellulab.utils.NestedPool(processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None)[source]¶
Class that represents a MultiProcessing nested pool.
- Process¶
alias of
NoDaemonProcess
- class bluecellulab.utils.NoDaemonProcess(group=None, target=None, name=None, args=(), kwargs={})[source]¶
Class that represents a non-daemon process.
- property daemon¶
Return whether process is a daemon
- class bluecellulab.utils.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
- default(obj)[source]¶
Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)