Issue 73: Smooth using custom prior configs and a new vignette#77
Merged
Conversation
Expose and forward AutoGP GPConfig through the wrapper: export GPConfig from the package and accept a config keyword in make_and_fit_model, passing it into AutoGP.GPModel. The make_and_fit_model docs and examples were updated to document the config argument and to clarify that most options (including n_mcmc/n_hmc) are forwarded as kwargs to AutoGP.fit_smc! rather than being wrapper defaults. The SMC call now forwards kwargs unmodified (so callers must provide n_mcmc/n_hmc), and schedule calculation keeps the previous guard for small datasets. Documentation (.github/copilot-instructions.md) was updated to reflect the new passthrough semantics. Added tests (test/test_gpconfig.jl) to verify GPConfig forwarding, custom kernel/prior propagation, and that omitting required passthrough kwargs (n_mcmc/n_hmc) surfaces an error.
Rewrite and modernize the setting-priors vignette and its script
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands NowcastAutoGP’s model-fitting API to make Gaussian Process prior customization easier by allowing callers to pass an AutoGP GPConfig into make_and_fit_model, and adds a new documentation vignette demonstrating prior editing (including Accessors.jl workflows).
Changes:
- Add
configsupport inmake_and_fit_modeland forward it intoAutoGP.GPModel, while forwarding remaining kwargs toAutoGP.fit_smc!. - Re-export
GPConfigfrom the top-levelNowcastAutoGPmodule and add tests verifying config forwarding. - Add a new “setting-priors” vignette and wire it into the docs build and docs environment.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_gpconfig.jl | Adds tests to validate that config is forwarded into the created GPModel. |
| src/NowcastAutoGP.jl | Re-exports GPConfig for user convenience. |
| src/make_and_fit_model.jl | Updates make_and_fit_model to accept/forward config and to pass through fit_smc! kwargs. |
| docs/vignettes/setting-priors.jl | New Literate vignette showing how to modify priors (incl. Accessors.@set). |
| docs/src/vignettes/setting-priors.md | Generated markdown output for the new vignette. |
| docs/Project.toml | Adds Accessors to the docs environment dependencies. |
| docs/make.jl | Adds the new vignette to the rendered docs pages list. |
| docs/make_vignettes.jl | Updates vignette generation list to include the new vignette. |
| .github/copilot-instructions.md | Updates internal contribution guidance/examples to reflect the new config usage and passthrough kwargs behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #77 +/- ##
=======================================
Coverage 95.68% 95.68%
=======================================
Files 5 5
Lines 139 139
=======================================
Hits 133 133
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This pull request makes it easier to configure Gaussian Process (GP) priors in the
make_and_fit_modelfunction, and add a vignette for this.API Improvements and Configuration Flexibility
make_and_fit_modelfunction now accepts aconfigkeyword argument, allowing users to pass a customGPConfigfor specifying GP prior structure and hyperparameters. All other keyword arguments (such asn_mcmc,n_hmc,hmc_config, etc.) are forwarded directly toAutoGP.fit_smc!, simplifying the interface and making it more flexible.GPConfigtype is now re-exported for convenience, making it easier for users to construct and pass custom configurations.Documentation and Examples
make_and_fit_modelis expanded with detailed explanations and code examples showing how to customize GP priors usingGPConfig, including how to update nested prior entries and leverage theAccessors.jlpackage for convenient configuration edits.