ICB-DCM / pyPESTO

python Parameter EStimation TOolbox
https://pypesto.readthedocs.io
BSD 3-Clause "New" or "Revised" License
217 stars 47 forks source link

`Ensemble.from_optimization_{history,endpoints}` assumes that `OptimizerResult.id` is always convertible to `int` #1349

Closed dweindl closed 5 months ago

dweindl commented 6 months ago

pypesto.ensemble.ensemble.Ensemble.from_optimization_{history,endpoints} assumes that OptimizerResult.id is always convertible to int

Here: https://github.com/ICB-DCM/pyPESTO/blob/82b7d5da1273b9d442a634e5aabbda9685279d77/pypesto/ensemble/ensemble.py#L672 and here: https://github.com/ICB-DCM/pyPESTO/blob/82b7d5da1273b9d442a634e5aabbda9685279d77/pypesto/ensemble/ensemble.py#L803

Since the attribute is called id (and not index or anything the like), I don't think this is valid.

Those values are used to populate Ensemble.vector_tags: Sequence[tuple[int, int]] which I don't see being used anywhere. Therefore, I'd suggest to just use the id string without attempting conversion to int and changing the type of Ensemble.vector_tags to Sequence[Any].