Skip to content

Fix bug in iter() for for mpCtrl - #46

Closed
shfischer wants to merge 1 commit into
flr:mainfrom
shfischer:dev_iter
Closed

Fix bug in iter() for for mpCtrl#46
shfischer wants to merge 1 commit into
flr:mainfrom
shfischer:dev_iter

Conversation

@shfischer

Copy link
Copy Markdown
Member

There is a bug in the iter() method for class mpCtrl:

mse/R/mpCtrl-class.R

Lines 291 to 294 in 71b3efc

setMethod("iter", signature(obj = "mpCtrl"), function(obj, i){
ctrl <- lapply(obj, iter, i=iter)
return(mpCtrl(ctrl))
}) # }}}

If an argument of any of the mseCtrl modules of mpCtrl is an FLQuant, then iter will fail, e.g.

iter(mpCtrl(list(est = mseCtrl(
  method = perfect.sa,
  args = list(SSB_dev = FLQuant(dimnames = list(iter = 1:2)))))), 
  2)

This is because

ctrl <- lapply(obj, iter, i=iter)

passes the function iter instead of the actual iterations i

iagomosqueira added a commit that referenced this pull request Jul 29, 2026
@iagomosqueira

Copy link
Copy Markdown
Member

Thanks, left behind during change of iter() argument from iter to i. This was needed to avoid conflict with iterators::iter wghich showed up as R fixed a bug in S4. I have merged this manually in the devel branch, which will merge into main today.

@iagomosqueira

Copy link
Copy Markdown
Member

Now in main 3cb7601

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.

2 participants