Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve detection of off-diagonal omega names #152

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# xpose 0.4.4.9000
### General
* Off-diagonal ETA names are better-detected (@billdenney #121)

# xpose 0.4.4
### General
* Improved documentation for `xpose_data` (@billdenney #99)
Expand Down
18 changes: 14 additions & 4 deletions R/xpdb_access.R
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,23 @@ get_prm <- function(xpdb,
}

# Assign OMEGA labels
n_omega <- sum(prms$type == 'ome' & prms$diagonal, na.rm = TRUE)
mask_omega <- prms$type == 'ome' & prms$diagonal
mask_omega_all <-
prms$type == 'ome' &
!is.nan(prms$value) &
(prms$diagonal |
!(prms$value == 0 & prms$fixed & !prms$diagonal)
)
n_omega <- sum(mask_omega, na.rm = TRUE)
n_omega_all <- sum(mask_omega_all, na.rm = TRUE)
omega_names <- data$prm_names$omega
if (n_omega != length(omega_names)) {
if (n_omega == length(omega_names)) {
prms$label[mask_omega] <- omega_names
} else if (n_omega_all == length(omega_names)) {
prms$label[mask_omega_all] <- omega_names
} else {
warning('[$prob no.', data$problem, ', subprob no.', data$subprob, ', ', data$method,
'] $OMEGA labels did not match the number of OMEGAs in the `.ext` file.', call. = FALSE)
} else {
prms$label[prms$type == 'ome' & prms$diagonal] <- omega_names
}

# Assign SIGMA labels
Expand Down