Conversation
| } | ||
| const datasourceId = m.classId.replace("-total", ""); | ||
| // precalc metrics should have the format: "datasourceId-class" | ||
| if (!m.classId.includes("-")) return false; |
There was a problem hiding this comment.
Thanks @avmey. I thought the -total prefix was a special thing added to all precalc metrics for the precalc process. Why in your benthicCoral and kelpPersist1 example do they not have it? Apologies if I misunderstand, I haven't been deep in this code for a while.
Is there any concern that testing only for a dash (-) will somehow start to include/keep metrics it shouldn't and didn't before? That there may not be test coverage for?
There was a problem hiding this comment.
If there's no subclass then -total is added instead of -class. It's a default or total value. Categorical rasters will precalc as kelp-1, kelp-2, kelp-3 etc. Vector datasources with classkeys will do the same: benthic-coral, benthic-seagrass, benthic-sand, etc. Since we're still checking for a matching datasourceId below, I don't expect any issues with it keeping incorrect metrics.
Previously, any precalc metric that didn't end in
-totalwas removed in cleanup. This discarded vector datasources with classesbenthic-coraland categorical rasterskelpPersist-1precalc metrics incorrectly.Tested with gp
7.0.0-experimental-precalcClean.2and working as expected incalifornia-reports