Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biseau
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
BOURNEUF Lucas
biseau
Commits
c1267eb4
Commit
c1267eb4
authored
Feb 22, 2019
by
Lucas Bourneuf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve doc
parent
9a02df7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
examples/api_basics.py
examples/api_basics.py
+2
-2
examples/scripts/__init__.py
examples/scripts/__init__.py
+0
-0
examples/scripts/compute_score.py
examples/scripts/compute_score.py
+6
-0
No files found.
examples/api_basics.py
View file @
c1267eb4
...
...
@@ -10,7 +10,7 @@ bs.single_image_from_filenames(
)
# We c
an also load all scripts in a given dir
# We c
ould also load all scripts in a given dir (without garantee over script order)
scripts
=
list
(
bs
.
build_scripts_from_dir
(
'scripts/'
))
# Or from a single filename
...
...
@@ -22,7 +22,7 @@ final_context = bs.run(scripts[:3])
print
(
final_context
)
bs
.
compile_to_single_image
(
final_context
,
outfile
=
'example.png'
)
# note that scripts are complex objects, that have options
:
# note that scripts are complex objects, that have options:
a_script
=
next
(
bs
.
build_scripts_from_file
(
'scripts/compute_score.py'
))
print
(
f
"Script
{
a_script
.
name
}
have options:"
,
a_script
.
options
)
print
(
" Current values are:"
,
a_script
.
options_values
)
...
...
examples/scripts/__init__.py
deleted
100644 → 0
View file @
9a02df7d
examples/scripts/compute_score.py
View file @
c1267eb4
"""Description of that compute score"""
from
itertools
import
combinations
...
...
@@ -5,6 +6,11 @@ NAME = "Ranker"
OUTPUTS
=
"score/3"
def
run_on
(
models
,
*
,
multiplier
:
float
=
2
):
"""This doc allows to populate documentation of options
multiplier -- factor to apply on scores
"""
for
model
in
models
:
for
(
geneA
,
valA
),
(
geneB
,
valB
)
in
combinations
(
model
.
get
(
'gene'
,
()),
r
=
2
):
score
=
abs
(
float
(
valA
)
-
float
(
valB
))
*
float
(
multiplier
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment