Group examples by data type and fix the index - #40
Merged
Conversation
The examples folder had grown to 19 files in one flat directory, and its README had drifted badly: it listed four examples that were never committed (sar_egfr.py, afdb_clusters_tmap.py and two single-cell scripts) while omitting eleven that exist, including every image example but two. Scripts now sit under chemistry/, images/, proteins/, text/ and layout/, and the README lists all thirteen with what each one actually does. cluster_65053.csv stays at examples/ root. It is referenced from three docs, four scripts and five notebooks, so moving it would have churned thirteen files including notebook JSON for no real gain. Dropped adaptive_coef_exp_3panel.py: an 8x8 sweep of layout coefficients used to pick defaults, not something a user would run. Its only dataset, chembl_200k.csv, was used by nothing else, so 10 MB leaves every clone with it. cazyme_analysis.ipynb moves to notebooks/, where the other thirteen notebooks live. The root README's notebook table now also lists notebook 13, which was already missing. Each moved script anchors its data, cache and output at EXAMPLES_DIR rather than Path(__file__).parent, so the gitignored examples/data/ cache and the shared CSV keep resolving from the new depth. mnist_cosine_tmap.py used a cwd-relative output path and now uses the same anchor, so it no longer depends on being run from the repository root.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #39, which is unrelated in content — this branch is off
masterand touches no source code.examples/had grown to 19 files in one flat directory. Two things were wrong with it.The index was mostly fiction
examples/README.mdlisted four examples that were never committed —sar_egfr.py,afdb_clusters_tmap.py,singlecell_trajectory_tmap.py,singlecell_reprogramming_tmap.py. There are no deletion records in git history; they never existed. Meanwhile it omitted eleven files that do exist, including every image example except two.So the index advertised 8 examples, half of them imaginary, and hid most of the real ones. The README is rewritten and now lists all thirteen with what each actually does.
New layout
cluster_65053.csvdeliberately stays at the root. It is referenced from 3 docs, 4 scripts and 5 notebooks — moving it would churn 13 files including notebook JSON, and break any snippet a user has already copied out of the docs.Removed: 10 MB and a tuning experiment
adaptive_coef_exp_3panel.pyis an 8×8 sweep of layout coefficients across 2k/64k/200k molecules with a--probeflag to "time risky 200k corners". That's how the defaults were chosen, not something a user runs.Its only dataset,
chembl_200k.csv(10 MB), was used by nothing else in the repository. Both are gone, which takes roughly 72% of the tracked weight ofexamples/out of every clone. Still in git history if it's ever wanted back.untangle_demo.pyis kept, underlayout/— it's the only documentation of whatUntangleModedoes.Paths
Every script anchored its data, cache and output at
Path(__file__).parent, which breaks when the script moves one level deeper — including against the gitignoredexamples/data/cache that may already hold gigabytes of downloads. Each moved script now anchors atso the shared CSV and the existing cache keep resolving, and outputs still land in
examples/. Usage lines in the docstrings are updated to the new paths.mnist_cosine_tmap.pywas writing to a cwd-relative"examples/mnist_tmap.html", so it only worked from the repository root. It uses the same anchor now.Also
cazyme_analysis.ipynbmoves tonotebooks/14_cazyme_analysis.ipynb, next to the other thirteen. The root README's notebook table gains rows 13 and 14 — 13 was already missing.docs/molecule_tutorial.md,lshforest_guide.md,layout_guide.md,minhash_guide.md).Checked
examples/chemistry/molecules_tmap.pyfrom/tmp: it found the CSV and wrote output back toexamples/, confirming the anchoring is cwd-independent.ruff check src/ tests/clean, which is what CI gates.ruff check examples/goes from 26 errors to 20. The remaining 20 are pre-existing inesm_atlas_tmap.py(long lines, trailing whitespace) and left alone —examples/is not linted by CI, and fixing them would bury the move in unrelated churn.