Skip to content

Commit

Permalink
Fix nbsphinx integration and documentation build
Browse files Browse the repository at this point in the history
  • Loading branch information
minesh1291 committed Feb 16, 2025
1 parent 56ca7d5 commit 6effba0
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 15 deletions.
33 changes: 18 additions & 15 deletions docs/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
sphinx==7.1.2
sphinx-rtd-theme==1.3.0
sphinx-autodoc-typehints==1.25.2
sphinx-copybutton==0.5.2
myst-parser==2.0.0
nbsphinx==0.9.3
sphinx-design==0.5.0
ipython
jupyter
matplotlib
numpy
pandas
scikit-learn
scipy
faiss-cpu
sphinx>=7.1.2
sphinx-rtd-theme>=1.3.0
sphinx-autodoc-typehints>=1.25.2
sphinx-copybutton>=0.5.2
myst-parser>=2.0.0
nbsphinx>=0.9.3
sphinx-design>=0.5.0
pandoc>=2.3
ipython>=8.0.0
jupyter>=1.0.0
jupyter-client>=8.0.0
nbconvert>=7.0.0
matplotlib>=3.7.0
numpy>=1.24.0
pandas>=2.0.0
scikit-learn>=1.3.0
scipy>=1.10.0
faiss-cpu>=1.7.4
11 changes: 11 additions & 0 deletions docs/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
'myst_parser',
'nbsphinx',
'sphinx_design',
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive',
]

# nbsphinx configuration
nbsphinx_input_prompt = 'In [%s]:'
nbsphinx_output_prompt = 'Out[%s]:'
nbsphinx_timeout = 60
nbsphinx_execute_arguments = [
"--InlineBackend.figure_formats={'svg', 'pdf'}",
"--InlineBackend.rc={'figure.dpi': 96}",
]

templates_path = ['_templates']
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/source/examples/anomaly_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
"language": "python",
"name": "python3"
},
"nbsphinx": {
"execute": "never"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/source/examples/pattern_recognition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
"language": "python",
"name": "python3"
},
"nbsphinx": {
"execute": "never"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand Down
82 changes: 82 additions & 0 deletions docs/docs/source/examples/quickstart.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Quick Start Guide\n",
"\n",
"This notebook provides a quick introduction to Time Series RAG."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"source": [
"import numpy as np\n",
"from timeseries_rag.models import TimeSeriesEmbedder\n",
"from timeseries_rag.rag import TimeSeriesRAG, TimeSeriesDocument\n",
"\n",
"# Create sample data\n",
"t = np.linspace(0, 10, 100)\n",
"sine_wave = np.sin(t)\n",
"\n",
"# Initialize components\n",
"embedder = TimeSeriesEmbedder()\n",
"rag = TimeSeriesRAG()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Add Data to RAG System"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"source": [
"# Generate embedding\n",
"embedding = embedder.embed(sine_wave)\n",
"\n",
"# Create document\n",
"doc = TimeSeriesDocument(\n",
" id=\"sine_1\",\n",
" data=sine_wave,\n",
" metadata={\"type\": \"sine\", \"frequency\": 1.0},\n",
" embedding=embedding\n",
")\n",
"\n",
"# Add to RAG system\n",
"rag.add_document(doc)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
},
"nbsphinx": {
"execute": "never"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
1 change: 1 addition & 0 deletions docs/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Welcome to Time Series RAG's documentation!
:caption: Contents:

readme
examples/quickstart
modules/models
modules/rag
modules/api
Expand Down

0 comments on commit 6effba0

Please sign in to comment.