Commit 69db6c71 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'bins' into 'master'

Bins histograms

Closes #45

See merge request !74
parents c169a52a 41954117
Pipeline #21244 passed with stages
in 9 minutes and 12 seconds
......@@ -272,9 +272,10 @@ def n_bins_option(**kwargs):
return value
return click.option(
'-b', '--nbins', type=click.STRING, default='doane',
help='The number of bins for the different histograms in the '
'figure, seperated by commas. For example, if three histograms '
'are in the plots, input something like `100,doane,50`. All the '
help='The number of bins for the different quantities to plot, '
'seperated by commas. For example, if you plot histograms '
'of negative and positive scores '
', input something like `100,doane`. All the '
'possible bin options can be found in https://docs.scipy.org/doc/'
'numpy/reference/generated/numpy.histogram.html. Be aware that '
'for some corner cases, the option `auto` and `fd` can lead to '
......
......@@ -565,7 +565,7 @@ class Hist(PlotBase):
self._nbins = ctx.meta.get('n_bins', ['doane'])
self._nhist_per_system = nhist_per_system
self._nbins = check_list_value(
self._nbins, self.n_systems * nhist_per_system, 'n_bins',
self._nbins, nhist_per_system, 'n_bins',
'histograms')
self._thres = ctx.meta.get('thres')
self._thres = check_list_value(
......
......@@ -136,14 +136,14 @@ def test_hist():
result = runner.invoke(commands.hist, ['--criterion',
'min-hter', '--no-line',
'--output', 'HISTO.pdf', '-b',
'30,100,30,100', dev1, dev2])
'30,100', dev1, dev2])
if result.output:
click.echo(result.output)
assert result.exit_code == 0, (result.exit_code, result.output)
with runner.isolated_filesystem():
result = runner.invoke(commands.hist, ['-e', '--criterion', 'eer','--output',
'HISTO.pdf', '-b', '30,20,30,20',
'HISTO.pdf', '-b', '30,20',
'-sp', 221, '-lg', 'A,B',
dev1, test1, dev2, test2])
if result.output:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment