> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Base

> systematica.tools.schedulers.base

## `BaseScheduler`

```python theme={null}
BaseScheduler()
```

Base Report scheduler analytics.

### Ancestors

* `abc.ABC`

### Descendants

* `systematica.tools.schedulers.reports.ReportScheduler`
* `systematica.tools.schedulers.trades.TradeScheduler`

### Static methods

#### `pull_data`

```python theme={null}
pull_data(
    loader: vectorbtpro.data.base.Data,
    params: Dict[str, Any],
) ‑> vectorbtpro.data.base.Data
```

Pull data.

**Parameters**:

| Name     | Type        | Default | Description        |
| -------- | ----------- | ------- | ------------------ |
| `loader` | `vbt.Data`  | `--`    | Loader class.      |
| `params` | `tp.Kwargs` | `--`    | Loader parameters. |

**Returns**:

| Type       | Description                                                   |
| ---------- | ------------------------------------------------------------- |
| `vbt.Data` | A vbt.Data object containing historical data for each symbol. |

#### `update_data`

```python theme={null}
update_data(
    data: vectorbtpro.data.base.Data,
    freq: str = None,
) ‑> vectorbtpro.data.base.Data
```

Update data.

Fetches new data for each feature/symbol.

**Parameters**:

| Name   | Type       | Default | Description                    |
| ------ | ---------- | ------- | ------------------------------ |
| `data` | `vbt.Data` | `--`    | Current data object.           |
| `freq` | `str`      | `--`    | Frequency to resample data to. |

**Returns**:

| Type       | Description                                                   |
| ---------- | ------------------------------------------------------------- |
| `vbt.Data` | A vbt.Data object containing historical data for each symbol. |

#### `run_task`

```python theme={null}
run_task(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    timeframe: str = '1h',
    offset: str = None,
    channel: str = None,
    **kwargs,
) ‑> schedule.Scheduler
```

Run task. Use `SlackMessenger` by default.

Specify a particular time that the job should be run at. The format
must make sense given how often the job is repeating. More info
could be found in `schedule`.

* For daily jobs -> `HH:MM:SS` or `HH:MM`
* For hourly jobs -> `MM:SS` or `:MM`
* For minute jobs -> `:SS`

**Parameters**:

| Name            | Type           | Default | Description                                                                                        |
| --------------- | -------------- | ------- | -------------------------------------------------------------------------------------------------- |
| `template`      | `str`          | `--`    | Template name.                                                                                     |
| `loader_cls`    | `vbt.Data`     | `--`    | Data loader.                                                                                       |
| `loader_params` | `tp.Kwargs`    | `--`    | Data loader params.                                                                                |
| `model_cls`     | `tp.Any`       | `--`    | Model class.                                                                                       |
| `all_params`    | `tp.Kwargs`    | `--`    | Model params.                                                                                      |
| `timeframe`     | `pd.Timedelta` | `1h`    | Timeframe used in the template for loading data. Defaults to `1h`.                                 |
| `offset`        | `str`          | `None`  | Optional offset for hourly/multi-hourly jobs. If `None`, it defaults to `:00`. Defaults to `None`. |
| `channel`       | `str`          | `None`  | Messenger channel to use. The default is `C08KQFF50GH`.                                            |
| `kwargs`        | `tp.Kwargs`    | `--`    | Additional key-word arguments.                                                                     |

**Returns**:

| Type                 | Description |
| -------------------- | ----------- |
| `schedule.Scheduler` | Scheduler.  |

#### `run_thread`

```python theme={null}
run_thread(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    timeframe: str = '1h',
    offset: str = None,
    channel: str = None,
    **kwargs,
) ‑> schedule.Scheduler
```

Run task. Use `SlackMessenger` by default.

Specify a particular time that the job should be run at. The format
must make sense given how often the job is repeating. More info
could be found in `schedule`.

* For daily jobs -> `HH:MM:SS` or `HH:MM`
* For hourly jobs -> `MM:SS` or `:MM`
* For minute jobs -> `:SS`

**Parameters**:

| Name            | Type           | Default | Description                                                                                        |
| --------------- | -------------- | ------- | -------------------------------------------------------------------------------------------------- |
| `template`      | `str`          | `--`    | Template name.                                                                                     |
| `loader_cls`    | `vbt.Data`     | `--`    | Data loader.                                                                                       |
| `loader_params` | `tp.Kwargs`    | `--`    | Data loader params.                                                                                |
| `model_cls`     | `tp.Any`       | `--`    | Model class.                                                                                       |
| `all_params`    | `tp.Kwargs`    | `--`    | Model params.                                                                                      |
| `timeframe`     | `pd.Timedelta` | `1h`    | Timeframe used in the template for loading data. Defaults to `1h`.                                 |
| `offset`        | `str`          | `None`  | Optional offset for hourly/multi-hourly jobs. If `None`, it defaults to `:00`. Defaults to `None`. |
| `channel`       | `str`          | `None`  | Messenger channel to use. The default is `C08KQFF50GH`.                                            |
| `kwargs`        | `tp.Kwargs`    | `--`    | Additional key-word arguments.                                                                     |

**Returns**:

| Type                 | Description |
| -------------------- | ----------- |
| `schedule.Scheduler` | Scheduler.  |

#### `run_process`

```python theme={null}
run_process(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    timeframe: str = '1h',
    offset: str = None,
    channel: str = None,
    **kwargs,
) ‑> schedule.Scheduler
```

Run task. Use `SlackMessenger` by default.

Specify a particular time that the job should be run at. The format
must make sense given how often the job is repeating. More info
could be found in `schedule`.

* For daily jobs -> `HH:MM:SS` or `HH:MM`
* For hourly jobs -> `MM:SS` or `:MM`
* For minute jobs -> `:SS`

**Parameters**:

| Name            | Type           | Default | Description                                                                                        |
| --------------- | -------------- | ------- | -------------------------------------------------------------------------------------------------- |
| `template`      | `str`          | `--`    | Template name.                                                                                     |
| `loader_cls`    | `vbt.Data`     | `--`    | Data loader.                                                                                       |
| `loader_params` | `tp.Kwargs`    | `--`    | Data loader params.                                                                                |
| `model_cls`     | `tp.Any`       | `--`    | Model class.                                                                                       |
| `all_params`    | `tp.Kwargs`    | `--`    | Model params.                                                                                      |
| `timeframe`     | `pd.Timedelta` | `1h`    | Timeframe used in the template for loading data. Defaults to `1h`.                                 |
| `offset`        | `str`          | `None`  | Optional offset for hourly/multi-hourly jobs. If `None`, it defaults to `:00`. Defaults to `None`. |
| `channel`       | `str`          | `None`  | Messenger channel to use. The default is `C08KQFF50GH`. kwargs Additional key-word arguments.      |

**Returns**:

| Type                 | Description |
| -------------------- | ----------- |
| `schedule.Scheduler` | Scheduler.  |

### Methods

#### `execute`

```python theme={null}
execute(
    self,
    *args,
    **kwargs,
)
```

Abstract method to Generate and post a scheduled report.

This method should be implemented in subclasses to define the specific
logic for generating and posting reports.

**Parameters**:

| Name     | Type        | Default | Description                                  |
| -------- | ----------- | ------- | -------------------------------------------- |
| `args`   | `tuple`     | `--`    | Positional arguments for the execute method. |
| `kwargs` | `tp.Kwargs` | `--`    | Keyword arguments for the execute method.    |

#### `job`

```python theme={null}
job(
    self,
)
```

Job to run the scheduler.

This method initializes the logger, measures execution time, and calls
the `execute` method to perform the scheduled task.

It also logs the elapsed time and peak RAM usage after execution.
