Skip to content
New: Star-import, signal unraveling, Python 3.12 support, and more

#
preparing module

Classes for preparing arguments.

## base_arg_config ReadonlyConfig

Argument config for BasePreparer.

    ReadonlyConfig(
        broadcast_named_args=dict(
            is_dict=True
        ),
        broadcast_kwargs=dict(
            is_dict=True
        ),
        template_context=dict(
            is_dict=True
        ),
        seed=dict(),
        jitted=dict(),
        chunked=dict(),
        staticized=dict(),
        records=dict()
    )

## BasePreparer class

    BasePreparer(
        arg_config=None,
        **kwargs
    )

Base class for preparing target functions and arguments.

Warning

Most properties are force-cached - create a new instance to override any attribute.

Superclasses

- Cacheable
- Chainable
- Comparable
- Configured
- HasSettings
- Pickleable
- Prettified

Inherited members

- Cacheable.get_ca_setup()
- Chainable.pipe()
- Configured.config
- Configured.copy()
- Configured.equals()
- Configured.get_writeable_attrs()
- Configured.prettify()
- Configured.rec_state
- Configured.replace()
- Configured.resolve_merge_kwargs()
- Configured.update_config()
- HasSettings.get_path_setting()
- HasSettings.get_path_settings()
- HasSettings.get_setting()
- HasSettings.get_settings()
- HasSettings.has_path_setting()
- HasSettings.has_path_settings()
- HasSettings.has_setting()
- HasSettings.has_settings()
- HasSettings.reset_settings()
- HasSettings.resolve_setting()
- HasSettings.resolve_settings_paths()
- HasSettings.set_settings()
- Pickleable.decode_config()
- Pickleable.decode_config_node()
- Pickleable.dumps()
- Pickleable.encode_config()
- Pickleable.encode_config_node()
- Pickleable.file_exists()
- Pickleable.getsize()
- Pickleable.load()
- Pickleable.loads()
- Pickleable.modify_state()
- Pickleable.resolve_file_path()
- Pickleable.save()

Subclasses

- BasePFPreparer

### adapt_staticized_to_udf class method

    BasePreparer.adapt_staticized_to_udf(
        staticized,
        func,
        func_name
    )

Adapt `staticized` dictionary to a UDF.

### arg_config class variable

Argument config of BasePreparer.

    HybridConfig(
        broadcast_named_args=dict(
            is_dict=True
        ),
        broadcast_kwargs=dict(
            is_dict=True
        ),
        template_context=dict(
            is_dict=True
        ),
        seed=dict(),
        jitted=dict(),
        chunked=dict(),
        staticized=dict(),
        records=dict()
    )

### args_to_broadcast method

Arguments to broadcast.

### broadcast_kwargs method

Argument `broadcast_kwargs`.

### broadcast_named_args method

Argument `broadcast_named_args`.

### broadcast_result method

Result of broadcasting.

### build_arg_config_doc class method

    BasePreparer.build_arg_config_doc(
        source_cls=None
    )

Build argument config documentation.

### chunked method

Argument `chunked`.

### def_broadcast_kwargs method

Default keyword arguments for broadcasting.

### dt_arr_to_ns class method

    BasePreparer.dt_arr_to_ns(
        dt_arr
    )

Prepare a datetime array.

### find_target_func class method

    BasePreparer.find_target_func(
        target_func_name
    )

Find target function by its name.

### freq method

Frequency in nanosecond format.

### get_arg method

    BasePreparer.get_arg(
        arg_name,
        use_idx_setter=True,
        use_default=True
    )

Get mapped argument according to the argument config.

### get_arg_default method

    BasePreparer.get_arg_default(
        arg_name
    )

Get argument default according to the argument config.

### get_raw_arg method

    BasePreparer.get_raw_arg(
        arg_name,
        is_dict=False,
        has_default=True
    )

Get raw argument.

### get_raw_arg_default method

    BasePreparer.get_raw_arg_default(
        arg_name,
        is_dict=False
    )

Get raw argument default.

### idx_setters method

Index setters from resolving the argument `records`.

### index method

Index in nanosecond format.

### jitted method

Argument `jitted`.

### map_enum_value class method

    BasePreparer.map_enum_value(
        value,
        look_for_type=None,
        **kwargs
    )

Map enumerated value(s).

### override_arg_config_doc class method

    BasePreparer.override_arg_config_doc(
        __pdoc__,
        source_cls=None
    )

Call this method on each subclass that overrides BasePreparer.arg_config.

### post_args method

Arguments after broadcasting.

### post_broadcast_named_args method

Custom arguments after broadcasting.

### pre_args method

Arguments before broadcasting.

### prepare_dt_obj class method

    BasePreparer.prepare_dt_obj(
        dt_obj,
        last_before=None
    )

Prepare a datetime object for broadcasting.

### prepare_post_arg method

    BasePreparer.prepare_post_arg(
        arg_name,
        value=None
    )

Prepare an argument after broadcasting and/or template substitution.

### prepare_td_obj class method

    BasePreparer.prepare_td_obj(
        td_obj
    )

Prepare a timedelta object for broadcasting.

### records method

Argument `records`.

### resolve_dynamic_target_func class method

    BasePreparer.resolve_dynamic_target_func(
        target_func_name,
        staticized
    )

Resolve a dynamic target function.

### seed method

Argument `seed`.

### set_seed method

    BasePreparer.set_seed()

Set seed.

### staticized method

Argument `staticized`.

### target_arg_map method

Map of the target arguments to the preparer attributes.

### target_args method

Arguments to be passed to the target function.

### target_func method

Target function.

### target_shape method

Target shape.

### td_arr_to_ns class method

    BasePreparer.td_arr_to_ns(
        td_arr
    )

Prepare a timedelta array.

### template_context method

Argument `template_context`.

### wrapper method

Array wrapper.

## MetaArgs class

    MetaArgs(
        *args,
        **kwargs
    )

Meta class that exposes a read-only class property MetaArgs.arg_config.

Superclasses

- `builtins.type`

### arg_config property

Argument config.

#### Cookie consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.

- Google Analytics
- GitHub

Manage settings