Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Evaluator/Visualizer library #158

Merged
merged 12 commits into from May 9, 2023
Merged

Improve Evaluator/Visualizer library #158

merged 12 commits into from May 9, 2023

Conversation

tiffanymtang
Copy link
Collaborator

Streamline main developer functions:

  • eval_constructor(): Constructs an Evaluator that evaluates some function (e.g., metric) for each row in fit_results. Also unnests and groups columns if specified.
  • eval_summarizer(): Takes a grouped data.frame and summarizes output using common summary statistics (i.e., mean, median, min, max, sd, raw) or custom summary functions.
  • plot_eval_constructor(): Constructs a Visualizer that takes in either the data or the name of the Evaluator to plot and creates basic plot summaries (e.g., boxplot, scatter plot, line plot, bar plot, with/without error bars) with convenient defaults for what to plot on the x, y, facets, etc.
  • plot_fit_constructor(): Constructs a Visualizer that makes a plot (given some plotting function) of the fit results from a given replicate

Other improvements:

  • Change function arguments and names to be more uniform and intuitive
  • Update Evaluator and Visualizer library functions to use the new developer functions above

Bug fixes

  • Fix bug in geom_boxplot with group argument
  • Fix bug in caching when functions are used as DGP/Method/Evaluator/Visualizer parameters due to different source bytecodes
  • Fix bug when using argument named "f" in add_vary_across() due to confusion between f and field_name in .check_each_vary_across()

@tiffanymtang tiffanymtang requested a review from jpdunc23 May 2, 2023 17:24
@jpdunc23
Copy link
Contributor

jpdunc23 commented May 9, 2023

@tiffanymtang I'm going to remove the upstream dependency on joss and rebase this branch from main, which will require a force push. Cool with you?

* Before: evaluators would compute global and within-group metrics; After: evaluators only compute within group metrics if `group_cols` is specified.
* Fix bug when retrieving cached results when functions are used in `*_params` (e.g., `dgp_params`). 
* Bug was due to differences in source bytecodes for functions. This caused issues in `dplyr::*_join`. Workaround is to use `duplicated` which ignores these source bytecodes.
* Also need to `removeSource()` for functions (`.dgp_fun`, `.method_fun`) that involve global assignment (`<<-`). [See test-checkpointing example]
* Fix bug when vary param name is some subset of `field_name` (in `.check_each_vary_across`)
* Fix missplaced parentheses
* Remove `internal.selfref` check. No longer needed
* Refactor main evaluator and visualizer constructors: `eval_constructor`, `eval_summarizer`, `plot_eval_constructor`, `plot_fit_constructor`
* Rename arguments for more uniformity
* Streamline evaluator and visualizer library functions using the main constructor functions
* Fix bug if NULL arguments are passed to Visualizer library functions
* Don't remove original vary_param columns if 2+ parameters are varied across
@tiffanymtang
Copy link
Collaborator Author

Yup that sounds good to me. Thanks!

Copy link
Contributor

@jpdunc23 jpdunc23 left a comment

Choose a reason for hiding this comment

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

@tiffanymtang I took a quick look over it and lgtm to merge into main. Let's let the tests run and then feel free to merge in unless something real fails (i.e., that isn't just the GitHub runner being stubborn).

@tiffanymtang tiffanymtang merged commit 25ef62e into main May 9, 2023
6 checks passed
@tiffanymtang tiffanymtang deleted the lib-updates branch May 9, 2023 02:53
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.

None yet

2 participants