Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Merge requests
!57
Extend bins number option
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Extend bins number option
histobins
into
master
Overview
0
Commits
1
Pipelines
1
Changes
3
Merged
Extend bins number option
Theophile GENTILHOMME
requested to merge
histobins
into
master
Apr 25, 2018
Overview
0
Commits
1
Pipelines
1
Changes
3
0
0
Merge request reports
Compare
master
version 1
afab8ae0
Apr 25, 2018
master (base)
and
latest version
latest version
afab8ae0
1 commit,
Apr 25, 2018
version 1
afab8ae0
2 commits,
Apr 25, 2018
3 files
+
23
−
15
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
bob/measure/script/common_options.py
+
10
−
7
View file @ afab8ae0
Edit in single-file editor
Open in Web IDE
Show full file
@@ -174,16 +174,19 @@ def n_bins_option(**kwargs):
def
callback
(
ctx
,
param
,
value
):
if
value
is
None
:
value
=
'
auto
'
elif
value
<
2
:
raise
click
.
BadParameter
(
'
Number of bins must be greater than 1
'
,
ctx
=
ctx
)
else
:
tmp
=
value
.
split
(
'
,
'
)
try
:
value
=
[
int
(
i
)
if
i
!=
'
auto
'
else
i
for
i
in
tmp
]
except
Exception
:
raise
click
.
BadParameter
(
'
Incorrect number of bins inputs
'
)
ctx
.
meta
[
'
n_bins
'
]
=
value
return
value
return
click
.
option
(
'
-b
'
,
'
--nbins
'
,
type
=
INT
,
default
=
None
,
help
=
'
The number of bins in the histogram(s). Default: `auto`
'
,
'
-b
'
,
'
--nbins
'
,
type
=
click
.
STRING
,
default
=
'
auto
'
,
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,auto,50`
'
,
callback
=
callback
,
**
kwargs
)(
func
)
return
custom_n_bins_option
Loading