Skip to content

Commit c4d3b88

Browse files
authored
Add local notebook test functionality, fix import directories in notebooks (#65)
* Refactor project dependencies and workflows - Updated pyproject.toml to streamline dependencies - Simplified GitHub Actions workflows for documentation and testing - Removed redundant printer_utils module - Minor import and type hint improvements in tree and test modules * Update documentation and testing workflows - Added documentation dependencies to pyproject.toml - Simplified GitHub Actions workflows for documentation and testing - Configured documentation build to use project dependencies - Enabled pytest workflow on main branch pushes * fix pyproject syntax * Update notebooks import directory, add command in makefile that can test notebooks locally (with instruction in CONTRIBUTION.md)
1 parent 2b0a25e commit c4d3b88

19 files changed

+39863
-416761
lines changed

.readthedocs.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

CONTRIBUTION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ If you are using VScode, it is easy to generate such template automatically usin
9898

9999
- Write tests for new features and bug fixes.
100100
- Make sure all existing tests pass before submitting changes.
101-
- Run the test suite locally before submitting your PR: `make test`.
101+
- Run the test suite locally before submitting your PR: `make test` and `make local-notebook-test`
102102

103103
### Documentation
104104

docs/requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/source/notebooks/DICAROS.ipynb

Lines changed: 616 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/notebooks/mcmc_Gaussian_BFFG_shapes.ipynb

Lines changed: 5262 additions & 0 deletions
Large diffs are not rendered by default.

examples/ABFFG.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import jax
33
import jax.numpy as jnp
44

5-
from examples.SDE import dot, solve, forward
5+
from SDE import dot, solve, forward
66

77
# functions for pullback and likelihood ratios, see https://arxiv.org/abs/2010.03509 section 6.1 for details
88
quadratic = lambda x,H: jnp.dot(x,jnp.dot(H,x))

examples/DICAROS.ipynb

Lines changed: 22 additions & 29 deletions
Large diffs are not rendered by default.

examples/Tree building.ipynb

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

examples/__init__.py

Whitespace-only changes.

examples/fast.ipynb

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,34 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 2,
15+
"execution_count": null,
1616
"metadata": {},
17-
"outputs": [],
17+
"outputs": [
18+
{
19+
"ename": "ImportError",
20+
"evalue": "cannot import name 'FastOrderedExecutor' from 'hyperiax.execution' (/Users/vbd402/Documents/Projects/hyperiax/hyperiax/execution/__init__.py)",
21+
"output_type": "error",
22+
"traceback": [
23+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
24+
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
25+
"Cell \u001b[0;32mIn[2], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mhyperiax\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mjax\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mrandom\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m PRNGKey, split\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mhyperiax\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexecution\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m FastOrderedExecutor\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mhyperiax\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtree\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mfasttree\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m FastTree, FastBiTree\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mhyperiax\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmodels\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m UpLambda, DownLambda\n",
26+
"\u001b[0;31mImportError\u001b[0m: cannot import name 'FastOrderedExecutor' from 'hyperiax.execution' (/Users/vbd402/Documents/Projects/hyperiax/hyperiax/execution/__init__.py)"
27+
]
28+
}
29+
],
1830
"source": [
19-
"import hyperiax\n",
31+
"import time\n",
32+
"import jax\n",
2033
"from jax.random import PRNGKey, split\n",
21-
"from hyperiax.execution import FastOrderedExecutor\n",
34+
"from jax import numpy as jnp\n",
35+
"from tqdm import tqdm\n",
36+
"from matplotlib import pyplot as plt\n",
37+
"\n",
2238
"from hyperiax.tree.fasttree import FastTree, FastBiTree\n",
23-
"from hyperiax.models import UpLambda, DownLambda\n",
24-
"import jax\n",
25-
"from hyperiax.execution.collate import dict_collate\n",
2639
"from hyperiax.tree.builders import symmetric_topology\n",
27-
"import time\n",
28-
"from matplotlib import pyplot as plt\n",
29-
"from tqdm.auto import tqdm\n",
30-
"from jax import numpy as jnp\n",
40+
"from hyperiax.execution import FastOrderedExecutor\n",
41+
"from hyperiax.execution.collate import dict_collate\n",
42+
"from hyperiax.models import UpLambda, DownLambda\n",
3143
"from hyperiax.models import UpLambda, DownLambda, FuseLambda\n",
3244
"from hyperiax.models.functional import pass_up\n",
3345
"from hyperiax.plotting import plot_tree_2d_scatter"
@@ -251,7 +263,7 @@
251263
],
252264
"metadata": {
253265
"kernelspec": {
254-
"display_name": "jaxenv",
266+
"display_name": "hyperiax_dev",
255267
"language": "python",
256268
"name": "python3"
257269
},
@@ -265,7 +277,7 @@
265277
"name": "python",
266278
"nbconvert_exporter": "python",
267279
"pygments_lexer": "ipython3",
268-
"version": "3.11.7"
280+
"version": "3.11.4"
269281
}
270282
},
271283
"nbformat": 4,

0 commit comments

Comments
 (0)