ImperialCollegeLondon / ImperialCollegeLondon/virtual_ecosystem
Logging in `BaseModel.from_config` methods.
- Dominant language
- Python
- Stars
- 20
- Forks
- 5
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 34
Description
**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.
* I've updated all the variable descriptions
* I've updated all the model required vars sections.
* I'm going through the example log (which very helpfully prints out what data gets checked and set at each step - aren't we clever!) to validate all of the sections.
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.
Contributor guide
Research direction
Run `ve_example` and inspect the log output, then compare `virtual_ecosystem/models/plants/plants_model.py` with `virtual_ecosystem/models/litter/litter_model.py` and the other model `from_config` methods. Make the model setup logging consistent so success is reported after initialization, and confirm the resulting log is clear and consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100