Skip to content

Commit c71fc14

Browse files
jeremymanningclaude
andcommitted
Add Read the Docs configuration and update documentation setup
- Added .readthedocs.yaml configuration file for RTD builds - Updated docs/conf.py version to 0.2.0 - Updated docs/doc_requirements.txt with compatible versions - Added docs extras_require in setup.py for documentation dependencies - Verified local documentation builds successfully - Cleaned up generated documentation artifacts This should fix the RTD build failure due to missing configuration file. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 828fe48 commit c71fc14

17 files changed

+213
-101
lines changed

.readthedocs.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.11"
12+
jobs:
13+
post_create_environment:
14+
# Install the package in editable mode
15+
- pip install -e .
16+
17+
# Build documentation in the docs/ directory with Sphinx
18+
sphinx:
19+
configuration: docs/conf.py
20+
fail_on_warning: false
21+
22+
# Optionally declare the Python requirements required to build your docs
23+
python:
24+
install:
25+
- requirements: docs/doc_requirements.txt
26+
- requirements: requirements.txt
27+
- method: pip
28+
path: .
29+
extra_requirements:
30+
- docs

docs/auto_examples/calculate_dynamic_correlations.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Code source: Lucy Owen\n# License: MIT\n\n# load timecorr and other packages\nimport timecorr as tc\nimport numpy as np\n\n\nS = 1\nT = 1000\nK = 10\nB = 5\n\n# define your weights parameters\nwidth = 100\nlaplace = {'name': 'Laplace', 'weights': tc.laplace_weights, 'params': {'scale': width}}\n\n# calculate the dynamic correlation of the two datasets\n\nsubs_data_2 = tc.simulate_data(datagen='ramping', return_corrs=False, set_random_seed=1, S=S, T=T, K=K, B=B)\n\nsubs_data_1 = tc.simulate_data(datagen='ramping', return_corrs=False, set_random_seed=2, S=S, T=T, K=K, B=B)\n\n\n\nwcorred_data = tc.wcorr(np.array(subs_data_1), np.array(subs_data_2), weights=laplace['weights'](T))"
18+
"# Code source: Lucy Owen\n# License: MIT\n\nimport numpy as np\n\n# load timecorr and other packages\nimport timecorr as tc\n\nS = 1\nT = 1000\nK = 10\nB = 5\n\n# define your weights parameters\nwidth = 100\nlaplace = {\"name\": \"Laplace\", \"weights\": tc.laplace_weights, \"params\": {\"scale\": width}}\n\n# calculate the dynamic correlation of the two datasets\n\nsubs_data_2 = tc.simulate_data(\n datagen=\"ramping\", return_corrs=False, set_random_seed=1, S=S, T=T, K=K, B=B\n)\n\nsubs_data_1 = tc.simulate_data(\n datagen=\"ramping\", return_corrs=False, set_random_seed=2, S=S, T=T, K=K, B=B\n)\n\n\nwcorred_data = tc.wcorr(\n np.array(subs_data_1), np.array(subs_data_2), weights=laplace[\"weights\"](T)\n)"
1919
]
2020
}
2121
],

docs/auto_examples/calculate_dynamic_correlations.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ Calculate dynamic correlations
2424

2525
In this example, we calculate dynamic correlations
2626

27-
.. GENERATED FROM PYTHON SOURCE LINES 10-35
27+
.. GENERATED FROM PYTHON SOURCE LINES 10-41
2828
2929
.. code-block:: Python
3030
3131
# Code source: Lucy Owen
3232
# License: MIT
3333
34-
# load timecorr and other packages
35-
import timecorr as tc
3634
import numpy as np
3735
36+
# load timecorr and other packages
37+
import timecorr as tc
3838
3939
S = 1
4040
T = 1000
@@ -43,17 +43,23 @@ In this example, we calculate dynamic correlations
4343
4444
# define your weights parameters
4545
width = 100
46-
laplace = {'name': 'Laplace', 'weights': tc.laplace_weights, 'params': {'scale': width}}
46+
laplace = {"name": "Laplace", "weights": tc.laplace_weights, "params": {"scale": width}}
4747
4848
# calculate the dynamic correlation of the two datasets
4949
50-
subs_data_2 = tc.simulate_data(datagen='ramping', return_corrs=False, set_random_seed=1, S=S, T=T, K=K, B=B)
50+
subs_data_2 = tc.simulate_data(
51+
datagen="ramping", return_corrs=False, set_random_seed=1, S=S, T=T, K=K, B=B
52+
)
5153
52-
subs_data_1 = tc.simulate_data(datagen='ramping', return_corrs=False, set_random_seed=2, S=S, T=T, K=K, B=B)
54+
subs_data_1 = tc.simulate_data(
55+
datagen="ramping", return_corrs=False, set_random_seed=2, S=S, T=T, K=K, B=B
56+
)
5357
5458
59+
wcorred_data = tc.wcorr(
60+
np.array(subs_data_1), np.array(subs_data_2), weights=laplace["weights"](T)
61+
)
5562
56-
wcorred_data = tc.wcorr(np.array(subs_data_1), np.array(subs_data_2), weights=laplace['weights'](T))
5763
5864
.. _sphx_glr_download_auto_examples_calculate_dynamic_correlations.py:
5965

docs/auto_examples/decode_by_level.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Code source: Lucy Owen\n# License: MIT\n\n# load timecorr and other packages\nimport timecorr as tc\nimport hypertools as hyp\nimport numpy as np\n\nprint(\"Timepoint Decoding Example\")\nprint(\"=\"*30)\nprint(\"NOTE: This example currently has compatibility issues.\")\nprint(\"Please see docs/auto_examples/decode_by_level.py for a working version.\")\nprint(\"=\"*30)\n\n# load example data\ndata = hyp.load('weights').get_data()\n\n# Convert to numpy array format required by timepoint_decoder\n# timepoint_decoder expects a numpy array with shape (n_subjects, T, K)\ndata_array = np.array(data)\nprint(f\"Data shape: {data_array.shape} (subjects, timepoints, features)\")\n\n# define your weights parameters\nwidth = 10\nlaplace = {'name': 'Laplace', 'weights': tc.laplace_weights, 'params': {'scale': width}}\n\n# set your number of levels\n# if integer, returns decoding accuracy, error, and rank for specified level\nlevel = 2\n\nprint(f\"\\nAttempting timepoint decoding at level {level}...\")\n\ntry:\n # run timecorr with specified functions for calculating correlations, as well as combining and reducing\n results = tc.timepoint_decoder(data_array, level=level, combine=tc.corrmean_combine,\n cfun=tc.isfc, rfun='eigenvector_centrality', weights_fun=laplace['weights'],\n weights_params=laplace['params'])\n \n # returns only decoding results for level 2\n print(\"\u2713 SUCCESS: Level 2 decoding results:\")\n print(results)\n \nexcept Exception as e:\n print(f\"\u2717 ERROR: {e}\")\n print(\"This function has compatibility issues with the current version.\")\n\n# set your number of levels\n# if list or array of integers, returns decoding accuracy, error, and rank for all levels\nlevels = np.arange(int(level) + 1)\n\nprint(f\"\\nAttempting multi-level decoding for levels {levels}...\")\n\ntry:\n # run timecorr with specified functions for calculating correlations, as well as combining and reducing\n results = tc.timepoint_decoder(data_array, level=levels, combine=tc.corrmean_combine,\n cfun=tc.isfc, rfun='eigenvector_centrality', weights_fun=laplace['weights'],\n weights_params=laplace['params'])\n \n # returns decoding results for all levels up to level 2\n print(\"\u2713 SUCCESS: Multi-level decoding results:\")\n print(results)\n \nexcept Exception as e:\n print(f\"\u2717 ERROR: {e}\")\n print(\"This function has compatibility issues with the current version.\")\n\nprint(\"\\n\" + \"=\"*60)\nprint(\"RECOMMENDATION: Use the enhanced version in docs/auto_examples/decode_by_level.py\")\nprint(\"which uses synthetic data and includes comprehensive error handling.\")"
18+
"# Code source: Lucy Owen\n# License: MIT\n\nimport hypertools as hyp\nimport numpy as np\n\n# load timecorr and other packages\nimport timecorr as tc\n\nprint(\"Timepoint Decoding Example\")\nprint(\"=\" * 30)\nprint(\"NOTE: This example currently has compatibility issues.\")\nprint(\"Please see docs/auto_examples/decode_by_level.py for a working version.\")\nprint(\"=\" * 30)\n\n# load example data\ndata = hyp.load(\"weights\").get_data()\n\n# Convert to numpy array format required by timepoint_decoder\n# timepoint_decoder expects a numpy array with shape (n_subjects, T, K)\ndata_array = np.array(data)\nprint(f\"Data shape: {data_array.shape} (subjects, timepoints, features)\")\n\n# define your weights parameters\nwidth = 10\nlaplace = {\"name\": \"Laplace\", \"weights\": tc.laplace_weights, \"params\": {\"scale\": width}}\n\n# set your number of levels\n# if integer, returns decoding accuracy, error, and rank for specified level\nlevel = 2\n\nprint(f\"\\nAttempting timepoint decoding at level {level}...\")\n\ntry:\n # run timecorr with specified functions for calculating correlations, as well as combining and reducing\n results = tc.timepoint_decoder(\n data_array,\n level=level,\n combine=tc.corrmean_combine,\n cfun=tc.isfc,\n rfun=\"eigenvector_centrality\",\n weights_fun=laplace[\"weights\"],\n weights_params=laplace[\"params\"],\n )\n\n # returns only decoding results for level 2\n print(\"\u2713 SUCCESS: Level 2 decoding results:\")\n print(results)\n\nexcept Exception as e:\n print(f\"\u2717 ERROR: {e}\")\n print(\"This function has compatibility issues with the current version.\")\n\n# set your number of levels\n# if list or array of integers, returns decoding accuracy, error, and rank for all levels\nlevels = np.arange(int(level) + 1)\n\nprint(f\"\\nAttempting multi-level decoding for levels {levels}...\")\n\ntry:\n # run timecorr with specified functions for calculating correlations, as well as combining and reducing\n results = tc.timepoint_decoder(\n data_array,\n level=levels,\n combine=tc.corrmean_combine,\n cfun=tc.isfc,\n rfun=\"eigenvector_centrality\",\n weights_fun=laplace[\"weights\"],\n weights_params=laplace[\"params\"],\n )\n\n # returns decoding results for all levels up to level 2\n print(\"\u2713 SUCCESS: Multi-level decoding results:\")\n print(results)\n\nexcept Exception as e:\n print(f\"\u2717 ERROR: {e}\")\n print(\"This function has compatibility issues with the current version.\")\n\nprint(\"\\n\" + \"=\" * 60)\nprint(\n \"RECOMMENDATION: Use the enhanced version in docs/auto_examples/decode_by_level.py\"\n)\nprint(\"which uses synthetic data and includes comprehensive error handling.\")"
1919
]
2020
}
2121
],

docs/auto_examples/decode_by_level.rst

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,27 @@ In this example, we load in some example data, and decode by level of higher ord
2727
NOTE: This example currently has compatibility issues with the timepoint_decoder function.
2828
For a working example, please see the enhanced version in docs/auto_examples/decode_by_level.py
2929

30-
.. GENERATED FROM PYTHON SOURCE LINES 13-81
30+
.. GENERATED FROM PYTHON SOURCE LINES 13-97
3131
3232
.. code-block:: Python
3333
3434
# Code source: Lucy Owen
3535
# License: MIT
3636
37-
# load timecorr and other packages
38-
import timecorr as tc
3937
import hypertools as hyp
4038
import numpy as np
4139
40+
# load timecorr and other packages
41+
import timecorr as tc
42+
4243
print("Timepoint Decoding Example")
43-
print("="*30)
44+
print("=" * 30)
4445
print("NOTE: This example currently has compatibility issues.")
4546
print("Please see docs/auto_examples/decode_by_level.py for a working version.")
46-
print("="*30)
47+
print("=" * 30)
4748
4849
# load example data
49-
data = hyp.load('weights').get_data()
50+
data = hyp.load("weights").get_data()
5051
5152
# Convert to numpy array format required by timepoint_decoder
5253
# timepoint_decoder expects a numpy array with shape (n_subjects, T, K)
@@ -55,7 +56,7 @@ For a working example, please see the enhanced version in docs/auto_examples/dec
5556
5657
# define your weights parameters
5758
width = 10
58-
laplace = {'name': 'Laplace', 'weights': tc.laplace_weights, 'params': {'scale': width}}
59+
laplace = {"name": "Laplace", "weights": tc.laplace_weights, "params": {"scale": width}}
5960
6061
# set your number of levels
6162
# if integer, returns decoding accuracy, error, and rank for specified level
@@ -65,14 +66,20 @@ For a working example, please see the enhanced version in docs/auto_examples/dec
6566
6667
try:
6768
# run timecorr with specified functions for calculating correlations, as well as combining and reducing
68-
results = tc.timepoint_decoder(data_array, level=level, combine=tc.corrmean_combine,
69-
cfun=tc.isfc, rfun='eigenvector_centrality', weights_fun=laplace['weights'],
70-
weights_params=laplace['params'])
71-
69+
results = tc.timepoint_decoder(
70+
data_array,
71+
level=level,
72+
combine=tc.corrmean_combine,
73+
cfun=tc.isfc,
74+
rfun="eigenvector_centrality",
75+
weights_fun=laplace["weights"],
76+
weights_params=laplace["params"],
77+
)
78+
7279
# returns only decoding results for level 2
7380
print("✓ SUCCESS: Level 2 decoding results:")
7481
print(results)
75-
82+
7683
except Exception as e:
7784
print(f"✗ ERROR: {e}")
7885
print("This function has compatibility issues with the current version.")
@@ -85,22 +92,31 @@ For a working example, please see the enhanced version in docs/auto_examples/dec
8592
8693
try:
8794
# run timecorr with specified functions for calculating correlations, as well as combining and reducing
88-
results = tc.timepoint_decoder(data_array, level=levels, combine=tc.corrmean_combine,
89-
cfun=tc.isfc, rfun='eigenvector_centrality', weights_fun=laplace['weights'],
90-
weights_params=laplace['params'])
91-
95+
results = tc.timepoint_decoder(
96+
data_array,
97+
level=levels,
98+
combine=tc.corrmean_combine,
99+
cfun=tc.isfc,
100+
rfun="eigenvector_centrality",
101+
weights_fun=laplace["weights"],
102+
weights_params=laplace["params"],
103+
)
104+
92105
# returns decoding results for all levels up to level 2
93106
print("✓ SUCCESS: Multi-level decoding results:")
94107
print(results)
95-
108+
96109
except Exception as e:
97110
print(f"✗ ERROR: {e}")
98111
print("This function has compatibility issues with the current version.")
99112
100-
print("\n" + "="*60)
101-
print("RECOMMENDATION: Use the enhanced version in docs/auto_examples/decode_by_level.py")
113+
print("\n" + "=" * 60)
114+
print(
115+
"RECOMMENDATION: Use the enhanced version in docs/auto_examples/decode_by_level.py"
116+
)
102117
print("which uses synthetic data and includes comprehensive error handling.")
103118
119+
104120
.. _sphx_glr_download_auto_examples_decode_by_level.py:
105121

106122
.. only:: html

0 commit comments

Comments
 (0)