Closed seananderson closed 3 months ago
While fixing this, it might be worth finally making the TMB code smarter about only bias correcting the index values the user cares about instead of also bias correcting the missing time slices (even though they're fast because they only have 1 fake data point per time slice).
@Lewis-Barnett-NOAA, just noting that this has been fixed and predict.sdmTMB and index integration is now smart about offset and area lengths. You will want to remove any code that uses the hack above around padding the area vector. I've also fleshed out the unit tests around this. I just did a bunch of benchmarking around not calculating the index for any years not in the prediction data frame (currently 1 row of each is included and then omitted at the end) and the time and memory use is almost identical but the code gets more complex... so I may just leave it as is.
Example showing the issue below.
get_index()
should be smart about letting the area vector match up with the originalnewdata
. Instead it currently expects extra 'fake' area values for the extra time slices. @Lewis-Barnett-NOAACreated on 2024-03-18 with reprex v2.1.0