Skip to content

Add (result, info) tuple return pattern for simulate/gen_images#30

Closed
kalidke wants to merge 3 commits intomainfrom
feature/tuple-pattern
Closed

Add (result, info) tuple return pattern for simulate/gen_images#30
kalidke wants to merge 3 commits intomainfrom
feature/tuple-pattern

Conversation

@kalidke
Copy link
Member

@kalidke kalidke commented Feb 1, 2026

Summary

  • Implement SimInfo and ImageInfo structs for metadata return
  • Update simulate() to return (smld_noisy, SimInfo) tuple where SimInfo contains smld_true, smld_model, timing info
  • Update gen_images() to return (images, ImageInfo) tuple with timing and statistics
  • Update all documentation and tests for new API
  • Bump version to 0.5.0

Breaking Changes

Functions now return tuples instead of single values:

# Before
smld_true, smld_model, smld_noisy = simulate(params; ...)
images = gen_images(smld, psf; ...)

# After
smld_noisy, info = simulate(params; ...)
smld_true = info.smld_true
smld_model = info.smld_model

images, img_info = gen_images(smld, psf; ...)

Test plan

  • All 265 tests pass
  • Documentation updated (README, api_overview.md, docs/)
  • Examples updated in docs/src/static/examples.md and docs/src/diffusion/examples.md

🤖 Generated with Claude Code

kalidke and others added 3 commits February 1, 2026 10:22
Add SimInfo and ImageInfo structs for returning metadata alongside
primary results, following the ecosystem convention.

Changes:
- Add src/core/info_types.jl with SimInfo and ImageInfo structs
- simulate(::StaticSMLMParams) now returns (smld_noisy, SimInfo)
  - info.smld_true and info.smld_model provide ground truth/kinetic model
- simulate(::DiffusionSMLMParams) now returns (smld, SimInfo)
- gen_images() and gen_image() now return (images/image, ImageInfo)
- All info structs include elapsed_ns timing, backend, device_id
- Export SimInfo and ImageInfo from main module
- Update all tests to use new tuple return format

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update README.md with new tuple returns for simulate() and gen_images()
- Update api_overview.md with SimInfo and ImageInfo documentation
- Update docs/src/index.md quick start examples
- Update docs/src/static/overview.md and examples.md
- Update docs/src/diffusion/overview.md and examples.md
- Update docs/src/images.md with ImageInfo return type

All functions now return (result, info) tuples:
- simulate() returns (smld_noisy, SimInfo) where info contains smld_true, smld_model
- gen_images() returns (images, ImageInfo) with timing and statistics

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Minor version bump for new (result, info) tuple return pattern API.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@kalidke
Copy link
Member Author

kalidke commented Feb 1, 2026

Reverting tuple-pattern rollout - starting fresh

@kalidke kalidke closed this Feb 1, 2026
@kalidke kalidke deleted the feature/tuple-pattern branch February 1, 2026 21:20
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.

1 participant