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.
Superclasses
Inherited members
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 class 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
- Base.chat
- Base.find_api
- Base.find_assets
- Base.find_docs
- Base.find_examples
- Base.find_messages
- DefineMixin.asdict
- DefineMixin.assert_field_not_missing
- DefineMixin.fields
- DefineMixin.fields_dict
- 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 field¶
Chunkable function.
options field¶
Options dictionary.
setup_id field¶
Setup id.
tags field¶
Set of tags.