diff --git a/.coveragerc b/.coveragerc index 2ac706c0b3..32bf3b31db 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,4 +4,3 @@ omit = act/*version*py versioneer.py setup.py - act/plotting/histogramdisplay.py diff --git a/act/plotting/__init__.py b/act/plotting/__init__.py index 4830bd667a..68547a9a3c 100644 --- a/act/plotting/__init__.py +++ b/act/plotting/__init__.py @@ -7,7 +7,6 @@ | :func:`act.plotting.ContourDisplay` handles the plotting of contour plots. | :func:`act.plotting.DistributionDisplay` handles the plotting of distribution-related plots. | :func:`act.plotting.GeographicPlotDisplay` handles the plotting of lat-lon plots. -| :func:`act.plotting.HistogramDisplay` handles the plotting of histogram plots. | :func:`act.plotting.SkewTDisplay` handles the plotting of Skew-T diagrams. | :func:`act.plotting.TimeSeriesDisplay` handles the plotting of timeseries. | :func:`act.plotting.WindRoseDisplay` handles the plotting of wind rose plots. @@ -31,7 +30,6 @@ 'common', 'contourdisplay', 'geodisplay', - 'histogramdisplay', 'plot', 'skewtdisplay', 'timeseriesdisplay', @@ -42,7 +40,6 @@ submod_attrs={ 'contourdisplay': ['ContourDisplay'], 'geodisplay': ['GeographicPlotDisplay'], - 'histogramdisplay': ['HistogramDisplay'], 'plot': ['Display', 'GroupByDisplay'], 'skewtdisplay': ['SkewTDisplay'], 'timeseriesdisplay': ['TimeSeriesDisplay'], diff --git a/act/plotting/distributiondisplay.py b/act/plotting/distributiondisplay.py index 59a8f0b7c1..73d695de8e 100644 --- a/act/plotting/distributiondisplay.py +++ b/act/plotting/distributiondisplay.py @@ -89,7 +89,7 @@ def _get_data(self, dsname, fields): fields = [fields] return self._ds[dsname][fields].dropna('time') - def plot_stacked_bar_graph( + def plot_stacked_bar( self, field, dsname=None, @@ -334,7 +334,7 @@ def plot_size_distribution( return self.axes[subplot_index] - def plot_stairstep_graph( + def plot_stairstep( self, field, dsname=None, diff --git a/act/tests/test_plotting.py b/act/tests/test_plotting.py index e8698c915a..76c65ce7a8 100644 --- a/act/tests/test_plotting.py +++ b/act/tests/test_plotting.py @@ -155,7 +155,7 @@ def test_histogram_errors(): with np.testing.assert_raises(RuntimeError): histdisplay.set_xrng([-40, 40]) histdisplay.fig = None - histdisplay.plot_stacked_bar_graph('temp_mean', bins=np.arange(-40, 40, 5)) + histdisplay.plot_stacked_bar('temp_mean', bins=np.arange(-40, 40, 5)) histdisplay.set_yrng([0, 0]) assert histdisplay.yrng[0][1] == 1.0 assert histdisplay.fig is not None @@ -166,7 +166,7 @@ def test_histogram_errors(): histdisplay.axes = None histdisplay.fig = None - histdisplay.plot_stairstep_graph('temp_mean', bins=np.arange(-40, 40, 5)) + histdisplay.plot_stairstep('temp_mean', bins=np.arange(-40, 40, 5)) assert histdisplay.fig is not None assert histdisplay.axes is not None @@ -487,7 +487,7 @@ def test_stair_graph(): sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1) histdisplay = DistributionDisplay({'sgpsondewnpnC1.b1': sonde_ds}) - histdisplay.plot_stairstep_graph('tdry', bins=np.arange(-60, 10, 1)) + histdisplay.plot_stairstep('tdry', bins=np.arange(-60, 10, 1)) sonde_ds.close() try: @@ -501,7 +501,7 @@ def test_stair_graph_sorted(): sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1) histdisplay = DistributionDisplay({'sgpsondewnpnC1.b1': sonde_ds}) - histdisplay.plot_stairstep_graph( + histdisplay.plot_stairstep( 'tdry', bins=np.arange(-60, 10, 1), sortby_field='alt', @@ -520,7 +520,7 @@ def test_stacked_bar_graph(): sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1) histdisplay = DistributionDisplay({'sgpsondewnpnC1.b1': sonde_ds}) - histdisplay.plot_stacked_bar_graph('tdry', bins=np.arange(-60, 10, 1)) + histdisplay.plot_stacked_bar('tdry', bins=np.arange(-60, 10, 1)) sonde_ds.close() try: @@ -534,7 +534,7 @@ def test_stacked_bar_graph2(): sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1) histdisplay = DistributionDisplay({'sgpsondewnpnC1.b1': sonde_ds}) - histdisplay.plot_stacked_bar_graph('tdry') + histdisplay.plot_stacked_bar('tdry') histdisplay.set_yrng([0, 400]) histdisplay.set_xrng([-70, 0]) sonde_ds.close() @@ -550,7 +550,7 @@ def test_stacked_bar_graph_sorted(): sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1) histdisplay = DistributionDisplay({'sgpsondewnpnC1.b1': sonde_ds}) - histdisplay.plot_stacked_bar_graph( + histdisplay.plot_stacked_bar( 'tdry', bins=np.arange(-60, 10, 1), sortby_field='alt', @@ -1264,7 +1264,7 @@ def test_histogram_kwargs(): ds = act.io.arm.read_arm_netcdf(files) hist_kwargs = {'range': (-10, 10)} histdisplay = DistributionDisplay(ds) - hist_dict = histdisplay.plot_stacked_bar_graph( + hist_dict = histdisplay.plot_stacked_bar( 'temp_mean', bins=np.arange(-40, 40, 5), sortby_bins=np.arange(-40, 40, 5), @@ -1272,11 +1272,11 @@ def test_histogram_kwargs(): ) hist_array = np.array([0, 0, 0, 0, 0, 0, 493, 883, 64, 0, 0, 0, 0, 0, 0]) assert_allclose(hist_dict['histogram'], hist_array) - hist_dict = histdisplay.plot_stacked_bar_graph('temp_mean', hist_kwargs=hist_kwargs) + hist_dict = histdisplay.plot_stacked_bar('temp_mean', hist_kwargs=hist_kwargs) hist_array = np.array([0, 0, 950, 177, 249, 64, 0, 0, 0, 0]) assert_allclose(hist_dict['histogram'], hist_array) - hist_dict_stair = histdisplay.plot_stairstep_graph( + hist_dict_stair = histdisplay.plot_stairstep( 'temp_mean', bins=np.arange(-40, 40, 5), sortby_bins=np.arange(-40, 40, 5), @@ -1284,7 +1284,7 @@ def test_histogram_kwargs(): ) hist_array = np.array([0, 0, 0, 0, 0, 0, 493, 883, 64, 0, 0, 0, 0, 0, 0]) assert_allclose(hist_dict_stair['histogram'], hist_array) - hist_dict_stair = histdisplay.plot_stairstep_graph('temp_mean', hist_kwargs=hist_kwargs) + hist_dict_stair = histdisplay.plot_stairstep('temp_mean', hist_kwargs=hist_kwargs) hist_array = np.array([0, 0, 950, 177, 249, 64, 0, 0, 0, 0]) assert_allclose(hist_dict_stair['histogram'], hist_array) diff --git a/codecov.yml b/codecov.yml index 37d633bc41..bcb8280c4e 100644 --- a/codecov.yml +++ b/codecov.yml @@ -6,7 +6,6 @@ comment: false ignore: - 'act/tests/*.py' - - 'act/plotting/histogramdisplay.py' - 'act/*version*py' - 'setup.py' - 'versioneer.py' diff --git a/examples/plotting/plot_hist_kwargs.py b/examples/plotting/plot_hist_kwargs.py index 94636e8824..1a2f3c9819 100644 --- a/examples/plotting/plot_hist_kwargs.py +++ b/examples/plotting/plot_hist_kwargs.py @@ -19,6 +19,6 @@ # Plot data hist_kwargs = {'range': (-10, 10)} histdisplay = act.plotting.DistributionDisplay(met_ds) -histdisplay.plot_stacked_bar_graph('temp_mean', bins=np.arange(-40, 40, 5), - hist_kwargs=hist_kwargs) +histdisplay.plot_stacked_bar('temp_mean', bins=np.arange(-40, 40, 5), + hist_kwargs=hist_kwargs) plt.show() diff --git a/guides/act_cheatsheet.tex b/guides/act_cheatsheet.tex index 0e8dd77328..819bc7a6bd 100644 --- a/guides/act_cheatsheet.tex +++ b/guides/act_cheatsheet.tex @@ -559,11 +559,11 @@ \begin{tabular}{@{}ll@{}} \\ -\multicolumn{2}{l}{\cellcolor[HTML]{DDFFFF}\bf HistogramDisplay} \\ +\multicolumn{2}{l}{\cellcolor[HTML]{DDFFFF}\bf DistributionDisplay} \\ \\ Class used to make histogram plots.\\ \\ -$>$$>$$>$ display = act.plotting.HistogramDisplay(\\ +$>$$>$$>$ display = act.plotting.DistributionDisplay(\\ \-\hspace{1.2cm} obj, subplot\_shape=(1, ), ds\_name=None,\\ \-\hspace{1.2cm} **kwargs)\\ \\ @@ -710,4 +710,4 @@ } \end{poster} -\end{document} \ No newline at end of file +\end{document} diff --git a/scripts/ads.py b/scripts/ads.py index acf1b83919..5a61ff51fb 100644 --- a/scripts/ads.py +++ b/scripts/ads.py @@ -432,7 +432,7 @@ def histogram(args): except KeyError: pass - display = act.plotting.HistogramDisplay( + display = act.plotting.DistributionDisplay( {dsname: ds}, figsize=args.figsize, subplot_shape=subplot_shape)