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

Integrate python graphical examples in the test build #3046

Open
karlnapf opened this issue Mar 6, 2016 · 5 comments
Open

Integrate python graphical examples in the test build #3046

karlnapf opened this issue Mar 6, 2016 · 5 comments

Comments

@karlnapf
Copy link
Member

karlnapf commented Mar 6, 2016

Every now and then, we have to re-factor our graphical examples, e.g. #3045

Currently we have no way of checking whether they work.
While we don't want to (Python) unit test these scripts, it would be great if we could at least execute the examples once in our test build. Just like the other python examples

This task is to add the python graphical examples to the test build. This works via creating a CMakeLists.txt file in the appropriate directory, and adding this directory in cmake.

In order to run the graphical examples, the graphical output needs to be re-directed. Otherwise travis and the buildbot will fail. A hack to do this is to append something as

import matplotlib; matplotlib.use('Agg')

to the python example before running it. Google for what it does Here is a hacky way to do this.
@vigsterkr or @lisitsyn might have a better way in their sleves.

@theaverageguy
Copy link
Contributor

I am on it.!

@theaverageguy
Copy link
Contributor

Just checking @karlnapf :

  1. shogun/examples/undocumented/python_modular/graphical/ This would contain the CMakeLists.txt .
  2. Add this directory in cmake .
  3. Appending import matplotlib; matplotlib.use('Agg') to every test python file.

@karlnapf
Copy link
Member Author

something like this. We just want to make sure that all the graphical scripts at least run.
Some care will have to be taken when they go into infinite loops
I suggest googling how to test software with graphical interfaces ... The 'agg' is just a hacky way to do it

@theaverageguy
Copy link
Contributor

I am sending a PR. Please take a look when free @karlnapf . :)
Can I break it into smaller PRs maybe?

@karlnapf
Copy link
Member Author

Please do. Send a PR for a single example first as a prototype. Then we can apply this iteratively to all examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants