Skip to content

Replace include= source dumps with MFIIDD.source_for#43

Merged
sbfnk merged 2 commits into
spike/package-mfiiddfrom
refactor/codetracking-includes
Jun 29, 2026
Merged

Replace include= source dumps with MFIIDD.source_for#43
sbfnk merged 2 commits into
spike/package-mfiiddfrom
refactor/codetracking-includes

Conversation

@sbfnk-bot

@sbfnk-bot sbfnk-bot commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Addresses seabbs's review on #39 (sessions/pmcmc.qmd:99 thread): "use codetracking rather than include".

Summary

  • Add CodeTracking as a direct dep (it was already transitive).
  • Add MFIIDD.source_for(file) — reads pkgdir(MFIIDD)/src/<file> so the displayed code tracks the live package rather than a path relative to the qmd.
  • Add MFIIDD.source_for(f::Function) — returns the source of every method of f via CodeTracking.definition. Useful for students who want to inspect one function after using MFIIDD.
  • Swap every {.julia include="../src/X.jl"} block in pmcmc.qmd, particle_filters.qmd, mcmc.qmd, mcmc_diagnostics.qmd for a {julia} chunk that prints a markdown code fence around source_for("X.jl").

The Documenter half of seabbs's suggestion is split into a follow-up PR.

Summary by CodeRabbit

  • New Features

    • Documentation examples now display source code more reliably in rendered notebooks and session pages.
    • Added a new way to reuse and present package source snippets consistently across the docs.
  • Bug Fixes

    • Updated package dependencies and compatibility to support the new source-display workflow.
    • Refreshed an existing component version to keep documentation rendering stable.

Sessions previously inlined files via {.julia include="../src/X.jl"},
which hardcodes a path relative to the qmd. source_for reads the file
from the live pkgdir(MFIIDD) instead, and also accepts a function to
print just its methods via CodeTracking.

Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
@sbfnk-bot sbfnk-bot requested a review from sbfnk May 11, 2026 08:10
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8e1304ec-6842-4afd-a510-c77220cd7c0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/codetracking-includes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
@sbfnk sbfnk marked this pull request as ready for review June 29, 2026 07:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/MFIIDD.jl`:
- Around line 51-57: In source_for(f::Function), the result from
CodeTracking.definition(String, m) is already a String, so pushing first(d)
incorrectly stores only the first character and breaks the chunks vector. Update
the loop over methods(f) to push d directly into chunks after the nothing check,
keeping the return type consistent with Vector{String}.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1728b611-b9ca-46e8-b440-eef68ea019d9

📥 Commits

Reviewing files that changed from the base of the PR and between 315518c and 89e8952.

📒 Files selected for processing (7)
  • Manifest.toml
  • Project.toml
  • sessions/mcmc.qmd
  • sessions/mcmc_diagnostics.qmd
  • sessions/particle_filters.qmd
  • sessions/pmcmc.qmd
  • src/MFIIDD.jl

Comment thread src/MFIIDD.jl
@sbfnk sbfnk merged commit e9c0985 into spike/package-mfiidd Jun 29, 2026
2 checks passed
@sbfnk sbfnk deleted the refactor/codetracking-includes branch June 29, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants