RMI-PACTA / pacta.executive.summary

Repo containing the code to generate charts in the PACTA COP executive summary document.
https://rmi-pacta.github.io/pacta.executive.summary/
Other
2 stars 2 forks source link

Optimize assets #336

Closed AlexAxthelm closed 2 months ago

AlexAxthelm commented 2 months ago

the R CMD Check actions are throwing NOTEs that the installed package size is bigger than is healthy. The note specifically calls out the extdata directory (where templates are) as a primary point of investigation.

Cursory examination indicates that the big files in that directory are all static image assets, so using an image compression optimizer should help with this issue, without sacrificing quality.

See https://dieghernan.github.io/202402_optimize-images-r/

https://github.com/RMI-PACTA/pacta.executive.summary/actions/runs/9561754249/job/26356655961#step:6:201

MonikaFu commented 2 months ago

The question is do we want to be dependent on this package I'd say. Especially because the images relate mostly to old templates which I am not even sure if we need to support since I guess users can't view their PA2022CH results anymore? So maybe we can just remove those templates given that we copied everything that was relevant there?

Another idea would be to more the templates to a separate directory as it is done for interactive reports?

AlexAxthelm commented 2 months ago

I don't see this as introducing a dependency, since this would be a one-time thing (or rarely as we introduce new assets).

As a bigger picture item, I do think that splitting out the old templates is worthwhile, but I think that should maybe be part of a bigger effort to rethink report generation.

MonikaFu commented 2 months ago

ah, I see. I've misunderstood how it works. I guess then maybe it would be useful to document the process than so that each time we introduce new assets we use the package on them? I will be adding new plots soon to the annex and it would be good for posterity in general.