{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Software Development" ], "description": "[![DOI](https://zenodo.org/badge/138660604.svg)](https://zenodo.org/badge/latestdoi/138660604)\n\n# MatPlotCheck\n\n[![Build Status](https://travis-ci.com/earthlab/matplotcheck.svg?branch=master)](https://travis-ci.com/earthlab/matplotcheck)\n[![codecov](https://codecov.io/gh/earthlab/matPlotCheck/branch/master/graph/badge.svg)](https://codecov.io/gh/earthlab/matPlotCheck)\n[![Documentation Status](https://readthedocs.org/projects/matplotcheck/badge/?version=latest)](https://matplotcheck.readthedocs.io/en/latest/?badge=latest)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://img.shields.io/badge/code%20style-black-000000.svg)\n\nA package for testing different types of matplotlib plots including:\n\n* basic matplotlib plots\n* geopandas spatial vector plots\n* raster plots\n* time series plots\n* folium plots\n\nand more!\n\n\n## Install\n\nTo install, use pip. `--upgrade` is optional but it ensures that the package overwrites\nwhen you install and you have the current version. If you don't have the package\nyet you can still use the `--upgrade` argument.\n\n`pip install --upgrade matplotcheck`\n\nThen import it into python.\n\n`import matplotcheck as mpc`\n\n## Background\n\nThis library was developed to simplify the autograding process of Matplotlib plots.\nVisually similar plots can be created in a variety of ways and hold different metadata.\nOur goal is to abstract away these differences by creating a simple way to test student plots.\n\nBeyond that, we have noticed common groupings of assertions for specific plot types.\n`PlotBasicSuite`objects have been created to avoid repetition in writing out assertions,\nand return a TestSuite instead. To run the suite after it has been created, use a unittest text runner.\n\n## Examples\n\n2D plot with x-axis label containing \"x\" and y-axis label containing \"y\" and \"data\"\n\n```python\nfrom matplotcheck.cases import PlotBasicSuite\nimport pandas as pd\nimport unittest\n\naxis = plt.gca()\ndata = pd.DataFrame(data={\u201cx\u201d:xvals, \u201cy\u201d:yvals})\nsuite = PlotBasicSuite(ax=axis, data_exp=data, xcol=\u201dx\u201d, ycol=\u201dy\u201d)\nxlabel_contains=[\u201cx\u201d], ylabel_contains = [\u201cy\u201d,\u201ddata\u201d])\nresults = unittest.TextTestRunner().run(suite)\n```\n\n### Example Plot with Spatial Raster Data\n\nPlot containing a spatial raster image and spatial polygon vector data\n\n```python\nfrom matplotcheck.cases import PlotRasterSuite\naxis = plt.gca()\nsuite = PlotRasterSuite(ax=axis, im_expected=image, polygons=polygons)\nresults = unittest.TextTestRunner().run(suite)\n```\n\nIf you prefer to forgo the groupings into TestSuites, you can just use the assertions instead.\n\n2D plot with x-axis label containing \"x\" and y-axis label containing \"y\" and \"data\"\n\n```python\nfrom matplotcheck.base import PlotTester\nimport pandas as pd\naxis = plt.gca()\npt = PlotTester(axis)\ndata = pd.DataFrame(data={\u201cx\u201d:xvals, \u201cy\u201d:yvals})\npt.assert_xydata(data, \u201cx\u201d, \u201cy\u201d)\npt.assert_xlabel_contains([\u201cx\u201d])\npt.assert_ylabel_contains([\u201cy\u201d, \u201cdata\u201d])\n```\n\nPlot containing a spatial raster image and spatial polygon vector data\n\n```python\nfrom matplotcheck.raster import RasterTester\nfrom matplotcheck.vector import VectorTester\naxis = plt.gca()\nrt = RasterTester(axis)\nvt = VectorTester(axis)\nrt.assert_image(im_expected=image)\nvt.assert_polygons(polygons_expected=polygons)\n```\n\nCaveats: This repo likely misses edge cases of the many ways matplotlib plots can be created.\nPlease feel free to submit bugs!\n\n\n## Active Contributors\n\n- Leah Wasser\n\n## Dev Setup (to be moved to contributing)\n\nsetup the matplotcheck envt\n\n```\nconda env create -f environment.yml\nconda activate matplotcheck-dev\n```\n\nThen setup all of the development requirements.\n\n```\npip install -e .\npip install -r dev-requirements.txt\npre-commit install\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/earthlab/matplotcheck", "keywords": "", "license": "", "maintainer": "Leah Wasser", "maintainer_email": "leah.wasser@colorado.edu", "name": "matplotcheck", "package_url": "https://pypi.org/project/matplotcheck/", "platform": "", "project_url": "https://pypi.org/project/matplotcheck/", "project_urls": { "Homepage": "https://github.com/earthlab/matplotcheck" }, "release_url": "https://pypi.org/project/matplotcheck/0.0.11/", "requires_dist": null, "requires_python": "", "summary": "Functions to check Matplotlib plot outputs", "version": "0.0.11" }, "last_serial": 5893300, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f4f9a7f6490fd458b2518cdcd727c45c", "sha256": "63c2e113318724d04dbb3fd46596461a38cb1049c0504bb12f77c77ec49cc62b" }, "downloads": -1, "filename": "matplotcheck-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f4f9a7f6490fd458b2518cdcd727c45c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21671, "upload_time": "2018-12-27T20:56:25", "url": "https://files.pythonhosted.org/packages/0c/fe/f05979ceb304153de1dfe9ffa7e627277e46a1d5b9508af59915f9224286/matplotcheck-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "0997f6a550cf5a52360017476c420b3a", "sha256": "e4c7847f83864e7b1a85ea421b48f2185a9d29df0248e65f7aef1826662f9285" }, "downloads": -1, "filename": "matplotcheck-0.0.10.tar.gz", "has_sig": false, "md5_digest": "0997f6a550cf5a52360017476c420b3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24646, "upload_time": "2019-08-01T15:13:57", "url": "https://files.pythonhosted.org/packages/43/5d/b4d274b3c1d2e155385daa4947b15971a797a8c811ce7c251e1f2448b38c/matplotcheck-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "8cbac83ef2b432b19ff4d946b69bba5d", "sha256": "c7a476bf79d037b83ce157bc4994f3861287702ba1a4d9cb6dab0c949c2b8898" }, "downloads": -1, "filename": "matplotcheck-0.0.11.tar.gz", "has_sig": false, "md5_digest": "8cbac83ef2b432b19ff4d946b69bba5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25908, "upload_time": "2019-09-25T18:47:31", "url": "https://files.pythonhosted.org/packages/76/c7/c4fe1473a37cbb6aa9485e347f38f0e3e999cc52516cbbbedc82bac5b788/matplotcheck-0.0.11.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "b68d319efcbaef8aa5949d8a0b1ba289", "sha256": "3bb13abc543f99280f0fd7bc56212850707890467a6f7830f898ee54ffd0e901" }, "downloads": -1, "filename": "matplotcheck-0.0.7.tar.gz", "has_sig": false, "md5_digest": "b68d319efcbaef8aa5949d8a0b1ba289", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22837, "upload_time": "2019-04-03T00:57:46", "url": "https://files.pythonhosted.org/packages/47/41/0033b42ba2993ef0299956d5c589d6712568027113267c482b7d34247d75/matplotcheck-0.0.7.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "8c0efc60b7603acff2e82dcd169c905e", "sha256": "5c4d3d620e67b658ae522ae9779070fe28fb5819c40d3cd35afb19f26554eb17" }, "downloads": -1, "filename": "matplotcheck-0.0.9.tar.gz", "has_sig": false, "md5_digest": "8c0efc60b7603acff2e82dcd169c905e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22839, "upload_time": "2019-04-03T14:25:41", "url": "https://files.pythonhosted.org/packages/61/9a/03096fc8a1beddf6a26993b554a1fcf8c6d3537ec021de468c2a93471c4f/matplotcheck-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8cbac83ef2b432b19ff4d946b69bba5d", "sha256": "c7a476bf79d037b83ce157bc4994f3861287702ba1a4d9cb6dab0c949c2b8898" }, "downloads": -1, "filename": "matplotcheck-0.0.11.tar.gz", "has_sig": false, "md5_digest": "8cbac83ef2b432b19ff4d946b69bba5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25908, "upload_time": "2019-09-25T18:47:31", "url": "https://files.pythonhosted.org/packages/76/c7/c4fe1473a37cbb6aa9485e347f38f0e3e999cc52516cbbbedc82bac5b788/matplotcheck-0.0.11.tar.gz" } ] }