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

Fix IndexError for freshly branched exp #898

Merged
merged 2 commits into from
May 3, 2022

Conversation

vmichals
Copy link
Contributor

@vmichals vmichals commented May 2, 2022

Description

The plotting backend functions fetch a trial of the experiment to infer the objective. For a freshly branched experiment that doesn't have trials yet, the trial list is empty. This results in an IndexError when the functions try to access the first element of the fetch_trials_by_status() calls here and here.

Changes

This PR changes the fetch_trials_by_status calls to copy the plotting functions' with_evc_tree arguments to (optionally) fetch trials from prior versions of the experiment if the with_evc_tree flag is set to True.

Checklist

Optional:

  • Maybe add an error message if not with_evc_tree and the current experiment does not have trials yet that is shown instead of the IndexError.

Tests

Didn't have time to run tests, sorry :/

Documentation

N/A

Quality

  • I have read the CONTRIBUTING doc
  • My commits messages follow this format
  • My code follows the style guidelines ($ tox -e lint)

Plotting backend functions require a trial to read the objective of the
experiment. A freshly branched experiment has no own trials, so we fetch
those from the evc tree instead.
@bouthilx
Copy link
Member

bouthilx commented May 2, 2022

Thanks for this PR! You can fix the black issue by running locally $ tox -e run-black.

@vmichals
Copy link
Contributor Author

vmichals commented May 2, 2022

Done!

Copy link
Member

@bouthilx bouthilx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thank you!

@bouthilx bouthilx merged commit 40016cb into Epistimio:develop May 3, 2022
@bouthilx bouthilx added the bug Indicates an unexpected problem or unintended behavior label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants