pyPESTO
pyPESTO copied to clipboard
Result dataclasses
Feature description
Result objects refactored to be dataclasses [1]. e.g. OptimizerResult [2] already looks like a dataclass.
Motivation/Application
- simpler code in pyPESTO
- benefits of dataclasses
- transform combined results into other useful types (e.g.
pd.DataFrame(list_of_dataclass)) - automatic
__repr__and__eq__(though may need to be customized in pyPESTO)
- transform combined results into other useful types (e.g.
Issues
- backwards-compatibility
- deprecation warnings and temporary methods for compatibility could be used.
[1] https://docs.python.org/3/library/dataclasses.html [2] https://github.com/ICB-DCM/pyPESTO/blob/a4ce1d219774b265b9825eca827e7e18d57f37ef/pypesto/result/optimize.py#L66-L105
:+1: Nice idea!