Skip to content

Commit

Permalink
Compiling again
Browse files Browse the repository at this point in the history
  • Loading branch information
iagomosqueira committed Dec 1, 2024
1 parent d5cfce1 commit 4109e92
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 93 deletions.
1 change: 0 additions & 1 deletion .github/.gitignore

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/R-CMD-check.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Depends:
Suggests:
testthat
Additional_repositories: http://flr-project.org/R
RoxygenNote: 7.2.1
RoxygenNote: 7.3.2
ByteCompile: TRUE
10 changes: 6 additions & 4 deletions R/flxsa.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ setMethod("FLXSA", signature(stock="FLStock", indices="FLIndex"),

setMethod("FLXSA", signature(stock="FLStock", indices="FLIndices"),
function(stock, indices, control=FLXSA.control(), diag.flag=TRUE) {

Call <- match.call()
# check FLIndices input
for (i in 1:length(indices)) {
Expand Down Expand Up @@ -299,10 +299,12 @@ setMethod("FLXSA", signature(stock="FLStock", indices="FLIndices"),
res@range <- stock@range

return(res)
}
}

res <- .Call("runFLXSA", stock, indices, control, diag.flag)

res <- fqs(res)

res <-fqs(.Call("runFLXSA", stock, indices, control, diag.flag))

if (class(res) != "FLXSA")
return(res)
res@call <- as.character(Call)
Expand Down
13 changes: 10 additions & 3 deletions R/xsa.sa.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
#' of maximum number of iterations (maxit).
#' @param stk An FLStock.
#' @param idx An FLIndices.
#' @param args Arguments for call to mp(), list.
#' @param tracking Tracking FLQuant.
#'
#' @return A list containing the updated FLStock, and the tracking FLQuant.
#' @examples
#' data(ple4)
#' data(ple4.index)
#' xsa.sa(stk=ple4, idx=ple4.index, args=list(ay=2018), tracking=FLQuant())
#' xsa.sa(stk=ple4, idx=ple4.index, args=list(ay=2018),
#' tracking=FLQuant(dimnames=list(quant='conv.est', year=2018)))

xsa.sa <- function(stk, idx, args, tracking, ...) {

Expand All @@ -31,13 +34,17 @@ xsa.sa <- function(stk, idx, args, tracking, ...) {
args0$stock <- stk
args0$indices <- idx

# SET default control if missing
if(is.null(args0$control)) args0$control <- FLXSA.control()

# CALL to fit
fit <- do.call('FLXSA', args0)

# UPDATE stk
stk <- stk + fit

track(tracking, "conv.est", ac(args$ay)) <- fit@control@maxit

# TRACK 'convergence'
tracking['conv.est', ac(args$ay)] <- fit@control@maxit

list(stk = stk, tracking = tracking)
} # }}}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# FLXSA
- Version: 2.6.5.9002
- Date: 03-05-2022
- Version: 2.6.6
- Date: 11-10-2022
- Author: Laurence T. Kell <laurie AT kell.es>
- Maintainer: FLR Team <flrteam AT flr-project.org>
- Repository: <https://github.com/flr/FLXSA/>
Expand Down
7 changes: 6 additions & 1 deletion man/xsa.sa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4109e92

Please sign in to comment.