-
Notifications
You must be signed in to change notification settings - Fork 37
Fix scalar log_M handling in catch-at-age output #1321
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
base: main
Are you sure you want to change the base?
Changes from all commits
20ec7e5
2102611
f345240
546bc82
82ef762
d58585b
1c3ab1e
e0dd233
36f91d0
ec1a0f9
5e4c9c2
133a9e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -203,8 +203,8 @@ class CatchAtAge : public FisheryModelBase<Type> { | |||||||||||||
| for (size_t age = 0; age < population->n_ages; age++) { | ||||||||||||||
| for (size_t year = 0; year < population->n_years; year++) { | ||||||||||||||
| size_t i_age_year = age * population->n_years + year; | ||||||||||||||
|
Comment on lines
203
to
205
|
||||||||||||||
| for (size_t age = 0; age < population->n_ages; age++) { | |
| for (size_t year = 0; year < population->n_years; year++) { | |
| size_t i_age_year = age * population->n_years + year; | |
| for (size_t year = 0; year < population->n_years; year++) { | |
| for (size_t age = 0; age < population->n_ages; age++) { | |
| size_t i_age_year = year * population->n_ages + age; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is an artifact with how we implemented the transformation code in the past:
// Transformation Section
for (size_t age = 0; age < this->nages; age++) {
this->weight_at_age[age] = growth->evaluate(ages[age]);
for (size_t year = 0; year < this->nyears; year++) {
size_t i_age_year = age * this->nyears + year;
this->M[i_age_year] = fims_math::exp(this->log_M[i_age_year]);
}
}
Rather than track this->weight_at_age, the catch_at_age.hpp file just references growth->evaluate(year, ages[age]) directly.
@msupernaw, is there a reason for this change? Do we want to add a weight_at_age vector back in that we track? If not, we can just move forward with switching the order of how the transformation is called so it is consistent with the Evaluate() function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scalar
log_MJSON dimensionality branch introduces a new header label"scalar". Elsewhere in this file, non-indexed vectors use header"na"(e.g., Fleetlog_q), which is also specially handled bydimensions_to_tibble()to avoid creating an extra dimension column. Consider using the existing"na"convention here (and for scalarmortality_Mdim names) or update the R reshaping helpers to treat"scalar"the same way, to keep output schemas consistent.