Consider S3 classes for strategy / metric objects
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- r
- Domain
- backend-api-design
Research direction
Start by reviewing PR #1156 and the entry points filter_scores(), impute_missing_scores(), and score(). Compare their current formal-name checks and strategy/metric inputs, then consider how validators, constructors, coercion, and print methods would affect user-defined objects. Done means reaching and documenting a decision on whether both concepts should become S3 classes and whether migration should be shared or incremental.
Written by the indexing model from the issue text.
Description
Spun off from review of PR #1156.
In that PR we introduced a strategy-function-factory pattern for `filter_scores()` and `impute_missing_scores()`. @sbfnk raised (reasonably) that the entry functions accept any function and only check its formals, and suggested making the strategy an S3 class with type-checking.
We agreed in the PR discussion that this is a wider-scoped question:
- The existing `metrics` argument in `score()` has the same shape (list of named functions) and is not an S3 class either.
- If we adopt S3 here, we should decide whether to apply the same pattern to metrics for consistency.
What to decide:
- Is there value in formalising "strategy" and "metric" as S3 classes with validators, or is the current formal-name check sufficient?
- If yes, should both change together or is incremental migration OK?
- What about user-defined strategies/metrics — constructors, coercion, print methods?
Not blocking PR #1156. Opening this for follow-up discussion.
This was opened by a bot. Please ping @seabbs for any questions.
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
data_bio2rarify - doc - dimensions wrongPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·