OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
6 stars 0 forks source link

Create first run and dry run env variables to better track throughout generate_signals #211

Closed caldwellst closed 4 months ago

caldwellst commented 4 months ago

Implemented the setup where first run and dry run are env variables. This was used to better track their status through generate_signals() and its internals without having to constantly pass the variables through. This was necessitated because create_images() had a small issue that meant that when generating the historic first runs, first runs within the past 90 days were not properly filtered to the campaign date. The only simple fix was to implement the environment variable HS_FIRST_RUN, otherwise it would've been a complex web of changes to bring the first_run parameter to all of the plot_{indicator} modules and all the way to create_images().

caldwellst commented 4 months ago

Succeeded in running these workflows for testing:

hannahker commented 4 months ago

Also closes #60

caldwellst commented 4 months ago

Yes, I think we should put this in the {box.linters} PR because that is going to change a lot of the imports. It will ensure that everything is run relative to the working directory. I've mentioned on calls but haven't put here yet is that you can do

utils/init.R

#' @exports
box::use(src/utils/cloud_storage)
box::use(src/utils/location_codes)

So just like Python. My idea would be to use current folder structure to have those init files. Then we would just have to do:

box::use(src/utils)

utils$read_az_file() # from cloud_storage.R
utils$function() # any other function in modules in utils