pyPESTO icon indicating copy to clipboard operation
pyPESTO copied to clipboard

Result dataclasses

Open dilpath opened this issue 3 years ago • 1 comments

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)

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

dilpath avatar Feb 01 '22 15:02 dilpath

:+1: Nice idea!

jvanhoefer avatar Feb 01 '22 15:02 jvanhoefer