Commit 837e0862 authored by Mathieu Hemery's avatar Mathieu Hemery
Browse files

merge

parents 403788e0 c8437d65
......@@ -122,16 +122,16 @@ test_%: biocham_debug
echo "flag(slow_test, _, true), run_tests_and_halt('$*')." | ./biocham_debug
install_kernel: biocham $(KERNEL_DIR)/commands.js $(KERNEL_DIR)/commands.py $(WORKFLOWS_DIR)/workflows.js
- pip3 install --user $(JUPYTER_DIR)/kernel
- pip3 install --user $(JUPYTER_DIR)/kernel || pip install --user $(JUPYTER_DIR)/kernel
- jupyter kernelspec install --user --name=biocham $(KERNEL_DIR)
install_gui: $(WORKFLOWS_DIR)/workflows.js
- cd $(JUPYTER_DIR)/guinbextension && npm run build && npm run docs:build
- cd $(JUPYTER_DIR)/guinbextension && npm install && npm run build && npm run docs:build
- jupyter nbextension install --user $(JUPYTER_DIR)/guinbextension/gui-build/
- jupyter nbextension enable --user gui-build/nbextension
install_gui_dev: $(WORKFLOWS_DIR)/workflows.js
- cd $(JUPYTER_DIR)/guinbextension && npm run dev && npm run docs:build
- cd $(JUPYTER_DIR)/guinbextension && npm install && npm run dev && npm run docs:build
- jupyter nbextension install --user $(JUPYTER_DIR)/guinbextension/gui-build/
- jupyter nbextension enable --user gui-build/nbextension
......@@ -200,6 +200,8 @@ gadagne_restart: gadagne
release:
@read -p "Version number (e.g. 4.1.0): " version && \
sed -i'' -e "s/^version('.*')/version('$$version')/" about.pl && \
sed -i'' -e "s/\"version\": \"\(.*\)\"/\"version\": \"$$version\"/" biocham_jupyter/guinbextension/package.json && \
sed -i'' -e "s/__version__ = '\(.*\)'/__version__ = '$$version'/" biocham_jupyter/kernel/biocham_kernel/__init__.py && \
LC_ALL=C sed -i'' -e "s+^<h1>version.*</h1>+<h1>version $$version $(shell date '+%B %Y')</h1>+" web/index.html && \
git commit about.pl web/index.html -m "Version $$version" && \
git tag -a v$$version -m "Version $$version" && \
......
......@@ -8,7 +8,7 @@
about/0
]).
version('4.1.29').
version('4.2.6').
copyright(
'Copyright (C) 2003-2019 Inria, EPI Lifeware, Saclay-Île de France, France'
......
......@@ -25,7 +25,7 @@ The Biochemical Abstract Machine (Biocham) is a modelling software for cell syst
software.').
:- doc('
This reference manual (as its extended version for developpers) is automaticaly generated from the source code of Biocham.').
This reference manual (as its extended version for developers) is automatically generated from the source code of Biocham.').
:- doc('
Biocham v4 is mainly composed of :
......
{
"name": "gui",
"version": "4.1.29",
"version": "4.2.6",
"description": "biocham gui in jupyter notebook",
"main": "src/index.js",
"scripts": {
......
......@@ -144,7 +144,6 @@ commands = [
"make_absent_not_present",
"make_present_not_absent",
"merge_reactions",
"motif_reduction",
"multistability_graph",
"new_graph",
"new_model",
......@@ -154,6 +153,7 @@ commands = [
"option",
"pac_learning",
"parameter",
"pattern_reduction",
"place",
"plot",
"present",
......
"""Example magic"""
__version__ = '4.1.29'
__version__ = '4.2.6'
......@@ -16,7 +16,6 @@
]
).
doc(_) :- % this predicate must just succeed in prolog
!,
true.
......@@ -102,7 +101,6 @@ format_doc_html(document_opening(Title)) :-
<head>
<meta charset="UTF-8">
<title>~a</title>
</head>
<style>
h5 {font-family: "Courier New"; font-size: 1.1em; font-weight: normal; }
div.indented {margin-left: 1cm; }
......@@ -121,14 +119,21 @@ format_doc_html(document_opening(Title)) :-
blockquote.SS {color : orange; }
blockquote.TM {color : green; }
</style>
</head>
<body>
<header>
<h1><img src="logo.png" alt="logo.png">~a</h1>
<h2>Inria <a href=~a>~a</a></h2>
<h2>Inria <a href="~a">~a</a></h2>
</header>
', [Title, Url, Url]).
format_doc_html(table_of_contents) :-
!,
format(' <h2 id="Contents">Contents</h2>\n', []).
format(' <nav>~n <h2 id="Contents">Contents</h2>\n', []).
format_doc_html(end_table_of_contents) :-
!,
format(' </nav>~n <main>', []).
format_doc_html(toc_entry(Id, Title)) :-
!,
......@@ -180,7 +185,7 @@ format_doc_html(chapter(Id, Counter, Title)) :-
true
),
format(CommandsStream, ' {kind: "chapter", name: "~w"}', [Title]),
format('<h2 id="~a">Chapter ~d</br>~a</h2>', [Id, Counter, Title]).
format('<h2 id="~a">Chapter ~d<br>~a</h2>', [Id, Counter, Title]).
format_doc_html(section(HLevel, Id, Title)) :-
!,
......@@ -325,18 +330,20 @@ format_doc_html(html(Html)) :-
format_doc_html(document_closing) :-
!,
format('
</main>
</body>
</html>
', []).
format_doc_html(begin_grammar(Id, Grammar)) :-
format('<div><table id="~a"><td>~a ::= </td><td>\n', [Id, Grammar]).
format('<div><table id="~a"><tr><td>~a ::= </td><td>\n', [Id, Grammar]).
% FIXME operators are not escaped and it is a nightmare to fix
format_doc_html(grammar_item(Item)) :-
format('<div>| <code>~w</code></div>', [Item]).
format_doc_html(end_grammar) :-
format('</td></table></div>\n', []).
format('</td></tr></table></div>\n', []).
format_doc_html(begin_command(Id, Command)) :-
nb_getval(doc_commands_stream, CommandsStream),
......@@ -540,6 +547,9 @@ format_doc_tex(table_of_contents) :-
!,
format(' \\tableofcontents\n', []).
format_doc_tex(end_table_of_contents) :-
!.
format_doc_tex(toc_entry(_Id, _Title)) :-
!.
......@@ -897,12 +907,14 @@ setup_doc :-
generate_doc :-
setup_doc,
generate_doc_file(doc).
generate_doc_file(doc),
check_doc(doc, quiet).
generate_devdoc :-
setup_doc,
generate_doc_file(devdoc).
generate_doc_file(devdoc),
check_doc(devdoc, quiet).
generate_doc_file(Type) :-
......@@ -979,7 +991,8 @@ generate_toc(Type) :-
generate_toc_section(Level, Title)
)
),
goto_toc_level(0).
goto_toc_level(0),
format_doc(end_table_of_contents).
generate_toc_section(1, Title) :-
......@@ -2241,3 +2254,32 @@ clean_doc(Doc, Clean) :-
atomics_to_string(List1, "\\\"", QuotedString),
split_string(QuotedString, "\s\t\n", "\s\t\n", List),
atomics_to_string(List, ' ', Clean).
check_doc(Dir, Errors) :-
directory_file_path(Dir, 'index.html', Path),
load_html(Path, Dom, [syntax_errors(Errors)]),
% images
forall(
(
sub_term(element(img, Attrs, []), Dom),
memberchk(src=Link, Attrs)
),
(
directory_file_path(Dir, Link, File),
access_file(File, read)
)
),
% links
forall(
(
sub_term(element(a, Attrs, _), Dom),
memberchk(href=Link, Attrs),
\+ atom_concat('#', _, Link),
\+ atom_concat('http', _, Link)
),
(
directory_file_path(Dir, Link, File),
access_file(File, read)
)
).
......@@ -122,15 +122,19 @@ packages='python-sat jupyter bokeh ipywidgets'
if hash pip3 2>/dev/null
then
pip3 install -U $packages
elif (hash pip 2> /dev/null) && [[ "pip --version" = "*python 3*" ]]
then
pip install -U $packages
else
if hash conda 2>/dev/null
then
conda install -y $packages
conda install -y pip
pip install -U $packages
else
if [[ "$conda_arch" == "Linux" ]]
then
sudo apt-get -qy install python3-pip
pip3 install -U $packages
pip install -U $packages
else
# Note that miniconda is available through brew cask, but to avoid adding
# brew cask if not necessary, we just do without
......@@ -139,7 +143,8 @@ else
./Miniconda3-latest-${conda_arch}-x86_64.sh -b -p ${HOME}/miniconda3
echo 'export PATH=${HOME}/miniconda3/bin:${PATH}' >> ${HOME}/.profile
export PATH=${HOME}/miniconda3/bin:${PATH}
conda install -y $packages
conda install -y pip
pip install -U $packages
fi
fi
fi
......
......@@ -165,12 +165,12 @@ add_function(FunctionList) :-% {{{
import_reactions_from_ode_system(OdeSystem),
delete_item(OdeSystem).
% }}}
compile_program( InputFile ) :-% {{{
compile_program_file( InputFile ) :-% {{{
% compile_program( +InputFile )
biocham_command,
type( InputFile, input_file ),
option( 'simplify_variable_init', yesno, _,
'set if the variable initialization in program need to be simplified to \\emph{present} command' ),
devdoc( "Transform the terms in a file into internal list format of 'add_function'." ),
devdoc( "Only generate sequential program." ),
......@@ -184,11 +184,13 @@ compile_program( InputFile ) :-% {{{
compile_program( Program ) :-
biocham_command,
type( Program, atom ),
option( 'simplify_variable_init', yesno, _,
'set if the variable initialization in program need to be simplified to \\emph{present} command' ),
doc( "Using atom \\emph{Program} as the program code." ),
doc( "We can write the follwing program and compile it in reactions." ),
biocham_silent( clear_model ),
biocham( compile_program( 'z := 2. x := z + 1. y := x - z.' ) ),
biocham( numerical_simulation( time: 60, method: msbdf ) ),
biocham( numerical_simulation( time: 60 ) ),
biocham( plot( show:{ x_p, x_n, y_p, y_n, z_p, z_n } ) ),
doc( "This is equivalent to '\\texttt{add_function( z = ( 2 post ), x = ( pre z + 1 post ), y = ( pre x - z )).}' and can be compared with the parallel version of the program, without pre and post conditions."),
biocham( clear_model ),
......@@ -199,8 +201,9 @@ compile_program( Program ) :-
doc( "Here is an example shows the compilation result of euclid division: "),
biocham_silent( clear_model ),
biocham( compile_program( 'a := 7, b := 3. while( a >= b ). t1 := a - b, t2 := q + 1. a := t1, q := t2. endwhile. r := a.', simplify_variable_init: yes ) ),
biocham( numerical_simulation( time: 200, method: msbdf ) ),
biocham( plot( show:{ a_p, a_n, b_p, b_n, q_p, q_n, r_p, r_n } ) ),
% FIXME tooooooo slow
% biocham( numerical_simulation( time: 200 ) ),
% biocham( plot( show:{ a_p, a_n, b_p, b_n, q_p, q_n, r_p, r_n } ) ),
doc( "\\end{example}" ),
atom( Program ),
!,
......
......@@ -33,7 +33,10 @@ test('pattern_intermediary_success') :-
String = "S+E=>P+E.\n".
test('pattern_mapk1_to_mapk3') :-
test(
'pattern_mapk1_to_mapk3',
[condition(flag(slow_test, true, true))]
) :-
command('pattern_reduction("library:examples/sepi/mapk1.bc", "mapk1_reduced.bc").'),
with_output_to(
atom(Result),
......@@ -50,7 +53,10 @@ test('pattern_mapk1_to_mapk3') :-
count_start('sepi', Split2, 1).
test('pattern_mapk2_to_mapk3') :-
test(
'pattern_mapk2_to_mapk3',
[condition(flag(slow_test, true, true))]
) :-
with_option([r_1: no], pattern_reduction("library:examples/sepi/mapk2.bc", "mapk2_reduced.bc")),
with_output_to(
atom(Result),
......
......@@ -20,17 +20,17 @@
% mu is a morphism from an initial graph G1 to an image graph G2
% writes mapping constraints for mu
%
% @args G1 graph 1 [NbVertexe, NbSpecie, EdgesList, Id]
% @args G2 graph 2 [NbVertexe, NbSpecie, EdgesList, Id]
% @args Mapping list of vertex to mapp
% @args Stream Stream for the CNF file
% @arg G1 graph 1 [NbVertexe, NbSpecie, EdgesList, Id]
% @arg G2 graph 2 [NbVertexe, NbSpecie, EdgesList, Id]
% @arg Mapping list of vertex to mapp
% @arg Stream Stream for the CNF file
constraints(_, _, [], _).
constraints(G1, G2, [(Label1 -> deleted)|T], Stream) :-
G1 = [N1, _, _, Id1],
G2 = [N2, _, _, _],
species(Label1, X, Id1),
m_ij(X, N2, N2, Dummy),
G1 = [N1, _, _, Id1],
G2 = [N2, _, _, _],
species(Label1, X, Id1),
m_ij(X, N2, N2, Dummy),
get_option(extremal_sepi, Extremal_sepi),
(
Extremal_sepi \= no
......@@ -40,14 +40,14 @@ constraints(G1, G2, [(Label1 -> deleted)|T], Stream) :-
;
format(Stream, "~d 0~n", [Dummy])
),
constraints(G1, G2, T, Stream), !.
constraints(G1, G2, T, Stream), !.
constraints(G1, G2, [(Label1 -> Label2)|T], Stream) :-
G1 = [N1, _, _, Id1],
G2 = [N2, _, _, Id2],
species(Label1, X1, Id1),
species(Label2, X2, Id2),
m_ij(X1, X2, N2, X),
G1 = [N1, _, _, Id1],
G2 = [N2, _, _, Id2],
species(Label1, X1, Id1),
species(Label2, X2, Id2),
m_ij(X1, X2, N2, X),
get_option(extremal_sepi, Extremal_sepi),
(
Extremal_sepi \= no
......@@ -57,8 +57,8 @@ constraints(G1, G2, [(Label1 -> Label2)|T], Stream) :-
;
format(Stream, "~d 0~n", [X])
),
constraints(G1, G2, T, Stream).
constraints(G1, G2, T, Stream).
constraints(G1, G2, [(_Label1 -< _Label2)|T], Stream) :-
print_message(warning, 'mapping restriction -< is ignored in search_reduction'),
constraints(G1, G2, T, Stream).
print_message(warning, 'mapping restriction -< is ignored in search_reduction'),
constraints(G1, G2, T, Stream).
......@@ -494,12 +494,19 @@ seed(Number):-
prolog(Term):-
biocham_command,
type(Term,name),
doc('Just for development purposes, calls a Prolog term written between quotes and prints the result substitution.'),
atom_to_term(Term,Goal,Bindings),
Goal,
print(Bindings),nl.
biocham_command,
type(Term, name),
doc('Just for development purposes, calls a Prolog term written between quotes and prints the result substitution.'),
read_term_from_atom(Term, Goal, [variable_names(Bindings)]),
Goal,
(
Bindings \= []
->
print(Bindings),
nl
;
true
).
:- dynamic(have_to_delete_temporary_files/0).
......
......@@ -218,7 +218,7 @@ view_image(Filename) :-
img_tag(Filename) :-
format('<img src="~a">\n', [Filename]).
format('<img src="~a" alt="Simulation results">\n', [Filename]).
get_image_viewer_driver(Driver) :-
......
......@@ -32,7 +32,7 @@
</head>
<body>
<h1>The Biochemical Abstract Machine BIOCHAM 4</h1>
<h1>version 4.1.29 mars 2019</h1>
<h1>version 4.2.6, August 2019</h1>
<div class="authors">
<p>
......@@ -146,8 +146,8 @@ synthesizing reaction systems for executing imperative programs or computing rea
<a href="https://gitlab.inria.fr/lifeware/biocham">https://gitlab.inria.fr/lifeware/biocham/container_registry</a>. </li>
<br>
<li><span>current notebook version 4.1.29 online:</span>&nbsp;
<a href="http://lifeware.inria.fr/biocham4/online/">biocham4 notebook 4.1.29</a>. </li>
<li><span>current notebook version online:</span>&nbsp;
<a href="http://lifeware.inria.fr/biocham4/online/">biocham4 notebook</a>. </li>
<br>
<li><span>previous versions:</span>&nbsp;
<a href="biocham4.0.zip">biocham4.0.zip</a>, <a href="http://lifeware.inria.fr/biocham3/">biocham3</a>, <a href="http://lifeware.inria.fr:8888">biocham4 notebook 4.1.9</a>. </li></ul>
......
Supports Markdown
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