Skip to content

Commit 159e5a2

Browse files
committed
Adds blanks line in between bullets for md files
1 parent 2794a42 commit 159e5a2

File tree

102 files changed

+3366
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3366
-0
lines changed

developers/add-dials-parameter/SKILL.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ This skill supports **two distinct development contexts** with different capabil
1515
**Use when:** Creating a new R package that defines custom tuning parameters
1616

1717
- ✅ Build new packages extending Tidymodels with custom parameters
18+
1819
- ✅ Use all exported dials functions with `dials::` prefix
20+
1921
- ❌ Cannot use internal functions (`:::`)
22+
2023
- 📘 **Start here:** [Extension Development Guide](references/extension-guide.md)
2124

2225
**Package detection:** DESCRIPTION file does NOT have `Package: dials`
@@ -26,9 +29,13 @@ This skill supports **two distinct development contexts** with different capabil
2629
**Use when:** Contributing parameter definitions directly to tidymodels/dials repository
2730

2831
- ✅ Contribute parameters to dials package itself
32+
2933
- ✅ Access internal helper functions without `dials::` prefix
34+
3035
- ✅ Use validation helpers (`check_type()`, `check_range()`)
36+
3137
- ✅ Create custom finalize functions with `range_get()`/`range_set()`
38+
3239
- 📗 **Start here:** [Source Development Guide](references/source-guide.md)
3340

3441
**Package detection:** DESCRIPTION file has `Package: dials`
@@ -56,8 +63,11 @@ usethis::create_package("myextension")
5663
**dials** is the tuning parameter infrastructure package for Tidymodels. It provides:
5764

5865
- Parameter object definitions (quantitative and qualitative)
66+
5967
- Parameter range specifications and transformations
68+
6069
- Grid generation methods (regular, random, space-filling)
70+
6171
- Integration with tune, parsnip, recipes, and workflows packages
6272

6373
The name reflects the idea that tuning predictive models can be like turning a set of dials on a complex machine.
@@ -76,25 +86,41 @@ The name reflects the idea that tuning predictive models can be like turning a s
7686
**INSTRUCTIONS FOR CLAUDE:** Check if `repos/dials/` exists in the current working directory. Use this to guide development:
7787

7888
**If `repos/dials/` exists:**
89+
7990
- ✅ Use it as a reference throughout development
91+
8092
- Read source files (e.g., `repos/dials/R/param_mtry.R`) to study implementation patterns
93+
8194
- Read test files (e.g., `repos/dials/tests/testthat/test-param_mtry.R`) for testing patterns
95+
8296
- Reference these files when answering complex questions or solving problems
97+
8398
- Look at actual code structure, validation patterns, and edge case handling
8499

85100
**If `repos/dials/` does NOT exist:**
101+
86102
- Suggest cloning the repository using the scripts in [Repository Access Guide](references/package-repository-access.md)
103+
87104
- This is **optional but strongly recommended** for high-quality development
105+
88106
- If the user declines, reference files using GitHub URLs:
107+
89108
- Format: `https://github.com/tidymodels/dials/blob/main/R/[file-name].R`
109+
90110
- Example: https://github.com/tidymodels/dials/blob/main/R/param_mtry.R
111+
91112
- This allows users to click through to see implementations
92113

93114
**When to use repository references:**
115+
94116
- Complex implementation questions (e.g., "How does dials handle finalization?")
117+
95118
- Debugging issues (compare user's code to working implementation)
119+
96120
- Understanding patterns (study similar parameters)
121+
97122
- Test design (see how dials tests edge cases)
123+
98124
- Architecture decisions (understand internal structure)
99125

100126
See [Repository Access Guide](references/package-repository-access.md) for setup instructions.
@@ -137,8 +163,11 @@ See [Repository Access Guide](references/package-repository-access.md) for setup
137163
**Decision guide:**
138164

139165
- **Quantitative, simple range**: Fixed numeric bounds, no transformation → [Quantitative Parameters](references/quantitative-parameters.md)
166+
140167
- **Quantitative, transformed**: Log scale or other transformation → [Quantitative Parameters](references/quantitative-parameters.md) + [Transformations](references/transformations.md)
168+
141169
- **Quantitative, data-dependent**: Upper bound depends on dataset → [Quantitative Parameters](references/quantitative-parameters.md) + [Data-Dependent Parameters](references/data-dependent-parameters.md)
170+
142171
- **Qualitative**: Discrete categorical options → [Qualitative Parameters](references/qualitative-parameters.md)
143172

144173
---
@@ -353,21 +382,29 @@ values_aggregation <- c("none", "min", "max", "mean", "sum")
353382
### Core Guides
354383

355384
- [Extension Development Guide](references/extension-guide.md) - Creating new packages with custom parameters
385+
356386
- [Source Development Guide](references/source-guide.md) - Contributing to dials package
357387

358388
### Parameter Types
359389

360390
- [Parameter System Overview](references/parameter-system.md) - Architecture and parameter classes
391+
361392
- [Quantitative Parameters](references/quantitative-parameters.md) - Creating numeric parameters
393+
362394
- [Qualitative Parameters](references/qualitative-parameters.md) - Creating categorical parameters
395+
363396
- [Transformations](references/transformations.md) - Using log scale and custom transformations
397+
364398
- [Data-Dependent Parameters](references/data-dependent-parameters.md) - Using unknown() and finalization
399+
365400
- [Grid Integration](references/grid-integration.md) - How parameters work with grids
366401

367402
### Source Development
368403

369404
- [Testing Patterns (Source)](references/testing-patterns-source.md) - dials-specific testing
405+
370406
- [Best Practices (Source)](references/best-practices-source.md) - dials conventions and patterns
407+
371408
- [Troubleshooting (Source)](references/troubleshooting-source.md) - Common issues in dials
372409

373410
---
@@ -379,8 +416,11 @@ values_aggregation <- c("none", "min", "max", "mean", "sum")
379416
Before creating custom parameters in a new package, ensure your package is properly set up:
380417

381418
- **R Package Structure**: See [Extension Prerequisites](references/package-extension-prerequisites.md)
419+
382420
- **Dependencies**: Add `dials` to DESCRIPTION Imports
421+
383422
- **Roxygen**: Configure documentation system
423+
384424
- **Testing**: Set up testthat framework
385425

386426
### For Source Development
@@ -426,13 +466,19 @@ See [Development Workflow](references/package-development-workflow.md) for detai
426466
Essential tests for all parameters:
427467

428468
- **Range validation**: Parameter accepts valid ranges
469+
429470
- **Type checking**: Correct type enforcement
471+
430472
- **Grid integration**: Works with `grid_regular()`, `grid_random()`
473+
431474
- **Value utilities**: `value_sample()` and `value_seq()` work correctly
475+
432476
- **Edge cases**: Invalid inputs produce errors
433477

434478
See testing guides:
479+
435480
- Extension: [Testing Requirements](references/package-extension-requirements.md#testing-requirements)
481+
436482
- Source: [Testing Patterns (Source)](references/testing-patterns-source.md)
437483

438484
---
@@ -444,7 +490,9 @@ See testing guides:
444490
dials follows strict naming conventions:
445491

446492
- Parameter files: `R/param_[name].R`
493+
447494
- Test files: `tests/testthat/test-params.R` (shared), `test-constructors.R`
495+
448496
- One parameter per file (usually)
449497

450498
### Documentation Patterns
@@ -499,8 +547,11 @@ This convention is strongly recommended for consistency.
499547
### Related Skills
500548

501549
- [add-yardstick-metric](../add-yardstick-metric/SKILL.md) - Custom metrics may need custom tuning parameters
550+
502551
- [add-recipe-step](../add-recipe-step/SKILL.md) - Recipe steps often have tunable parameters
552+
503553
- [add-parsnip-model](../add-parsnip-model/SKILL.md) - Model specifications have tunable main arguments
554+
504555
- [add-parsnip-engine](../add-parsnip-engine/SKILL.md) - Model engines have tunable parameters
505556

506557
---

developers/add-dials-parameter/references/best-practices-source.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ R/
2525
**Rules**:
2626

2727
- Use lowercase with underscores
28+
2829
- One parameter per file (usually)
30+
2931
- Related parameters may share a file (e.g., `activation()` and `activation_2()`)
3032

3133
**Examples**:
@@ -82,8 +84,11 @@ weight_func() # Weight function
8284
**Guidelines**:
8385

8486
- Use underscores for multi-word names
87+
8588
- Abbreviate when commonly understood (`mtry`, `deg_free`)
89+
8690
- Match terminology used in literature and practice
91+
8792
- Keep concise but clear
8893

8994
### Avoid Redundancy
@@ -187,10 +192,15 @@ label = c(activation = "Activation Function")
187192
**Guidelines**:
188193

189194
- Use title case
195+
190196
- Start with noun or count (#)
197+
191198
- Be concise but descriptive
199+
192200
- Avoid articles ("the", "a")
201+
193202
- Use # for counts
203+
194204
- Match parameter semantics
195205

196206
**Examples**:
@@ -241,7 +251,9 @@ my_param <- function(range = c(0, 1), trans = NULL) {
241251
Common inherited parameters:
242252

243253
- `trans`: Transformation object
254+
244255
- `label`: Display name
256+
245257
- `finalize`: Finalization function
246258

247259
### Use @seealso for Related Parameters
@@ -470,8 +482,11 @@ stop("The range is invalid")
470482
### Follow Tidyverse Style Guide
471483

472484
- Use snake_case for functions and variables
485+
473486
- Use 2-space indentation
487+
474488
- Limit line length to 80 characters
489+
475490
- Use meaningful variable names
476491

477492
See [Tidyverse Style Guide](https://style.tidyverse.org/) for complete guidelines.
@@ -592,8 +607,11 @@ The upper bound is finalized using [method].
592607
Include:
593608

594609
- What parameter was added
610+
595611
- Why it's needed
612+
596613
- Example usage
614+
597615
- Related issues
598616

599617
---
@@ -690,37 +708,61 @@ values_activation <- c("relu", "sigmoid", "tanh", "softmax")
690708
Before submitting PR:
691709

692710
**Code**:
711+
693712
- [ ] File named `R/param_[name].R`
713+
694714
- [ ] Function name matches convention
715+
695716
- [ ] Uses appropriate constructor
717+
696718
- [ ] Range in correct units (transformed if applicable)
719+
697720
- [ ] Includes `@export` tag
721+
698722
- [ ] No `dials::` prefix (source development)
699723

700724
**Documentation**:
725+
701726
- [ ] Uses `@inheritParams` for common arguments
727+
702728
- [ ] Includes `@details` explaining usage
729+
703730
- [ ] Includes `@examples` with practical usage
731+
704732
- [ ] Uses `@seealso` for related parameters
733+
705734
- [ ] Label follows "{Noun} {Descriptor}" pattern
735+
706736
- [ ] Companion `values_*` vector for qualitative (with `@rdname`)
707737

708738
**Testing**:
739+
709740
- [ ] Tests in `test-params.R`
741+
710742
- [ ] Invalid argument tests in `test-constructors.R`
743+
711744
- [ ] Finalization tests if applicable
745+
712746
- [ ] Grid integration tests
747+
713748
- [ ] All tests pass: `devtools::test()`
714749

715750
**Package Checks**:
751+
716752
- [ ] `devtools::check()` passes
753+
717754
- [ ] `devtools::spell_check()` passes
755+
718756
- [ ] NEWS.md updated
757+
719758
- [ ] Snapshots accepted
720759

721760
**Git**:
761+
722762
- [ ] Descriptive commit messages
763+
723764
- [ ] Branch named clearly
765+
724766
- [ ] PR description complete
725767

726768
---
@@ -730,13 +772,17 @@ Before submitting PR:
730772
### Learn More
731773

732774
- **Testing**: [Testing Patterns (Source)](testing-patterns-source.md)
775+
733776
- **Troubleshooting**: [Troubleshooting (Source)](troubleshooting-source.md)
777+
734778
- **Source guide**: [Source Development Guide](source-guide.md)
735779

736780
### External Resources
737781

738782
- [Tidyverse Style Guide](https://style.tidyverse.org/)
783+
739784
- [R Packages Book](https://r-pkgs.org/)
785+
740786
- [roxygen2 Documentation](https://roxygen2.r-lib.org/)
741787

742788
---

0 commit comments

Comments
 (0)