drytorch 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. drytorch-0.1.0/.github/workflows/ci.yaml +79 -0
  2. drytorch-0.1.0/.github/workflows/create_version.yaml +87 -0
  3. drytorch-0.1.0/.github/workflows/publish.yaml +42 -0
  4. drytorch-0.1.0/.gitignore +17 -0
  5. drytorch-0.1.0/.pre-commit-config.yaml +58 -0
  6. drytorch-0.1.0/.readthedocs.yaml +12 -0
  7. drytorch-0.1.0/CHANGELOG.md +413 -0
  8. drytorch-0.1.0/LICENSE +21 -0
  9. drytorch-0.1.0/Makefile +14 -0
  10. drytorch-0.1.0/PKG-INFO +170 -0
  11. drytorch-0.1.0/README.md +83 -0
  12. drytorch-0.1.0/STYLE.md +312 -0
  13. drytorch-0.1.0/docs/README_RTD.md +43 -0
  14. drytorch-0.1.0/docs/_static/drytorch_icon.png +0 -0
  15. drytorch-0.1.0/docs/_static/drytorch_logo.png +0 -0
  16. drytorch-0.1.0/docs/_static/drytorch_logo.svg +223 -0
  17. drytorch-0.1.0/docs/api.rst +15 -0
  18. drytorch-0.1.0/docs/conf.py +296 -0
  19. drytorch-0.1.0/docs/index.rst +15 -0
  20. drytorch-0.1.0/docs/protocols.md +147 -0
  21. drytorch-0.1.0/docs/tutorials/data/flower.npy +0 -0
  22. drytorch-0.1.0/docs/tutorials/data.ipynb +390 -0
  23. drytorch-0.1.0/docs/tutorials/data.md +222 -0
  24. drytorch-0.1.0/docs/tutorials/distributed_training.ipynb +236 -0
  25. drytorch-0.1.0/docs/tutorials/distributed_training.md +227 -0
  26. drytorch-0.1.0/docs/tutorials/events.ipynb +483 -0
  27. drytorch-0.1.0/docs/tutorials/events.md +379 -0
  28. drytorch-0.1.0/docs/tutorials/experiments_and_runs.ipynb +545 -0
  29. drytorch-0.1.0/docs/tutorials/experiments_and_runs.md +379 -0
  30. drytorch-0.1.0/docs/tutorials/getting_started.ipynb +755 -0
  31. drytorch-0.1.0/docs/tutorials/getting_started.md +543 -0
  32. drytorch-0.1.0/docs/tutorials/learning.ipynb +496 -0
  33. drytorch-0.1.0/docs/tutorials/learning.md +344 -0
  34. drytorch-0.1.0/docs/tutorials/models.ipynb +416 -0
  35. drytorch-0.1.0/docs/tutorials/models.md +306 -0
  36. drytorch-0.1.0/docs/tutorials/objectives.ipynb +603 -0
  37. drytorch-0.1.0/docs/tutorials/objectives.md +441 -0
  38. drytorch-0.1.0/docs/tutorials/trackers.ipynb +411 -0
  39. drytorch-0.1.0/docs/tutorials/trackers.md +315 -0
  40. drytorch-0.1.0/docs/tutorials/training.ipynb +716 -0
  41. drytorch-0.1.0/docs/tutorials/training.md +552 -0
  42. drytorch-0.1.0/docs/tutorials/typing_support.ipynb +378 -0
  43. drytorch-0.1.0/docs/tutorials/typing_support.md +288 -0
  44. drytorch-0.1.0/docs/tutorials.rst +17 -0
  45. drytorch-0.1.0/pyproject.toml +122 -0
  46. drytorch-0.1.0/ruff.toml +88 -0
  47. drytorch-0.1.0/src/drytorch/__init__.py +165 -0
  48. drytorch-0.1.0/src/drytorch/contrib/__init__.py +1 -0
  49. drytorch-0.1.0/src/drytorch/contrib/optuna.py +265 -0
  50. drytorch-0.1.0/src/drytorch/contrib/torcheval.py +88 -0
  51. drytorch-0.1.0/src/drytorch/contrib/torchmetrics.py +118 -0
  52. drytorch-0.1.0/src/drytorch/core/__init__.py +1 -0
  53. drytorch-0.1.0/src/drytorch/core/exceptions.py +1286 -0
  54. drytorch-0.1.0/src/drytorch/core/experimenting.py +762 -0
  55. drytorch-0.1.0/src/drytorch/core/log_events.py +387 -0
  56. drytorch-0.1.0/src/drytorch/core/protocols.py +508 -0
  57. drytorch-0.1.0/src/drytorch/core/registering.py +227 -0
  58. drytorch-0.1.0/src/drytorch/core/tracking.py +447 -0
  59. drytorch-0.1.0/src/drytorch/lib/__init__.py +1 -0
  60. drytorch-0.1.0/src/drytorch/lib/accumulators.py +163 -0
  61. drytorch-0.1.0/src/drytorch/lib/checkpoints.py +416 -0
  62. drytorch-0.1.0/src/drytorch/lib/evaluations.py +96 -0
  63. drytorch-0.1.0/src/drytorch/lib/gradient_ops.py +646 -0
  64. drytorch-0.1.0/src/drytorch/lib/hooks.py +476 -0
  65. drytorch-0.1.0/src/drytorch/lib/learning.py +163 -0
  66. drytorch-0.1.0/src/drytorch/lib/loading.py +473 -0
  67. drytorch-0.1.0/src/drytorch/lib/models.py +530 -0
  68. drytorch-0.1.0/src/drytorch/lib/monitoring.py +809 -0
  69. drytorch-0.1.0/src/drytorch/lib/objectives.py +1027 -0
  70. drytorch-0.1.0/src/drytorch/lib/runners.py +417 -0
  71. drytorch-0.1.0/src/drytorch/lib/schedulers.py +502 -0
  72. drytorch-0.1.0/src/drytorch/lib/training.py +759 -0
  73. drytorch-0.1.0/src/drytorch/py.typed +0 -0
  74. drytorch-0.1.0/src/drytorch/trackers/__init__.py +1 -0
  75. drytorch-0.1.0/src/drytorch/trackers/base_classes.py +839 -0
  76. drytorch-0.1.0/src/drytorch/trackers/csv.py +309 -0
  77. drytorch-0.1.0/src/drytorch/trackers/hydra.py +120 -0
  78. drytorch-0.1.0/src/drytorch/trackers/logging.py +433 -0
  79. drytorch-0.1.0/src/drytorch/trackers/matplotlib.py +275 -0
  80. drytorch-0.1.0/src/drytorch/trackers/plotly.py +98 -0
  81. drytorch-0.1.0/src/drytorch/trackers/sqlalchemy.py +715 -0
  82. drytorch-0.1.0/src/drytorch/trackers/tensorboard.py +180 -0
  83. drytorch-0.1.0/src/drytorch/trackers/tqdm.py +300 -0
  84. drytorch-0.1.0/src/drytorch/trackers/wandb.py +231 -0
  85. drytorch-0.1.0/src/drytorch/trackers/yaml.py +235 -0
  86. drytorch-0.1.0/src/drytorch/utils/__init__.py +1 -0
  87. drytorch-0.1.0/src/drytorch/utils/apply_ops.py +153 -0
  88. drytorch-0.1.0/src/drytorch/utils/averages.py +86 -0
  89. drytorch-0.1.0/src/drytorch/utils/local_ops.py +151 -0
  90. drytorch-0.1.0/src/drytorch/utils/repr_utils.py +575 -0
  91. drytorch-0.1.0/tests/__init__.py +1 -0
  92. drytorch-0.1.0/tests/conftest.py +111 -0
  93. drytorch-0.1.0/tests/functional/__init__.py +1 -0
  94. drytorch-0.1.0/tests/functional/conftest.py +279 -0
  95. drytorch-0.1.0/tests/functional/contrib/__init__.py +1 -0
  96. drytorch-0.1.0/tests/functional/contrib/test_metrics_compatibility.py +122 -0
  97. drytorch-0.1.0/tests/functional/contrib/test_optuna_reporting.py +85 -0
  98. drytorch-0.1.0/tests/functional/core/__init__.py +1 -0
  99. drytorch-0.1.0/tests/functional/lib/__init__.py +1 -0
  100. drytorch-0.1.0/tests/functional/lib/test_convergence.py +71 -0
  101. drytorch-0.1.0/tests/functional/lib/test_distributed_convergence.py +64 -0
  102. drytorch-0.1.0/tests/functional/lib/test_hyperparameter_tuning.py +112 -0
  103. drytorch-0.1.0/tests/functional/lib/test_training_with_hooks.py +176 -0
  104. drytorch-0.1.0/tests/functional/trackers/__init__.py +1 -0
  105. drytorch-0.1.0/tests/functional/trackers/conftest.py +524 -0
  106. drytorch-0.1.0/tests/functional/trackers/expected_logs/minimal_trackers.txt +7 -0
  107. drytorch-0.1.0/tests/functional/trackers/expected_logs/minimal_trackers_no_tqdm.txt +8 -0
  108. drytorch-0.1.0/tests/functional/trackers/expected_logs/standard_trackers.txt +18 -0
  109. drytorch-0.1.0/tests/functional/trackers/expected_logs/standard_trackers_no_tqdm.txt +18 -0
  110. drytorch-0.1.0/tests/functional/trackers/test_hydra_tracking.py +63 -0
  111. drytorch-0.1.0/tests/functional/trackers/test_initialization_modes.py +195 -0
  112. drytorch-0.1.0/tests/functional/trackers/test_matplotlib_tracking.py +173 -0
  113. drytorch-0.1.0/tests/functional/trackers/test_plotly_tracking.py +106 -0
  114. drytorch-0.1.0/tests/functional/trackers/test_sqlalchemy_tracking.py +392 -0
  115. drytorch-0.1.0/tests/functional/trackers/test_tensorboard_tracking.py +75 -0
  116. drytorch-0.1.0/tests/functional/trackers/test_wandb_tracking.py +112 -0
  117. drytorch-0.1.0/tests/functional/trackers/test_yaml_dumping.py +90 -0
  118. drytorch-0.1.0/tests/integration/__init__.py +1 -0
  119. drytorch-0.1.0/tests/integration/conftest.py +30 -0
  120. drytorch-0.1.0/tests/integration/contrib/__init__.py +1 -0
  121. drytorch-0.1.0/tests/integration/contrib/test_from_torcheval.py +77 -0
  122. drytorch-0.1.0/tests/integration/contrib/test_from_torchmetrics.py +129 -0
  123. drytorch-0.1.0/tests/integration/contrib/test_optuna_configuration_with_hydra.py +113 -0
  124. drytorch-0.1.0/tests/integration/core/__init__.py +1 -0
  125. drytorch-0.1.0/tests/integration/core/test_experiment_multiprocessing.py +125 -0
  126. drytorch-0.1.0/tests/integration/core/test_model_registration.py +153 -0
  127. drytorch-0.1.0/tests/integration/core/test_unrecorded_runs.py +44 -0
  128. drytorch-0.1.0/tests/integration/lib/__init__.py +1 -0
  129. drytorch-0.1.0/tests/integration/lib/test_distributed_accumulators.py +73 -0
  130. drytorch-0.1.0/tests/integration/lib/test_distributed_loading.py +147 -0
  131. drytorch-0.1.0/tests/integration/lib/test_distributed_training.py +265 -0
  132. drytorch-0.1.0/tests/integration/lib/test_local_checkpoint.py +128 -0
  133. drytorch-0.1.0/tests/integration/lib/test_protocol_implementations.py +91 -0
  134. drytorch-0.1.0/tests/integration/lib/test_stored_outputs.py +46 -0
  135. drytorch-0.1.0/tests/integration/trackers/__init__.py +1 -0
  136. drytorch-0.1.0/tests/integration/trackers/conftest.py +178 -0
  137. drytorch-0.1.0/tests/integration/trackers/expected_logs/epoch_logging.txt +12 -0
  138. drytorch-0.1.0/tests/integration/trackers/expected_logs/experiment_logging.txt +8 -0
  139. drytorch-0.1.0/tests/integration/trackers/expected_logs/hydra_log_file.txt +3 -0
  140. drytorch-0.1.0/tests/integration/trackers/expected_logs/hydra_out_file.txt +3 -0
  141. drytorch-0.1.0/tests/integration/trackers/expected_logs/internal_logging.txt +17 -0
  142. drytorch-0.1.0/tests/integration/trackers/expected_logs/metrics_logging.txt +14 -0
  143. drytorch-0.1.0/tests/integration/trackers/expected_logs/model_state_logging.txt +11 -0
  144. drytorch-0.1.0/tests/integration/trackers/expected_logs/test_logging.txt +1 -0
  145. drytorch-0.1.0/tests/integration/trackers/expected_logs/training_logging.txt +4 -0
  146. drytorch-0.1.0/tests/integration/trackers/test_csv_files.py +59 -0
  147. drytorch-0.1.0/tests/integration/trackers/test_database_connection.py +243 -0
  148. drytorch-0.1.0/tests/integration/trackers/test_hydra_logging_formatting.py +111 -0
  149. drytorch-0.1.0/tests/integration/trackers/test_logging_levels.py +115 -0
  150. drytorch-0.1.0/tests/integration/trackers/test_tensorboard_events.py +68 -0
  151. drytorch-0.1.0/tests/integration/trackers/test_tqdm_bars.py +168 -0
  152. drytorch-0.1.0/tests/integration/trackers/test_wandb_runs.py +69 -0
  153. drytorch-0.1.0/tests/integration/trackers/test_yaml_metadata.py +224 -0
  154. drytorch-0.1.0/tests/integration/utils/__init__.py +1 -0
  155. drytorch-0.1.0/tests/integration/utils/test_classes_repr.py +146 -0
  156. drytorch-0.1.0/tests/simple_classes.py +95 -0
  157. drytorch-0.1.0/tests/units/__init__.py +1 -0
  158. drytorch-0.1.0/tests/units/conftest.py +135 -0
  159. drytorch-0.1.0/tests/units/contrib/__init__.py +1 -0
  160. drytorch-0.1.0/tests/units/contrib/test_optuna.py +263 -0
  161. drytorch-0.1.0/tests/units/core/__init__.py +1 -0
  162. drytorch-0.1.0/tests/units/core/conftest.py +26 -0
  163. drytorch-0.1.0/tests/units/core/test_experimenting.py +1161 -0
  164. drytorch-0.1.0/tests/units/core/test_log_events.py +66 -0
  165. drytorch-0.1.0/tests/units/core/test_protocols.py +240 -0
  166. drytorch-0.1.0/tests/units/core/test_registering.py +296 -0
  167. drytorch-0.1.0/tests/units/core/test_tracking.py +353 -0
  168. drytorch-0.1.0/tests/units/lib/__init__.py +1 -0
  169. drytorch-0.1.0/tests/units/lib/conftest.py +21 -0
  170. drytorch-0.1.0/tests/units/lib/test_accumulators.py +123 -0
  171. drytorch-0.1.0/tests/units/lib/test_checkpoints.py +218 -0
  172. drytorch-0.1.0/tests/units/lib/test_evaluations.py +174 -0
  173. drytorch-0.1.0/tests/units/lib/test_gradient_ops.py +562 -0
  174. drytorch-0.1.0/tests/units/lib/test_hooks.py +413 -0
  175. drytorch-0.1.0/tests/units/lib/test_learning.py +177 -0
  176. drytorch-0.1.0/tests/units/lib/test_loading.py +345 -0
  177. drytorch-0.1.0/tests/units/lib/test_models.py +274 -0
  178. drytorch-0.1.0/tests/units/lib/test_monitoring.py +441 -0
  179. drytorch-0.1.0/tests/units/lib/test_objectives.py +886 -0
  180. drytorch-0.1.0/tests/units/lib/test_runners.py +319 -0
  181. drytorch-0.1.0/tests/units/lib/test_schedulers.py +558 -0
  182. drytorch-0.1.0/tests/units/lib/test_training.py +423 -0
  183. drytorch-0.1.0/tests/units/test_init.py +106 -0
  184. drytorch-0.1.0/tests/units/trackers/__init__.py +1 -0
  185. drytorch-0.1.0/tests/units/trackers/conftest.py +301 -0
  186. drytorch-0.1.0/tests/units/trackers/test_base_classes.py +1187 -0
  187. drytorch-0.1.0/tests/units/trackers/test_csv.py +647 -0
  188. drytorch-0.1.0/tests/units/trackers/test_hydra.py +142 -0
  189. drytorch-0.1.0/tests/units/trackers/test_logging.py +505 -0
  190. drytorch-0.1.0/tests/units/trackers/test_matplotlib.py +272 -0
  191. drytorch-0.1.0/tests/units/trackers/test_plotly.py +136 -0
  192. drytorch-0.1.0/tests/units/trackers/test_sqlalchemy.py +1146 -0
  193. drytorch-0.1.0/tests/units/trackers/test_tensorboard.py +202 -0
  194. drytorch-0.1.0/tests/units/trackers/test_tqdm.py +243 -0
  195. drytorch-0.1.0/tests/units/trackers/test_wandb.py +274 -0
  196. drytorch-0.1.0/tests/units/trackers/test_yaml.py +150 -0
  197. drytorch-0.1.0/tests/units/utils/__init__.py +1 -0
  198. drytorch-0.1.0/tests/units/utils/test_apply_ops.py +461 -0
  199. drytorch-0.1.0/tests/units/utils/test_averages.py +137 -0
  200. drytorch-0.1.0/tests/units/utils/test_local_ops.py +170 -0
  201. drytorch-0.1.0/tests/units/utils/test_repr_utils.py +457 -0
@@ -0,0 +1,79 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ env:
10
+ UV_INDEX: "pytorch-cpu=https://download.pytorch.org/whl/cpu"
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ matrix:
17
+ include:
18
+ - os: ubuntu-latest
19
+ python-version: "3.11"
20
+ - os: macos-latest
21
+ python-version: "3.12"
22
+ - os: windows-latest
23
+ python-version: "3.13"
24
+ - os: ubuntu-latest
25
+ python-version: "3.14"
26
+ - os: windows-latest
27
+ python-version: "3.15"
28
+ index-strategy: unsafe-best-match
29
+
30
+ env:
31
+ UV_INDEX_STRATEGY: ${{ matrix.index-strategy || 'first-index' }}
32
+
33
+ steps:
34
+ - name: Checkout code
35
+ uses: actions/checkout@v6
36
+
37
+ - name: Install uv and set the Python version
38
+ uses: astral-sh/setup-uv@v7
39
+ with:
40
+ python-version: ${{ matrix.python-version }}
41
+ enable-cache: true
42
+
43
+ - name: Lock dependencies
44
+ run: uv lock
45
+
46
+ - name: Install the project
47
+ run: uv sync --all-extras --dev
48
+
49
+ - name: Install Linters and Type Checkers
50
+ run: uv pip install ruff basedpyright
51
+
52
+ - name: Ruff Lint
53
+ run: uv run ruff check --diff .
54
+
55
+ - name: Ruff Format
56
+ run: uv run ruff format --check .
57
+
58
+ - name: BasedPyright
59
+ run: uv run basedpyright
60
+
61
+ - name: Run tests
62
+ run: uv run pytest --cov --cov-report=xml --cov-report=term-missing
63
+
64
+ - name: Install support for testing notebooks
65
+ if: matrix.os == 'ubuntu-latest'
66
+ run: uv pip install nbmake
67
+
68
+ - name: Test notebooks execute
69
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
70
+ run: uv run pytest --nbmake docs/
71
+ env:
72
+ EPOCHS: 1
73
+
74
+ - name: Upload coverage to Codecov
75
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
76
+ uses: codecov/codecov-action@v7
77
+ with:
78
+ files: ./coverage.xml
79
+ fail_ci_if_error: false
@@ -0,0 +1,87 @@
1
+ name: Create Version
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: write
8
+
9
+ jobs:
10
+ create-tag:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v5
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - name: Ensure main branch
19
+ run: |
20
+ BRANCH="$(git rev-parse --abbrev-ref HEAD)"
21
+ if [ "$BRANCH" != "main" ]; then
22
+ echo "This workflow can only run on main (current: $BRANCH)"
23
+ exit 1
24
+ fi
25
+
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: "3.12"
29
+
30
+ - name: Read and convert version (PEP 440 → SemVer)
31
+ id: version
32
+ run: |
33
+ python - <<'PY'
34
+ import re, tomllib, os
35
+
36
+ with open("pyproject.toml", "rb") as f:
37
+ raw = tomllib.load(f)["project"]["version"]
38
+
39
+ pep440 = re.compile(
40
+ r"^(?P<base>\d+\.\d+\.\d+)"
41
+ r"(?:(?P<pre>a|b|rc)(?P<pre_n>\d+))?"
42
+ r"(?:(?:\.post)(?P<post_n>\d+))?$"
43
+ )
44
+
45
+ m = pep440.fullmatch(raw)
46
+ if not m:
47
+ raise SystemExit(f"Unsupported PEP 440 version: {raw}")
48
+
49
+ base = m["base"]
50
+ semver = base
51
+
52
+ if m["pre"]:
53
+ label = {"a": "alpha", "b": "beta", "rc": "rc"}[m["pre"]]
54
+ semver += f"-{label}.{m['pre_n']}"
55
+
56
+ if m["post_n"]:
57
+ semver += f"+post.{m['post_n']}"
58
+
59
+ # Write to GITHUB_OUTPUT
60
+ with open(os.environ["GITHUB_OUTPUT"], "a") as f:
61
+ f.write(f"raw={raw}\n")
62
+ f.write(f"semver={semver}\n")
63
+
64
+ print(f"Version: {raw} → {semver}")
65
+ PY
66
+
67
+ - name: Fetch and prune tags
68
+ run: git fetch --tags --prune
69
+
70
+ - name: Fail if tag already exists
71
+ run: |
72
+ VERSION="${{ steps.version.outputs.semver }}"
73
+ if git ls-remote --tags origin "v$VERSION" | grep -q .; then
74
+ echo "Tag v$VERSION already exists"
75
+ exit 1
76
+ fi
77
+
78
+ - name: Configure Git
79
+ run: |
80
+ git config user.name "github-actions[bot]"
81
+ git config user.email "github-actions[bot]@users.noreply.github.com"
82
+
83
+ - name: Create and push tag
84
+ run: |
85
+ VERSION="${{ steps.version.outputs.semver }}"
86
+ git tag "v$VERSION" -m "Version $VERSION"
87
+ git push origin "v$VERSION"
@@ -0,0 +1,42 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ test-publish:
8
+ name: Upload to PyPI
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - name: Initial checkout
15
+ uses: actions/checkout@v5
16
+ with:
17
+ fetch-depth: 0
18
+
19
+ - name: Get latest tag
20
+ id: get_tag
21
+ run: |
22
+ LATEST_TAG=$(git describe --tags --abbrev=0)
23
+ echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
24
+ echo "Latest tag: $LATEST_TAG"
25
+
26
+ - name: Checkout the tag
27
+ run: |
28
+ git checkout ${{ steps.get_tag.outputs.tag }}
29
+
30
+ - name: Install uv
31
+ uses: astral-sh/setup-uv@v6
32
+ with:
33
+ version: "latest"
34
+
35
+ - name: Set up Python
36
+ run: uv python install 3.12
37
+
38
+ - name: Build package
39
+ run: uv build
40
+
41
+ - name: Publish to PyPI
42
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,17 @@
1
+ /.agents/
2
+ /CLAUDE.md
3
+ /.idea/
4
+ /.vscode/
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+ *.hypothesis/
9
+ *.lock
10
+ *.ipynb_checkpoints
11
+ *.coverage
12
+ **/htmlcov/
13
+ **/.drytorch/
14
+ **/experiments/
15
+ docs/_autosummary/
16
+ docs/_build/
17
+ docs/jupyter_cache
@@ -0,0 +1,58 @@
1
+ exclude: '^docs/_build/'
2
+
3
+ repos:
4
+
5
+ - repo: https://github.com/kynan/nbstripout
6
+ rev: 0.8.1
7
+ hooks:
8
+ - id: nbstripout
9
+
10
+ - repo: local
11
+ hooks:
12
+ - id: jupytext # sync .py scripts from notebooks BEFORE formatting
13
+ name: jupytext
14
+ entry: uv run jupytext --sync
15
+ language: system
16
+ files: '\.ipynb$'
17
+
18
+ - repo: https://github.com/pre-commit/pre-commit-hooks
19
+ rev: v6.0.0
20
+ hooks:
21
+ - id: trailing-whitespace
22
+ - id: end-of-file-fixer
23
+ - id: check-yaml
24
+ - id: check-toml
25
+ - id: check-merge-conflict
26
+ - id: check-added-large-files
27
+ args: [--maxkb=1000]
28
+ - id: debug-statements
29
+
30
+ - repo: local
31
+ hooks:
32
+ - id: ruff-format
33
+ name: ruff format
34
+ entry: uv run ruff format
35
+ language: system
36
+ types_or: [python, pyi, jupyter]
37
+ - id: ruff-check
38
+ name: ruff check
39
+ entry: uv run ruff check --fix --exit-non-zero-on-fix
40
+ language: system
41
+ types_or: [python, pyi, jupyter]
42
+
43
+ - repo: local
44
+ hooks:
45
+ - id: jupytext # re-sync AFTER ruff reformats the paired .py scripts
46
+ name: jupytext
47
+ entry: uv run jupytext --sync
48
+ language: system
49
+ files: '\.ipynb$'
50
+
51
+ - repo: local
52
+ hooks:
53
+ - id: basedpyright
54
+ name: basedpyright
55
+ entry: uv run basedpyright
56
+ language: system
57
+ types_or: [python, pyi, jupyter]
58
+ exclude: ^tests/
@@ -0,0 +1,12 @@
1
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2
+
3
+ version: 2
4
+
5
+ build:
6
+ os: ubuntu-22.04
7
+ tools:
8
+ python: "3.12"
9
+ commands:
10
+ - pip install uv
11
+ - UV_INDEX="pytorch-cpu=https://download.pytorch.org/whl/cpu" uv sync --all-extras
12
+ - DRYTORCH_INIT_MODE='minimal' uv run sphinx-build -b html docs $READTHEDOCS_OUTPUT/html