diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 70a99125..78cad6f0 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -73,7 +73,7 @@ Improving the documentation and testing for code already in MatPlotCheck is a great way to get started if you'd like to make a contribution. Please note that our documentation files are in `ReStructuredText (.rst) -`_ +`_ format and format your pull request accordingly. diff --git a/docs/matplotcheck.rst b/docs/matplotcheck.rst index 7ee7e8d0..38baba7c 100644 --- a/docs/matplotcheck.rst +++ b/docs/matplotcheck.rst @@ -68,7 +68,6 @@ matplotcheck.vector module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/matplotcheck/base.py b/matplotcheck/base.py index 37e91e98..ea59806f 100644 --- a/matplotcheck/base.py +++ b/matplotcheck/base.py @@ -1024,7 +1024,8 @@ def assert_xlabel_ydata( if x_is_numeric: try: np.testing.assert_array_max_ulp( - np.array(xy_data["x"]), np.array(xy_expected[xcol]), + np.array(xy_data["x"]), + np.array(xy_expected[xcol]), ) except AssertionError: raise AssertionError(message) @@ -1211,7 +1212,7 @@ def get_num_bins(self): histogram, this is just the number of bins. If there are two overlapping or stacked histograms in the same `matplotlib.axis.Axis` object, then this returns the number of bins - with unique edges. """ + with unique edges.""" x_data = self.get_xy()["x"] unique_x_data = list(set(x_data)) num_bins = len(unique_x_data) diff --git a/matplotcheck/cases.py b/matplotcheck/cases.py index c2370987..5b334641 100644 --- a/matplotcheck/cases.py +++ b/matplotcheck/cases.py @@ -27,9 +27,7 @@ class PlotBasicSuite(object): ycol: string column title in data_exp that contains yaxis data plot_type: string from list ["scatter","bar"] of expected plot type line_types: list of strings. Acceptable strings in line_types are as - follows - ["regression", "onetoone"]. - if list is empty, assert is passed + follows ["regression", "onetoone"]. If list is empty, assert is passed xlabels: boolean if using x axis labels rather than x data lims_equal: boolean expressing if x and y limits are expected to be equal title_contains: list of lower case strings where each string is expected to @@ -140,7 +138,7 @@ def tearDown(self): self.pt = None class PlotCaption(unittest.TestCase): - """ Returns a unittest.TestCase containing 1 test for an + """Returns a unittest.TestCase containing 1 test for an appropriate caption: Test 1 - caption_words: caption contains one string from each of @@ -479,7 +477,7 @@ def tearDown(self): @property def cases(self): - """ Returns a list of TestCases for time series plots. + """Returns a list of TestCases for time series plots. Testcase are as follows: 1. LabelsCase: Asserts the title, x-axis label, and y-axis label are as expected @@ -633,7 +631,7 @@ def tearDown(self): @property def cases(self): - """ Returns a list of TestCases for spatial vector plots. + """Returns a list of TestCases for spatial vector plots. Testcase are as follows: 1. CaptionCase: assert caption is in appropriate location with strings expressed in caption_contains @@ -787,7 +785,7 @@ def tearDown(self): @property def cases(self): - """ Returns a list of TestCases for spatial raster plots. + """Returns a list of TestCases for spatial raster plots. Testcase are as follows: 1. CaptionCase: assert caption is in appropriate location with strings expressed in caption_strings @@ -843,7 +841,7 @@ def tearDown(self): @property def cases(self): - """ Returns a TestSuite for Folium Maps. + """Returns a TestSuite for Folium Maps. Testcase are as follows: 1. FoliumCase: asserts map is of type folium.map and contains expected markers diff --git a/matplotcheck/notebook.py b/matplotcheck/notebook.py index 2e62870d..885c13af 100644 --- a/matplotcheck/notebook.py +++ b/matplotcheck/notebook.py @@ -62,7 +62,7 @@ def error_test(n, n_exp): def remove_comments(input_string): - """ Helper function for import_test. + """Helper function for import_test. Removes all parts of string that would be commented out by # in python Parameters diff --git a/matplotcheck/tests/test_lines.py b/matplotcheck/tests/test_lines.py index cd53d1e7..436d7573 100644 --- a/matplotcheck/tests/test_lines.py +++ b/matplotcheck/tests/test_lines.py @@ -12,14 +12,15 @@ @pytest.fixture def multi_line_gdf(two_line_gdf): - """ Create a multi-line GeoDataFrame. + """Create a multi-line GeoDataFrame. This has one multi line and another regular line. """ # Create a single and multi line object multiline_feat = two_line_gdf.unary_union linec = LineString([(2, 1), (3, 1), (4, 1), (5, 2)]) out_df = gpd.GeoDataFrame( - geometry=gpd.GeoSeries([multiline_feat, linec]), crs="epsg:4326", + geometry=gpd.GeoSeries([multiline_feat, linec]), + crs="epsg:4326", ) out_df["attr"] = ["road", "stream"] return out_df diff --git a/matplotcheck/tests/test_polygons.py b/matplotcheck/tests/test_polygons.py index d626de3a..724ed796 100644 --- a/matplotcheck/tests/test_polygons.py +++ b/matplotcheck/tests/test_polygons.py @@ -20,7 +20,9 @@ def multi_polygon_gdf(basic_polygon): """ poly_a = Polygon([(3, 5), (2, 3.25), (5.25, 6), (2.25, 2), (2, 2)]) gdf = gpd.GeoDataFrame( - [1, 2], geometry=[poly_a, basic_polygon], crs="epsg:4326", + [1, 2], + geometry=[poly_a, basic_polygon], + crs="epsg:4326", ) multi_gdf = gpd.GeoDataFrame( geometry=gpd.GeoSeries(gdf.unary_union), crs="epsg:4326" diff --git a/matplotcheck/vector.py b/matplotcheck/vector.py index ca8b777b..256c9226 100644 --- a/matplotcheck/vector.py +++ b/matplotcheck/vector.py @@ -24,7 +24,7 @@ def __init__(self, ax): """ Check Data """ def _convert_length(self, arr, n): - """ helper function for 'get_points_by_attributes' and + """Helper function for 'get_points_by_attributes' and 'get_lines_by_attributes' takes an array of either length 1 or n. If array is length 1: array of array's only element repeating n times @@ -130,7 +130,7 @@ def assert_points_grouped_by_type( ) def sort_collection_by_markersize(self): - """ Returns a pandas dataframe of points in collections on Axes ax. + """Returns a pandas dataframe of points in collections on Axes ax. Returns --------