ImperialCollegeLondon / virtual_ecosystem

This repository is the home for the codebase for the Virtual Ecosystem project.
https://virtual-ecosystem.readthedocs.io
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Logging in `BaseModel.from_config` methods. #436

Open davidorme opened 2 months ago

davidorme commented 2 months ago

Describe the bug

I've been going over the Variables PR #431 to try and push it along now that @vgro has broken the back of the update.

But as part of going through the log, I noticed a difference between the PlantsModel.from_config() and everything else. The other models do this (for example):

https://github.com/ImperialCollegeLondon/virtual_ecosystem/blob/a27518a4ba2f294ae3fd2de7607667205bc166bb/virtual_ecosystem/models/litter/litter_model.py#L171-L179

Plants does this:

https://github.com/ImperialCollegeLondon/virtual_ecosystem/blob/a27518a4ba2f294ae3fd2de7607667205bc166bb/virtual_ecosystem/models/plants/plants_model.py#L154-L169

Okay - so that is a little paranoid but there is a practical difference in the logging output. With plants, there is a message after all the init logging indicating model success. The other models report an intermediate step - they only claim to have extracted the information needed - but the messages read a bit like the __init__ has completed and then are followed by all the logging messages.

I think we should shift to using a Plants like setup for all model - it makes the logs clearer - but we should be consistent either way.

To Reproduce

Run ve_example and look at the log.