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

Consider not dropping to Type in subset #75

Open
lentinj opened this issue Sep 10, 2022 · 2 comments
Open

Consider not dropping to Type in subset #75

lentinj opened this issue Sep 10, 2022 · 2 comments

Comments

@lentinj
Copy link
Collaborator

lentinj commented Sep 10, 2022

Currently when subsetting, x[1,2,3] will convert from array<Type> to Type. I suspect this causes more headaches than it solves, in particular, whether sum() will work on the end result.

Try turning it off, and see if we can get by with using [[ to resolve any cases that it breaks.

If this works, we can get rid of the condition surrounding sum in g3l_distribution_sumofsquares()

@lentinj
Copy link
Collaborator Author

lentinj commented Sep 10, 2022

stock__migratematrix[stock__destarea_idx, stock__area_idx] <- migrate_f

Doesn't look like [[ as an lvalue works either.

EDIT: Fixed in df8dc70

@lentinj
Copy link
Collaborator Author

lentinj commented Feb 22, 2023

stock_ss(nllstock__weight) <- weight and stock_ss(fleet_stock__catch) both expect a scalar result, not vector.

lentinj added a commit that referenced this issue Mar 13, 2023
Remove auto-scalar-ing from run_tmb, deal with some of the fallout.

Expressions like:

 x[1,2,3] <- y

...are problematic. y could either be a scalar (as with
nllstock__weight) or a vector (as with assigning to reports). So
automatically doing x[1,2,3][[1]] won't do the right thing in all
cases, and having to add it manually (as is being done below) is ugly
to say the least.

Ideally tmbutils::array would sort this out for us.

There's also transform matrix tests failing, which may or may not be
related.
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

No branches or pull requests

1 participant