Skip to content

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

Description

@gustavdelius

Description

plotBiomass, plotYield, and plotYieldGear use sim as the name of the first argument, while every other plot function (plotSpectra, plotCDF, plotFeedingLevel, plotPredMort, plotFMort, plotDiet, plotGrowthCurves, …) uses object.

Since these are S3 generics the name is purely cosmetic, but it is inconsistent and misleading — especially for functions that accept both MizerSim and MizerParams objects (which plotBiomass does not currently, but the others do).

Suggested fix

Rename the first argument of plotBiomass, plotYield, and plotYieldGear (and their .MizerSim methods and plotly* wrappers) from sim to object, matching the rest of the family.

This is a purely cosmetic change with no effect on behaviour. Existing calls using positional arguments are unaffected; calls using sim = ... as a named argument would break, but named use of a first S3 dispatch argument is extremely rare.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions