Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dweindl opened this issue Apr 2, 2024 · 0 comments · Fixed by #1351
Labels
bug Something isn't working ensembles Related to parameter ensembles fixed but not released

Comments

@dweindl
Copy link
Member

dweindl commented Apr 2, 2024

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

Here:

vector_tags.append((int(start["id"]), -1))

and here:
(int(result.optimize_result.list[start]["id"]), ind)

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].

@dweindl dweindl added bug Something isn't working ensembles Related to parameter ensembles labels Apr 2, 2024
dweindl added a commit to dweindl/pyPESTO that referenced this issue Apr 2, 2024
Fixes `Ensemble.from_optimization_{history,endpoints}`, which incorrectly assumed that `OptimizerResult.id` is always convertible to `int`.

Closes ICB-DCM#1349.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ensembles Related to parameter ensembles fixed but not released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants