ss3sim / ss3sim/ss3sim

Lack of list handler in change_retro()

Open
#439 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
41
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Other change_xxx() functions include handler to convert function args from the scenario args list items to numeric values. change_retro() lacks this functionality, so when it is used in the df format (e.g. sim_df$cr.retro_yr <- -5), the function tries to use round() on a list, causing the following error

Error in round(retro_yr) : non-numeric argument to mathematical function

I have submitted a PR (#438 ) which adds a handler, that calls unlist() for the retro year parameter if it exists.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading change_retro() and compare its argument handling with the other change_xxx() functions. Reproduce the df-format case using sim_df$cr.retro_yr <- -5; done means the retro year is converted from the scenario list before round() runs, as proposed in PR #438.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.