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

Fixing some details for the tutorials to run. #997

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

Simnol22
Copy link
Contributor

@Simnol22 Simnol22 commented Sep 8, 2022

Description

While doing the tutorials, some code wasn't running properly. This PR is basically to fix that.

Changes

Adding some imports to the tutorial for scikit,
Fixing a small argument mistake for pytorch,
adding if name == 'main': in python script so that they dont crash on macos.

Tests

  • [ x] I added corresponding tests for bug fixes and new features. If possible, the tests fail without the changes
  • All new and existing tests are passing ($ tox -e py38; replace 38 by your Python version if necessary)

Documentation

  • [ x] I have updated the relevant documentation related to my changes

Quality

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

@@ -52,13 +52,13 @@
# a ``ValueError`` will be raised. At least one of the results must have the type ``objective``,
# the metric that is minimized by the algorithm.

if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

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

This one is part of the sphink-gallery, which automatically convert the script into a sphinx page and a jupiter notebook. Maybe there could be a warning for macos user to try it using the jupiter notebook or encapsulating the code in a main function and running under if __name__ == '__main__'.

@@ -259,8 +259,8 @@ def main(
#%%
# You can test the training pipeline before working with the hyperparameter optimization.


main(epochs=4)
if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

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

Same thing here.

@bouthilx
Copy link
Member

bouthilx commented Sep 8, 2022

Thanks for the fixes! There is an issue with black formatting. You can look at black plugins in vscode to automatically format your code otherwise you can use the pre-commit hook as documented here: https://orion.readthedocs.io/en/latest/developer/ci.html.

@bouthilx bouthilx merged commit f6ca7d8 into Epistimio:develop Sep 23, 2022
@bouthilx bouthilx added the documentation Regarding description, documentation, tutorials, etc label Dec 16, 2022
@notoraptor notoraptor mentioned this pull request Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Regarding description, documentation, tutorials, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants