Skip to content

Commit

Permalink
Test coverage for lines (#274)
Browse files Browse the repository at this point in the history
* Add line tests for base module, changes to line methods in base module.

* Fixed bug with how line limits are checke

* Update setuptools from 42.0.2 to 45.2.0 (#190)

* raster inherits from vector rather than base (#76)

* Allow geodataframes in assert_polygons (#188)

* fixing a few syntax errors (#194)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* fixing a few syntax errors

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

* remove tabls

Co-authored-by: Nathan Korinek <[email protected]>

* update changelog for release

* Bump version: 0.1.1 → 0.1.2

* Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

* Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

* Update codecov to 2.0.16 (#202)

* Update codecov from 2.0.15 to 2.0.16

* update from master (#211)

* Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

* Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

Co-authored-by: Nathan Korinek <[email protected]>

Co-authored-by: Leah Wasser <[email protected]>
Co-authored-by: Nathan Korinek <[email protected]>

* Contributors update (#213)

* Added contributor rst file and moved that information out of the README file

* Implemented requested changes to README

* Update setuptools from 45.2.0 to 46.0.0 (#215)

* Update pytest from 5.3.5 to 5.4.1

* Add Assert points function & cleanup duplicate methods (#203)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* Taking out redundant tests

* Typo

* Fixing how vector checks for truth value of a dataframe

* merge

* Additional vector tests (#212)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* First round of tests for vector

* black

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* rough drafts of more tests

* Added more tests for legends

* Added more tests, and took out broken tests

* small codacy fix

* Fixed test!

* Taking out redundant tests

* Took out unneccesary tests

* Added plt.close

* Added more tests

* Typo

* more tests for uncovered parts of the vector file

* black

* Fixed issues with vector checking truth value of dataframe, and added tests

* Fixing how vector checks for truth value of a dataframe

* Added more coverage!

* Broke tests up into individual files

* black

* Added tests for outlier cases

* Update matplotcheck/tests/test_points.py

typo

Co-Authored-By: Leah Wasser <[email protected]>

* took plt.gca() out of tests

* Added changes suggested on GitHub

* Update CHANGELOG.md

* fix import order

* import order fix

* import order

* import order

Co-authored-by: Leah Wasser <[email protected]>

* Add tests to the Autograde module (#224)

* Added tests for the autograde module

* removed unneccesary import

* Fixing issues that were failing in base_data

* codacy

* flake8

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Updated changelog

* flake8 fix

Co-authored-by: Leah Wasser <[email protected]>

* Hist bin midpoints (#204)

* Add a get and assert function for bin midpoints, as well as tests for those functions

* Updated docstrings

* Added changelog changes and fixed minor formatting issue

* small flake8 fix

* Added midpoints functionatlity to the vignette for histogram testing

* Adding in changes suggested on GitHub1

* Fixed function description

* Took out all instances of  in example

* update docs

* Fixed small bug with section titles

* Update matplotcheck/tests/test_base_data.py

* reworded changelog

Co-authored-by: Leah Wasser <[email protected]>

* Update setuptools from 46.1.1 to 46.1.3 (#231)

* Title assert accepts strings (#229)

* Fixed assert_title_contains to take strings as well as lists

* Better implementation

* Changelog update

Co-authored-by: Leah Wasser <[email protected]>

* M2r remove (#247)

* Removed m2r from matplotcheck, and reformated code of conduct

* Seeing if rebase works

* removed an m2r import

* Fixing up the docs a bit

* changelog updates

* # This is a combination of 2 commits.
# This is the 1st commit message:

Update setuptools from 42.0.2 to 45.2.0 (#190)

raster inherits from vector rather than base (#76)

Allow geodataframes in assert_polygons (#188)

fixing a few syntax errors (#194)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* fixing a few syntax errors

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

* remove tabls

Co-authored-by: Nathan Korinek <[email protected]>

update changelog for release

Bump version: 0.1.1 → 0.1.2

Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

Update codecov to 2.0.16 (#202)

* Update codecov from 2.0.15 to 2.0.16

* update from master (#211)

* Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

* Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

Co-authored-by: Nathan Korinek <[email protected]>

Co-authored-by: Leah Wasser <[email protected]>
Co-authored-by: Nathan Korinek <[email protected]>

Contributors update (#213)

* Added contributor rst file and moved that information out of the README file

* Implemented requested changes to README

Update setuptools from 45.2.0 to 46.0.0 (#215)

Add Assert points function & cleanup duplicate methods (#203)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* Taking out redundant tests

* Typo

* Fixing how vector checks for truth value of a dataframe

Update pytest from 5.3.5 to 5.4.1

merge

Additional vector tests (#212)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* First round of tests for vector

* black

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* rough drafts of more tests

* Added more tests for legends

* Added more tests, and took out broken tests

* small codacy fix

* Fixed test!

* Taking out redundant tests

* Took out unneccesary tests

* Added plt.close

* Added more tests

* Typo

* more tests for uncovered parts of the vector file

* black

* Fixed issues with vector checking truth value of dataframe, and added tests

* Fixing how vector checks for truth value of a dataframe

* Added more coverage!

* Broke tests up into individual files

* black

* Added tests for outlier cases

* Update matplotcheck/tests/test_points.py

typo

Co-Authored-By: Leah Wasser <[email protected]>

* took plt.gca() out of tests

* Added changes suggested on GitHub

* Update CHANGELOG.md

* fix import order

* import order fix

* import order

* import order

Co-authored-by: Leah Wasser <[email protected]>

Add tests to the Autograde module (#224)

* Added tests for the autograde module

* removed unneccesary import

* Fixing issues that were failing in base_data

* codacy

* flake8

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Updated changelog

* flake8 fix

Co-authored-by: Leah Wasser <[email protected]>

Hist bin midpoints (#204)

* Add a get and assert function for bin midpoints, as well as tests for those functions

* Updated docstrings

* Added changelog changes and fixed minor formatting issue

* small flake8 fix

* Added midpoints functionatlity to the vignette for histogram testing

* Adding in changes suggested on GitHub1

* Fixed function description

* Took out all instances of  in example

* update docs

* Fixed small bug with section titles

* Update matplotcheck/tests/test_base_data.py

* reworded changelog

Co-authored-by: Leah Wasser <[email protected]>

Update setuptools from 46.1.1 to 46.1.3 (#231)

Title assert accepts strings (#229)

* Fixed assert_title_contains to take strings as well as lists

* Better implementation

* Changelog update

Co-authored-by: Leah Wasser <[email protected]>

M2r remove (#247)

* Removed m2r from matplotcheck, and reformated code of conduct

* Seeing if rebase works

* removed an m2r import

* Fixing up the docs a bit

* changelog updates

Allow geodataframes in assert_polygons (#188)

fixing a few syntax errors (#194)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* fixing a few syntax errors

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

* remove tabls

Co-authored-by: Nathan Korinek <[email protected]>

Get images function (#193)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

Co-authored-by: Leah Wasser <[email protected]>

Bump version: 0.1.1 → 0.1.2

Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

Contributors update (#213)

* Added contributor rst file and moved that information out of the README file

* Implemented requested changes to README

Add Assert points function & cleanup duplicate methods (#203)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* Taking out redundant tests

* Typo

* Fixing how vector checks for truth value of a dataframe

Additional vector tests (#212)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* First round of tests for vector

* black

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* rough drafts of more tests

* Added more tests for legends

* Added more tests, and took out broken tests

* small codacy fix

* Fixed test!

* Taking out redundant tests

* Took out unneccesary tests

* Added plt.close

* Added more tests

* Typo

* more tests for uncovered parts of the vector file

* black

* Fixed issues with vector checking truth value of dataframe, and added tests

* Fixing how vector checks for truth value of a dataframe

* Added more coverage!

* Broke tests up into individual files

* black

* Added tests for outlier cases

* Update matplotcheck/tests/test_points.py

typo

Co-Authored-By: Leah Wasser <[email protected]>

* took plt.gca() out of tests

* Added changes suggested on GitHub

* Update CHANGELOG.md

* fix import order

* import order fix

* import order

* import order

Co-authored-by: Leah Wasser <[email protected]>

# This is the commit message #2:

Update setuptools from 46.1.1 to 46.1.3 (#231)

* Minor change to assert_xy conversion method.

* Revert "Minor change to assert_xy conversion method."

This reverts commit bfa569f.

* fix copyright on docs (#244)

* Add pillow (#254)

* add pillow as a dev requirement

* update for pillow addition

* Improved handline of lines without xy-data (Issue #238)

* Added docstrings to line tests.

* Added Seaborn to dev requirements

* Undo changes regarding x-limits problems (Issue #235)

* Fixed issue with new way of checking that the data is covered by the line

* Changelog to rst (#267)

* Update setuptools from 42.0.2 to 45.2.0 (#190)

* raster inherits from vector rather than base (#76)

* Allow geodataframes in assert_polygons (#188)

* fixing a few syntax errors (#194)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* fixing a few syntax errors

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

* remove tabls

Co-authored-by: Nathan Korinek <[email protected]>

* update changelog for release

* Bump version: 0.1.1 → 0.1.2

* Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

* Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

* Update codecov to 2.0.16 (#202)

* Update codecov from 2.0.15 to 2.0.16

* update from master (#211)

* Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

* Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

Co-authored-by: Nathan Korinek <[email protected]>

Co-authored-by: Leah Wasser <[email protected]>
Co-authored-by: Nathan Korinek <[email protected]>

* Contributors update (#213)

* Added contributor rst file and moved that information out of the README file

* Implemented requested changes to README

* Update setuptools from 45.2.0 to 46.0.0 (#215)

* Update pytest from 5.3.5 to 5.4.1

* Add Assert points function & cleanup duplicate methods (#203)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* Taking out redundant tests

* Typo

* Fixing how vector checks for truth value of a dataframe

* merge

* Additional vector tests (#212)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* First round of tests for vector

* black

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* rough drafts of more tests

* Added more tests for legends

* Added more tests, and took out broken tests

* small codacy fix

* Fixed test!

* Taking out redundant tests

* Took out unneccesary tests

* Added plt.close

* Added more tests

* Typo

* more tests for uncovered parts of the vector file

* black

* Fixed issues with vector checking truth value of dataframe, and added tests

* Fixing how vector checks for truth value of a dataframe

* Added more coverage!

* Broke tests up into individual files

* black

* Added tests for outlier cases

* Update matplotcheck/tests/test_points.py

typo

Co-Authored-By: Leah Wasser <[email protected]>

* took plt.gca() out of tests

* Added changes suggested on GitHub

* Update CHANGELOG.md

* fix import order

* import order fix

* import order

* import order

Co-authored-by: Leah Wasser <[email protected]>

* Add tests to the Autograde module (#224)

* Added tests for the autograde module

* removed unneccesary import

* Fixing issues that were failing in base_data

* codacy

* flake8

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Updated changelog

* flake8 fix

Co-authored-by: Leah Wasser <[email protected]>

* Hist bin midpoints (#204)

* Add a get and assert function for bin midpoints, as well as tests for those functions

* Updated docstrings

* Added changelog changes and fixed minor formatting issue

* small flake8 fix

* Added midpoints functionatlity to the vignette for histogram testing

* Adding in changes suggested on GitHub1

* Fixed function description

* Took out all instances of  in example

* update docs

* Fixed small bug with section titles

* Update matplotcheck/tests/test_base_data.py

* reworded changelog

Co-authored-by: Leah Wasser <[email protected]>

* Update setuptools from 46.1.1 to 46.1.3 (#231)

* Title assert accepts strings (#229)

* Fixed assert_title_contains to take strings as well as lists

* Better implementation

* Changelog update

Co-authored-by: Leah Wasser <[email protected]>

* M2r remove (#247)

* Removed m2r from matplotcheck, and reformated code of conduct

* Seeing if rebase works

* removed an m2r import

* Fixing up the docs a bit

* changelog updates

* # This is a combination of 2 commits.
# This is the 1st commit message:

Update setuptools from 42.0.2 to 45.2.0 (#190)

raster inherits from vector rather than base (#76)

Allow geodataframes in assert_polygons (#188)

fixing a few syntax errors (#194)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* fixing a few syntax errors

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

* remove tabls

Co-authored-by: Nathan Korinek <[email protected]>

update changelog for release

Bump version: 0.1.1 → 0.1.2

Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

Update codecov to 2.0.16 (#202)

* Update codecov from 2.0.15 to 2.0.16

* update from master (#211)

* Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

* Assert string accept spaces (#205)

* Made it so that assert_string_contains accepts key words with spaces

* black

* renaming function

* Showed assert_title_contains working with a space in the keyword in vignette

Co-authored-by: Nathan Korinek <[email protected]>

Co-authored-by: Leah Wasser <[email protected]>
Co-authored-by: Nathan Korinek <[email protected]>

Contributors update (#213)

* Added contributor rst file and moved that information out of the README file

* Implemented requested changes to README

Update setuptools from 45.2.0 to 46.0.0 (#215)

Add Assert points function & cleanup duplicate methods (#203)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* Taking out redundant tests

* Typo

* Fixing how vector checks for truth value of a dataframe

Update pytest from 5.3.5 to 5.4.1

merge

Additional vector tests (#212)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* First round of tests for vector

* black

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* rough drafts of more tests

* Added more tests for legends

* Added more tests, and took out broken tests

* small codacy fix

* Fixed test!

* Taking out redundant tests

* Took out unneccesary tests

* Added plt.close

* Added more tests

* Typo

* more tests for uncovered parts of the vector file

* black

* Fixed issues with vector checking truth value of dataframe, and added tests

* Fixing how vector checks for truth value of a dataframe

* Added more coverage!

* Broke tests up into individual files

* black

* Added tests for outlier cases

* Update matplotcheck/tests/test_points.py

typo

Co-Authored-By: Leah Wasser <[email protected]>

* took plt.gca() out of tests

* Added changes suggested on GitHub

* Update CHANGELOG.md

* fix import order

* import order fix

* import order

* import order

Co-authored-by: Leah Wasser <[email protected]>

Add tests to the Autograde module (#224)

* Added tests for the autograde module

* removed unneccesary import

* Fixing issues that were failing in base_data

* codacy

* flake8

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Update matplotcheck/tests/test_autograde.py

Co-Authored-By: Leah Wasser <[email protected]>

* Updated changelog

* flake8 fix

Co-authored-by: Leah Wasser <[email protected]>

Hist bin midpoints (#204)

* Add a get and assert function for bin midpoints, as well as tests for those functions

* Updated docstrings

* Added changelog changes and fixed minor formatting issue

* small flake8 fix

* Added midpoints functionatlity to the vignette for histogram testing

* Adding in changes suggested on GitHub1

* Fixed function description

* Took out all instances of  in example

* update docs

* Fixed small bug with section titles

* Update matplotcheck/tests/test_base_data.py

* reworded changelog

Co-authored-by: Leah Wasser <[email protected]>

Update setuptools from 46.1.1 to 46.1.3 (#231)

Title assert accepts strings (#229)

* Fixed assert_title_contains to take strings as well as lists

* Better implementation

* Changelog update

Co-authored-by: Leah Wasser <[email protected]>

M2r remove (#247)

* Removed m2r from matplotcheck, and reformated code of conduct

* Seeing if rebase works

* removed an m2r import

* Fixing up the docs a bit

* changelog updates

Allow geodataframes in assert_polygons (#188)

fixing a few syntax errors (#194)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* fixing a few syntax errors

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

* remove tabls

Co-authored-by: Nathan Korinek <[email protected]>

Get images function (#193)

* First draft of get_images function

* Added a test for get_image

* Changelog update

* minor formatting change.

* black changes

* Update matplotcheck/raster.py

Co-Authored-By: Leah Wasser <[email protected]>

Co-authored-by: Leah Wasser <[email protected]>

Bump version: 0.1.1 → 0.1.2

Add flake8 fix [WIP] (#199)

* add flake 8

* yay cleanup

* update change log

* add flake 8 dep

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* more line length issues

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* fixed test_base_axis.py

* fixed text_base_data.py

* fixed test_base_legends.py

* fixed test_base_titles_captions.py

* Format files to be flake8 acceptable (#197)

* autograde flake8 fixes

* Fixed base to be flake8 compliant (phew)

* Made folium.py flake8 compliant

* made notebook.py flake8 compliant

* Fixed raster.py for flake8

* Fixed timeseries.py

* fixed conftest.py

* fixed test_base.py

* Fixed test_raster.py and issue with legends tests

* black

* more black changes

* Fixing merge conflicts that were found

* Changing accepted changes

* minor changes

* Changing to make CI happy, modified to pass black and make -B docs

* Reformatting to make black and flake8 happy. Also updated crs assignment

* Fixed formatting issue with timeseries

* Better fix for timeseries formatting

* Black

Co-authored-by: Leah Wasser <[email protected]>

Contributors update (#213)

* Added contributor rst file and moved that information out of the README file

* Implemented requested changes to README

Add Assert points function & cleanup duplicate methods (#203)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* Taking out redundant tests

* Typo

* Fixing how vector checks for truth value of a dataframe

Additional vector tests (#212)

* Added a get_points() and assert_points() function to the vector tester.

* Added in get_points() and assert_points() functions with tests

* Added proper documentation

* Small fix to please codacy

* black

* Updated changelog

* First round of tests for vector

* black

* Rough draft for bug fix

* Fixed bug with multiple geometries plotted alongside bug with identical x values causing failure!

* typo

* Fixed small bug with markersize

* Added comments explaining code

* rough drafts of more tests

* Added more tests for legends

* Added more tests, and took out broken tests

* small codacy fix

* Fixed test!

* Taking out redundant tests

* Took out unneccesary tests

* Added plt.close

* Added more tests

* Typo

* more tests for uncovered parts of the vector file

* black

* Fixed issues with vector checking truth value of dataframe, and added tests

* Fixing how vector checks for truth value of a dataframe

* Added more coverage!

* Broke tests up into individual files

* black

* Added tests for outlier cases

* Update matplotcheck/tests/test_points.py

typo

Co-Authored-By: Leah Wasser <[email protected]>

* took plt.gca() out of tests

* Added changes suggested on GitHub

* Update CHANGELOG.md

* fix import order

* import order fix

* import order

* import order

Co-authored-by: Leah Wasser <[email protected]>

# This is the commit message #2:

Update setuptools from 46.1.1 to 46.1.3 (#231)

* fix copyright on docs (#244)

* Add pillow (#254)

* add pillow as a dev requirement

* update for pillow addition

* Changed the changelog to an rst file instead of a markdown file and added it to the docs build.

* Put changelog changes into the new changelog lol

Co-authored-by: pyup.io bot <[email protected]>
Co-authored-by: Leah Wasser <[email protected]>

* setup greetings! (#257)

* Made checking line coverage optional for base.assert_line()

* Fix double requirement in dev-requirements.txt

* Change seaborn version

* Seaborn requirement version change

* Added comment to clarify changes

* Merged two PRs and made it so they pass pytest

* black

* Added more tests to test that the limit checks are correct in the assert_line function

* pleasing flake8 issues that came up on the pr

* Update matplotcheck/base.py

* Update matplotcheck/base.py

* small typo fix!

Co-authored-by: Ryan (Marty) LaRocque <[email protected]>
Co-authored-by: pyup.io bot <[email protected]>
Co-authored-by: Leah Wasser <[email protected]>
  • Loading branch information
4 people committed May 14, 2020
1 parent f81f819 commit 57646ec
Show file tree
Hide file tree
Showing 7 changed files with 301 additions and 66 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`
Unreleased
----------

- Changed how `assert_lines` checks the limits of lines (@nkorinek, #243)
- Changed changelog to an rst file. (@nkorinek, #266)
- Add a vignette for testing vector data plots. (@nkorinek, #208)
- Add ``pillow`` as a dev requirement (@lwasser, #253)
Expand All @@ -27,6 +28,9 @@ Unreleased
(@nkorinek, #121)
- Changed tolerance functionality from relative tolerance to absolute
tolerance. (@ryla5068, #234)
- Made checking line coverage optional for `base.assert_line()`
(@ryla5068, #239)
- Fixed bugs involving line tests (@ryla5068, #239)
- Improved handling of datasets with different shapes in base.assert_xy() (@ryla5068, #233)
- Bug fix for handling object datatypes in base.assert_xy() (@ryla5068, #232)

Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ setuptools==46.1.3
pre-commit==1.20.0
pip==19.0.3
descartes==1.1.0
seaborn>=0.9.1
pillow==7.1.2
161 changes: 100 additions & 61 deletions matplotcheck/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def _is_line(self):
"""

if self.ax.lines:
for l in self.ax.lines:
for line in self.ax.lines:
if (
not l.get_linestyle()
or not l.get_linewidth()
or l.get_linewidth() > 0
not line.get_linestyle()
or not line.get_linewidth()
or line.get_linewidth() > 0
):
return True

Expand All @@ -68,11 +68,11 @@ def _is_scatter(self):
if self.ax.collections:
return True
elif self.ax.lines:
for l in self.ax.lines:
for line in self.ax.lines:
if (
l.get_linestyle() == "None"
or l.get_linewidth() == "None"
or l.get_linewidth() == 0
line.get_linestyle() == "None"
or line.get_linewidth() == "None"
or line.get_linewidth() == 0
):
return True
return False
Expand Down Expand Up @@ -482,9 +482,9 @@ def assert_lims(
"""
# Get axis limit values
if axis == "x":
lims = [int(l) for l in self.ax.get_xlim()]
lims = [int(xlim) for xlim in self.ax.get_xlim()]
elif axis == "y":
lims = [int(l) for l in self.ax.get_ylim()]
lims = [int(ylim) for ylim in self.ax.get_ylim()]
else:
raise ValueError(
"axis must be one of the following string ['x', 'y']"
Expand Down Expand Up @@ -673,7 +673,7 @@ def assert_legend_labels(
legend_texts = [
t.get_text().lower() for leg in legends for t in leg.get_texts()
]
labels_exp = [l.lower() for l in labels_exp]
labels_exp = [label.lower() for label in labels_exp]

num_exp_labs = len(labels_exp)
num_actual_labs = len(legend_texts)
Expand Down Expand Up @@ -786,9 +786,12 @@ def get_xy(self, points_only=False):
if points_only:
xy_coords = [
val
for l in self.ax.lines
if (l.get_linestyle() == "None" or l.get_linewidth() == "None")
for val in l.get_xydata()
for line in self.ax.lines
if (
line.get_linestyle() == "None"
or line.get_linewidth() == "None"
)
for val in line.get_xydata()
] # .plot()
xy_coords += [
val
Expand All @@ -799,7 +802,7 @@ def get_xy(self, points_only=False):

else:
xy_coords = [
val for l in self.ax.lines for val in l.get_xydata()
val for line in self.ax.lines for val in line.get_xydata()
] # .plot()
xy_coords += [
val for c in self.ax.collections for val in c.get_offsets()
Expand Down Expand Up @@ -983,8 +986,8 @@ def assert_xlabel_ydata(
This is only testing the numbers in x-axis labels.
"""
x_data = [
"".join(c for c in l.get_text())
for l in self.ax.xaxis.get_majorticklabels()
"".join(c for c in label.get_text())
for label in self.ax.xaxis.get_majorticklabels()
]
y_data = self.get_xy()["y"]
xy_data = pd.DataFrame(data={"x": x_data, "y": y_data})
Expand Down Expand Up @@ -1068,62 +1071,89 @@ def assert_line(
self,
slope_exp,
intercept_exp,
xtime=False,
check_coverage=True,
message_no_line="Expected line not displayed",
message_data="Line does not cover data set",
):
"""Asserts that there exists a line on Axes `ax` with slope `slope_exp`
and y-intercept `intercept_exp` and goes at least from x coordinate
`min_val` to x coordinate `max_val`
and y-intercept `intercept_exp` and
Parameters
----------
slope_exp : float
Expected slope of line
intercept_exp : float
Expeted y intercept of line
xtime : boolean
Set ``True`` if x-axis values are datetime
check_coverage : boolean (default = True)
If `check_coverage` is `True`, function will check that the goes at
least from x coordinate `min_val` to x coordinate `max_val`. If the
line does not cover the entire dataset, and `AssertionError` with
be thrown with message `message_data`.
message_no_line : string
The error message to be displayed if the line does not exist.
message_data : string
The error message to be displayed if the line exists but does not
cover the dataset.
cover the dataset, and if `check_coverage` is `True`.
Raises
-------
AssertionError
with message `m` or `m2` if no line exists that covers the dataset
with message `message_no_line` or `message_data` if no line exists
that covers the dataset.
"""
flag_exist, flag_length = False, False
xy = self.get_xy(points_only=True)
min_val, max_val = min(xy["x"]), max(xy["x"])
flag_exist = False

if check_coverage:
flag_length = False
xy = self.get_xy(points_only=True)
min_val, max_val = min(xy["x"]), max(xy["x"])

for line in self.ax.lines:
# Here we will get the verticies for the line and reformat them in

# the way that get_slope_yintercept() expects
data = line.get_data()
path_verts = np.column_stack((data[0], data[1]))

for l in self.ax.lines:
path_verts = self.ax.transData.inverted().transform(
l._transformed_path.get_fully_transformed_path().vertices
)
slope, y_intercept = self.get_slope_yintercept(path_verts)
if math.isclose(slope, slope_exp, abs_tol=1e-4) and math.isclose(
y_intercept, intercept_exp, abs_tol=1e-4
):
flag_exist = True
line_x_vals = [coord[0] for coord in path_verts]
if min(line_x_vals) <= min_val and max(line_x_vals) >= max_val:
flag_length = True
break

# This check ensures that the minimum and maximum values of the
# line are within or very close to the minimum and maximum
# values in the pandas dataframe provided. This accounts for
# small errors sometimes found in matplotlib plots.
if check_coverage:
if (
math.isclose(min(line_x_vals), min_val, abs_tol=1e-4)
or min(line_x_vals) <= min_val
) and (
math.isclose(max(line_x_vals), max_val, abs_tol=1e-4)
or max(line_x_vals) >= max_val
):
flag_length = True
break

assert flag_exist, message_no_line
assert flag_length, message_data
if check_coverage:
assert flag_length, message_data

def assert_lines_of_type(self, line_types):
def assert_lines_of_type(self, line_types, check_coverage=True):
"""Asserts each line of type in `line_types` exist on `ax`
Parameters
----------
line_types : list of strings
line_types : string or list of strings
Acceptable strings in line_types are as follows
``['regression', 'onetoone']``.
``['linear-regression', 'onetoone']``.
check_coverage : boolean (default = True)
If `check_coverage` is `True`, function will check that the goes at
least from x coordinate `min_val` to x coordinate `max_val`. If the
line does not cover the entire dataset, and `AssertionError` with
be thrown with message `message_data`.
Raises
-------
Expand All @@ -1134,31 +1164,40 @@ def assert_lines_of_type(self, line_types):
-----
If `line_types` is empty, assertion is passed.
"""
if line_types:
for line_type in line_types:
if line_type == "regression":
xy = self.get_xy(points_only=True)
slope_exp, intercept_exp, _, _, _ = stats.linregress(
xy.x, xy.y
if isinstance(line_types, str):
line_types = [line_types]

for line_type in line_types:
if line_type == "linear-regression":
xy = self.get_xy(points_only=True)
# Check that there is xy data for this line. Some one-to-one
# lines do not produce xy data.
if xy.empty:
raise AssertionError(
"linear-regression line not displayed properly"
)
elif line_type == "onetoone":
slope_exp, intercept_exp = 1, 0
else:
raise ValueError(
"each string in line_types must be from the following "
+ '["regression","onetoone"]'
)

self.assert_line(
slope_exp,
intercept_exp,
message_no_line="{0} line not displayed properly".format(
line_type
),
message_data="{0} line does not cover dataset".format(
line_type
),
slope_exp, intercept_exp, _, _, _ = stats.linregress(
xy.x, xy.y
)
elif line_type == "onetoone":
slope_exp, intercept_exp = 1, 0
else:
raise ValueError(
"each string in line_types must be from the following "
+ '["linear-regression","onetoone"]'
)

self.assert_line(
slope_exp,
intercept_exp,
message_no_line="{0} line not displayed properly".format(
line_type
),
message_data="{0} line does not cover dataset".format(
line_type
),
check_coverage=check_coverage,
)

# HISTOGRAM FUNCTIONS

Expand Down
Loading

0 comments on commit 57646ec

Please sign in to comment.