-
Notifications
You must be signed in to change notification settings - Fork 361
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
Create a new figure and test each plot type #127
Comments
Plotting is the only module that isn't being tested right now, this should increase coverage to 90%. |
Does this still need work? |
@suyash458 Yes! |
@suyash458 What do you think we should use to do this, pytest or matplotlib's image_comparison? +1 on moving plot from Yes, baseline image for testing each type of plot should be generated, which can be done with the CLI or the API. |
@vinayak-mehta pytest-mpl looks like the better option as it's more customizable. The tolerance, baseline directory and file name can be specified explicitly. There are options to generate the baseline images A kwarg(defaults to |
@suyash458 pytest-mpl LGTM too. Yes, |
- move `plot()` to `plotting.py` as `plot_pdf()` - modify plotting functions to return matplotlib figures - add `test_plotting.py` and baseline images - import `plot_pdf()` in `__init__` - update `cli.py` to use `plot_pdf()` - update advanced usage docs to reflect changes
Can't the contour plot be done with a Rectangle patch instead of |
IIRC, I used |
As per this answer, passing |
Looks good, can you try using it in plot_contour? |
The results are identical, I've updated #179 |
* [MRG] Create a new figure and test each plot type #127 - move `plot()` to `plotting.py` as `plot_pdf()` - modify plotting functions to return matplotlib figures - add `test_plotting.py` and baseline images - import `plot_pdf()` in `__init__` - update `cli.py` to use `plot_pdf()` - update advanced usage docs to reflect changes * Change matplotlib backend for image comparison tests * Update plotting and tests - use matplotlib rectangle instead of `cv2.rectangle` in `plot_contour()` - set matplotlib backend in `tests/__init__` - update contour plot baseline image - update `test_plotting` with more checks * Update plot tests and config - remove unnecessary asserts - update setup.cfg and makefile with `--mpl` * Add to * Add tolerance * remove text from baseline plots update plot tests with `remove_text` * Change method name, update docs and add pep8 * Update docs
Closed in #179. |
Camelot supports plotting of 5 types of geometries for debugging and tweaking parser configurations.
Plotting needs to be refactored in such a way that all plot functions return a matplotlib figure, so that they can be tested either by using pytest or matplotlib's image_comparison decorator. You can also check how pandas tests plots.
The user should be given an option to save their plots, in addition to the current option of just displaying the figure, which might fail when there are no screens available.
The new plots should also be tested to work in Jupyter notebooks.
The text was updated successfully, but these errors were encountered: