Skip to content

Standardize plot generic first-argument name to object for biomass/yield APIs#358

Merged
gustavdelius merged 3 commits into
masterfrom
copilot/fix-first-argument-name-in-plot-generics
Jun 4, 2026
Merged

Standardize plot generic first-argument name to object for biomass/yield APIs#358
gustavdelius merged 3 commits into
masterfrom
copilot/fix-first-argument-name-in-plot-generics

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

plotBiomass(), plotYield(), and plotYieldGear() were inconsistent with the rest of the plotting API by naming the S3 dispatch argument sim instead of object. This change aligns those generics (and related methods/wrappers) with package conventions and records the named-argument impact as a breaking change.

  • API surface alignment

    • Renamed first parameter simobject in:
      • plotBiomass(), plotYield(), plotYieldGear() generics
      • plotBiomass.MizerSim(), plotYield.MizerSim(), plotYieldGear.MizerSim()
      • plotlyBiomass(), plotlyYield(), plotlyYieldGear()
    • Updated internal references/defaults in R/plots.R to use object.
  • Documentation sync

    • Updated corresponding Rd usage/argument sections:
      • man/plotBiomass.Rd
      • man/plotYield.Rd
      • man/plotYieldGear.Rd
  • Breaking-change note

    • Added NEWS entry under Breaking changes documenting that named calls using sim = ... must switch to object = ....
plotYield <- function(object, ...) UseMethod("plotYield")
plotYield.MizerSim <- function(object, sim2, species = NULL, ...) { ... }
plotlyYield <- function(object, sim2, species = NULL, ...) { ... }

Copilot AI changed the title [WIP] Fix inconsistent first-argument name in plot generics Standardize plot generic first-argument name to object for biomass/yield APIs Jun 4, 2026
Copilot AI requested a review from gustavdelius June 4, 2026 09:48

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do not add these tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot remove the tests you added

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in commit 922191d.

Copilot AI requested a review from gustavdelius June 4, 2026 10:12
@gustavdelius gustavdelius marked this pull request as ready for review June 4, 2026 11:38
@gustavdelius gustavdelius merged commit 5b6be9f into master Jun 4, 2026
1 check passed
@gustavdelius gustavdelius deleted the copilot/fix-first-argument-name-in-plot-generics branch June 4, 2026 11:38
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.

Inconsistent first-argument name: 'sim' vs 'object' in plot generics

2 participants