Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane committed Nov 29, 2024
1 parent b81ec6a commit 88499f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:
- name: Ensure notebooks complete without errors with pytest and nbmake
run: |
pip install '.[tests]'
pip install '.[all]'
pytest --nbmake examples/*ipynb
23 changes: 12 additions & 11 deletions examples/customized_meteor_diffmap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
"metadata": {},
"outputs": [],
"source": [
"# ruff: noqa: T201\n",
"\n",
"import numpy as np\n",
"import reciprocalspaceship as rs\n",
"from matplotlib import pyplot as plt\n",
"\n",
"from meteor.diffmaps import compute_difference_map, max_negentropy_kweighted_difference_map\n",
"from meteor.rsmap import Map\n",
"from meteor.diffmaps import max_negentropy_kweighted_difference_map, compute_difference_map\n",
"from meteor.tv import tv_denoise_difference_map\n",
"from meteor.validate import map_negentropy\n",
"\n",
"from matplotlib import pyplot as plt"
"from meteor.validate import map_negentropy"
]
},
{
Expand Down Expand Up @@ -132,7 +133,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"optimal k-parameter: 0.01 / negentropy: 0.00127\n"
"optimal k-parameter: 0.01, negentropy: 0.00127\n"
]
}
],
Expand All @@ -142,7 +143,7 @@
")\n",
"kewighted_negentropy = map_negentropy(k_weighted_diffmap)\n",
"\n",
"print(f\"optimal k-parameter: {kweight_parameter} / negentropy: {kewighted_negentropy:.5f}\")"
"print(f\"optimal k-parameter: {kweight_parameter}, negentropy: {kewighted_negentropy:.5f}\")"
]
},
{
Expand Down Expand Up @@ -172,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -187,7 +188,7 @@
}
],
"source": [
"plt.figure(figsize=(8,3))\n",
"plt.figure(figsize=(8, 3))\n",
"\n",
"plt.xlabel(\"TV weight\")\n",
"plt.ylabel(\"map negentropy\")\n",
Expand All @@ -196,8 +197,8 @@
"# points are not sampled in order of increasing TV weight, so we have to order them\n",
"sort_order = np.argsort(metadata.tv_weights_scanned)\n",
"plt.plot(\n",
" np.array(metadata.tv_weights_scanned)[sort_order], \n",
" np.array(metadata.negentropy_at_weights)[sort_order]\n",
" np.array(metadata.tv_weights_scanned)[sort_order],\n",
" np.array(metadata.negentropy_at_weights)[sort_order],\n",
")\n",
"\n",
"plt.scatter(\n",
Expand Down Expand Up @@ -228,7 +229,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ tests = [
"pytest-xdist",
"nbmake",
]
notebooks = [
"matplotlib",
]

[project.scripts]
"meteor.diffmap" = "meteor.scripts.compute_difference_map:main"
Expand Down

0 comments on commit 88499f8

Please sign in to comment.