healthysustainablecities / global-indicators

An open-source tool for calculating and reporting spatial indicators for healthy, sustainable cities worldwide using open or custom data.
MIT License
86 stars 35 forks source link

Standalone function to generate a policy report without configuring a study region #462

Open carlhiggs opened 5 months ago

carlhiggs commented 5 months ago

Some users will complete policy reviews and not undertake spatial indicator analysis.

Currently reporting assumes that configuration for undertaking spatial indicator analysis will be completed, but this will not work for those users only completing a policy review. It would involved completing information not relevant to their task (or our task, generating the policy report on their behalf).

Instead, what is required is a stand-alone function to generate a policy report without configuring a study region.

This should be able to be called like,

import ghsci
ghsci.generate_policy_report(path='path_to_excel_checklist_file.xlsx', language='English', options={})

Language (str) and options (dict) would be optional.

The options dictionary would optionally allow users to pass on reporting parameters, specifically, the locations of custom images and any additional language overrides that may be desired.

The generate_policy_report() function might be best defined in _utils.py (where reporting functionality is currently operationalised), but implemented using a wrapper function in ghsci so it is readily callable upon import of the software.

If no checklist were supplied, it should fall back to using the demo region. This can be implemented in the first instance for prototyping purposes.

The idea under the hood would be, given an Excel file, a ghsci.Region object would be synthesised to have all the required information to otherwise generate a report using our existing functionality. So, the user doesn't have to set up their configuration file; we do it for them, only just using the information required to produce the policy report they are interested in.

carlhiggs commented 1 week ago

This has been implemented, but requires more testing with other languages and documentation on usage