feat(benchmark): add run_benchmark() with dataframe-first pipeline, metrics, and tests#3892
Open
anshul23102 wants to merge 13 commits intoPecanProject:developfrom
Open
feat(benchmark): add run_benchmark() with dataframe-first pipeline, metrics, and tests#3892anshul23102 wants to merge 13 commits intoPecanProject:developfrom
anshul23102 wants to merge 13 commits intoPecanProject:developfrom
Conversation
…rics/plot_time_series, update tests
Contributor
Author
|
Hi @dlebauer, just wanted to give you a quick update on PR #3892. All CI checks are now passing and I've refactored the API to be dataframe-first ( |
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.
Description
Adds a new
run_benchmark()function as a database-free entry point for thebenchmark module. Unlike
calc_benchmark(), this works without a BETYdbconnection, taking validated dataframes directly as input.
Files added:
R/run_benchmark.R— dataframe-first pipeline withbm_validate(),align_by_time(),compute_metrics(), andplot_time_series()inst/testdata/sample_model.csv— sample model outputinst/testdata/sample_obs.csv— sample observationstests/testthat/test-run_benchmark.R— unit tests for all four pipeline stagesREADME.md— updated with quickstart exampleMotivation and Context
The existing
calc_benchmark()requires a full database connection whichmakes it hard to test and use standalone. This adds a lightweight,
dataframe-first entry point —
run_benchmark(model_df, obs_df)— for userswho want to quickly benchmark model output against observations without any
database setup. The pipeline follows a four-stage design: validate → align →
compute metrics → plot.
Review Time Estimate
Types of changes
Checklist: