Skip to content

Commit 4e882a4

Browse files
authored
Fix set of ticks in python plotters test (#307)
1 parent b86102e commit 4e882a4

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

CLUEstering/CLUEstering.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,6 @@ def input_plotter(self, filepath: Union[str, None] = None, plot_title: str = '',
898898
# Customization of axis ticks
899899
if x_ticks is not None:
900900
plt.xticks(x_ticks)
901-
if y_ticks is not None:
902-
plt.yticks(y_ticks)
903901

904902
if filepath is not None:
905903
plt.savefig(filepath)

tests/test_kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def dataset():
8383
return pd.read_csv("../data/sissa_1000.csv")
8484

8585

86-
def test_gaussian_kernel(dataset):
86+
def test_flat_kernel(dataset):
8787
c = clue.clusterer(21., 10., 21.)
8888
c.choose_kernel('flat', [0.5])
8989
c.fit(dataset)

tests/test_plotters.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,31 @@ def test_input_plotter(dataset1d, dataset2d, dataset3d):
5555

5656
c = clue.clusterer(3., 2., 3.)
5757

58-
x_ticks = [0, 10, 20, 30, 40, 50, 60]
59-
y_ticks = [0, 10, 20, 30, 40, 50, 60]
60-
z_ticks = [0, 10, 20, 30, 40, 50, 60]
58+
xticks = [0, 10, 20, 30, 40, 50, 60]
59+
yticks = [0, 10, 20, 30, 40, 50, 60]
60+
zticks = [0, 10, 20, 30, 40, 50, 60]
6161

6262
filename = 'dataset1d.png'
6363
c.read_data(dataset1d)
6464
assert c.n_dim == 1
6565
c.input_plotter()
66-
c.input_plotter(grid=True, xticks=x_ticks)
66+
c.input_plotter(grid=True, x_ticks=xticks)
6767
c.input_plotter(filename)
6868
assert os.path.isfile(filename)
6969

7070
filename = 'dataset2d.png'
7171
c.read_data(dataset2d)
7272
assert c.n_dim == 2
7373
c.input_plotter()
74-
c.input_plotter(grid=True, xticks=x_ticks, yticks=y_ticks)
74+
c.input_plotter(grid=True, x_ticks=xticks, y_ticks=yticks)
7575
c.input_plotter(filename)
7676
assert os.path.isfile(filename)
7777

7878
filename = 'dataset3d.png'
7979
c.read_data(dataset3d)
8080
assert c.n_dim == 3
8181
c.input_plotter()
82-
c.input_plotter(grid=True, xticks=x_ticks, yticks=y_ticks, zticks=z_ticks)
82+
c.input_plotter(grid=True, x_ticks=xticks, y_ticks=yticks, z_ticks=zticks)
8383
c.input_plotter(filename)
8484
assert os.path.isfile(filename)
8585

@@ -90,16 +90,16 @@ def test_output_plotter(dataset1d, dataset2d, dataset3d):
9090

9191
c = clue.clusterer(3., 2., 3.)
9292

93-
x_ticks = [0, 10, 20, 30, 40, 50, 60]
94-
y_ticks = [0, 10, 20, 30, 40, 50, 60]
95-
z_ticks = [0, 10, 20, 30, 40, 50, 60]
93+
xticks = [0, 10, 20, 30, 40, 50, 60]
94+
yticks = [0, 10, 20, 30, 40, 50, 60]
95+
zticks = [0, 10, 20, 30, 40, 50, 60]
9696

9797
filename = 'output1d.png'
9898
c.read_data(dataset1d)
9999
assert c.n_dim == 1
100100
c.run_clue()
101101
c.cluster_plotter()
102-
c.cluster_plotter(grid=True, xticks=x_ticks)
102+
c.cluster_plotter(grid=True, x_ticks=xticks)
103103
c.cluster_plotter(filename)
104104
assert os.path.isfile(filename)
105105

@@ -108,7 +108,7 @@ def test_output_plotter(dataset1d, dataset2d, dataset3d):
108108
assert c.n_dim == 2
109109
c.run_clue()
110110
c.cluster_plotter()
111-
c.cluster_plotter(grid=True, xticks=x_ticks, yticks=y_ticks)
111+
c.cluster_plotter(grid=True, x_ticks=xticks, y_ticks=yticks)
112112
c.cluster_plotter(filename)
113113
assert os.path.isfile(filename)
114114

@@ -117,6 +117,6 @@ def test_output_plotter(dataset1d, dataset2d, dataset3d):
117117
assert c.n_dim == 3
118118
c.run_clue()
119119
c.cluster_plotter()
120-
c.cluster_plotter(grid=True, xticks=x_ticks, yticks=y_ticks, zticks=z_ticks)
120+
c.cluster_plotter(grid=True, x_ticks=xticks, y_ticks=yticks, z_ticks=zticks)
121121
c.cluster_plotter(filename)
122122
assert os.path.isfile(filename)

0 commit comments

Comments
 (0)