ch_registry module¶
Global registry for chunkables.
ch_reg ChunkableRegistry¶
Default registry of type ChunkableRegistry.
register_chunkable function¶
register_chunkable(
func=None,
setup_id=None,
registry=<vectorbtpro.registries.ch_registry.ChunkableRegistry object>,
tags=None,
return_wrapped=False,
**options
)
Register a new chunkable function.
If return_wrapped is True, wraps with the chunked() decorator. Otherwise, leaves the function as-is (preferred).
Options are merged in the following order:
optionsin chunkingsetup_options.{setup_id}in chunkingoptionsoverride_optionsin chunkingoverride_setup_options.{setup_id}in chunking
Note
Calling the register_chunkable() decorator before (or below) the register_jitted() decorator with return_wrapped set to True won't work. Doing the same after (or above) register_jitted() will work for calling the function from Python but not from Numba. Generally, avoid wrapping right away and use ChunkableRegistry.decorate() to perform decoration.
ChunkableRegistry class¶
Class for registering chunkable functions.
decorate method¶
Decorate the setup's function using the chunked() decorator.
Finds setup using ChunkableRegistry.get_setup().
Merges setup's options with options.
Specify target_func to apply the found setup on another function.
get_setup method¶
Get setup by its id or function.
setup_id_or_func can be an identifier or a function. If it's a function, will build the identifier using its module and name.
match_setups method¶
Match setups against an expression with each setup being a context.
register method¶
Register a new setup.
resolve_option method¶
Same as ChunkableRegistry.decorate() but using resolve_chunked().
setups property¶
Dict of registered ChunkedSetup instances by ChunkedSetup.setup_id.
ChunkedSetup class¶
Class that represents a chunkable setup.
Note
Hashed solely by setup_id.
Superclasses
Inherited members
- DefineMixin.asdict()
- DefineMixin.assert_field_not_missing()
- DefineMixin.get_field()
- DefineMixin.hash
- DefineMixin.hash_key
- DefineMixin.is_field_missing()
- DefineMixin.is_field_optional()
- DefineMixin.is_field_required()
- DefineMixin.merge_over()
- DefineMixin.merge_with()
- DefineMixin.replace()
- DefineMixin.resolve()
- DefineMixin.resolve_field()
- Hashable.get_hash()
func class variable¶
Chunkable function.
options class variable¶
Options dictionary.
setup_id class variable¶
Setup id.
tags class variable¶
Set of tags.