{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "70a32352-80c9-40b7-8f68-1aeecfc52658", "metadata": { "ExecuteTime": { "end_time": "2024-04-27T10:05:25.636065Z", "start_time": "2024-04-27T10:05:25.632244Z" }, "execution": { "iopub.execute_input": "2025-01-06T14:54:51.218123Z", "iopub.status.busy": "2025-01-06T14:54:51.217792Z", "iopub.status.idle": "2025-01-06T14:54:51.226882Z", "shell.execute_reply": "2025-01-06T14:54:51.225419Z" }, "papermill": { "duration": 0.017633, "end_time": "2025-01-06T14:54:51.228549", "exception": false, "start_time": "2025-01-06T14:54:51.210916", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "# Import to be able to import python package from src\n", "import sys\n", "sys.path.insert(0, '../src')" ] }, { "cell_type": "code", "execution_count": 2, "id": "f8a26d78-229f-47f7-9f66-d0c245dbc096", "metadata": { "ExecuteTime": { "end_time": "2024-04-27T10:05:29.654652Z", "start_time": "2024-04-27T10:05:25.635956Z" }, "execution": { "iopub.execute_input": "2025-01-06T14:54:51.239921Z", "iopub.status.busy": "2025-01-06T14:54:51.239602Z", "iopub.status.idle": "2025-01-06T14:55:01.447783Z", "shell.execute_reply": "2025-01-06T14:55:01.446539Z" }, "papermill": { "duration": 10.215408, "end_time": "2025-01-06T14:55:01.449362", "exception": false, "start_time": "2025-01-06T14:54:51.233954", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "import ontime as on\n", "import pandas as pd" ] }, { "cell_type": "markdown", "id": "9f94ac2b-bc8a-4757-affb-6e570a024804", "metadata": { "papermill": { "duration": 0.003865, "end_time": "2025-01-06T14:55:01.457052", "exception": false, "start_time": "2025-01-06T14:55:01.453187", "status": "completed" }, "tags": [] }, "source": [ "# Getting Started\n", "\n", "The library is divided in three parts : \n", "\n", "1. `core` for all basic features\n", "2. `module` for all features using core features. E.g. benchmarking, ml preprocessing, etc.\n", "3. `context` for all features related to the usage of onTime in an applied scenario" ] }, { "cell_type": "markdown", "id": "c0271c7d-d9b4-414e-b7be-83adeafcc741", "metadata": { "papermill": { "duration": 0.00426, "end_time": "2025-01-06T14:55:01.465369", "exception": false, "start_time": "2025-01-06T14:55:01.461109", "status": "completed" }, "tags": [] }, "source": [ "## `core` Features\n", "\n", "This is a low level API. Most objects and functions are accessible in the base object : \n", " \n", " ontime\n", " ├── detectors\n", " ├── generators\n", " ├── Model\n", " ├── plots\n", " ├── processors\n", " └── TimeSeries\n", "\n", "For instance : " ] }, { "cell_type": "code", "execution_count": 3, "id": "bcbdae2b-2833-43d6-9bf7-16caef87cf75", "metadata": { "ExecuteTime": { "end_time": "2024-04-27T10:05:29.670567Z", "start_time": "2024-04-27T10:05:29.659699Z" }, "execution": { "iopub.execute_input": "2025-01-06T14:55:01.474817Z", "iopub.status.busy": "2025-01-06T14:55:01.474325Z", "iopub.status.idle": "2025-01-06T14:55:01.502154Z", "shell.execute_reply": "2025-01-06T14:55:01.501007Z" }, "papermill": { "duration": 0.034002, "end_time": "2025-01-06T14:55:01.503475", "exception": false, "start_time": "2025-01-06T14:55:01.469473", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
<TimeSeries (DataArray) (time: 5, component: 1, sample: 1)> Size: 40B\n", "array([[[ 0.8042713 ]],\n", "\n", " [[ 1.58685749]],\n", "\n", " [[ 0.88496745]],\n", "\n", " [[ 1.07890811]],\n", "\n", " [[-0.41554812]]])\n", "Coordinates:\n", " * time (time) datetime64[ns] 40B 2023-01-01 2023-01-02 ... 2023-01-05\n", " * component (component) object 8B 'random_walk'\n", "Dimensions without coordinates: sample\n", "Attributes:\n", " static_covariates: None\n", " hierarchy: None