CNM-University-of-Guelph / NASEM-Model-Python

The NASEM 8 model coded in python
Other
0 stars 0 forks source link

Refactor model output #142

Closed BFieguth closed 2 months ago

BFieguth commented 2 months ago

Fill in information for PR below. On review, add additional commits and a comment thats checks off any tasks so that all are complete before merging.

Description of changes

Refactor of ModelOuput class to make it easier to work with. The data structure is now loaded from model_output_structure.json file, providing a human readable version of the Class and making it easier to modify. This also significantly reduces the clutter in the ModelOutput class definition.

Initalization was refactored to use a single method to create all categories instead of giving each category a seperate method. Report generation is now performed by the get_report method which takes a table name and returns the Dataframe. The formatting for the report tables are loaded from the report_structure.json.

The unused.py module has been renamed reporting.py and is used to calculate any values that are used for reporting only. This ensures that no calculations need to be performed by the ModelOutput class. These values are stored in the new "Reporting" category in ModelOutput.

Issue number/s

fixes #118 fixes #124 fixes #125

Checklist of all completed

Mark with [x] to show completed: