Commit 30a57e91 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

Merge branch 'release/$version'

parents c8437d65 cfd209d0
......@@ -39,10 +39,14 @@ pages:
- linux
script:
- make doc/index.html web/biocham.zip
- curl --fail "$CI_PAGES_URL/content.zip" -o content.zip
- if [ -r content.zip ]; then unzip content.zip; rm -f content.zip public/*.zip ; fi
- mkdir -p public
- cp -r doc devdoc web/*.{html,png,zip} public
- if [[ -n "$CI_COMMIT_TAG" ]] ; then cp public/biocham.zip public/biocham_$CI_COMMIT_TAG.zip ; mv public/doc public/doc_$CI_COMMIT_TAG ; ln -s doc_$CI_COMMIT_TAG public/doc ; fi
- cp public/biocham.zip public/biocham_latest.zip
- zip -r content.zip public
- mv content.zip public
artifacts:
paths:
- public
......
......@@ -57,7 +57,7 @@ WORKFLOWS_DIR=$(JUPYTER_DIR)/guinbextension/src/config/workflows
NOTEBOOKS=library/examples/doctor_in_the_cell/diagnosis.ipynb library/examples/tutorial/tutorial17cmsb.ipynb
REFDIR=nbhtml
all: biocham biocham_debug test doc/index.html pldoc install_kernel install_gui
all: biocham biocham_debug quick doc/index.html pldoc install_kernel install_gui
quick: unit_tests
......@@ -97,29 +97,30 @@ $(SWIPL): $(SWIPL).c \
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir ; done
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LDLIBS) -lstdc++ -o $@
doc/index.html doc/commands.js: biocham
./biocham --generate-doc
doc/index.html doc/commands.js: biocham_debug
echo "generate_doc." | ./biocham_debug
pldoc:
echo "doc_save(., [if(true), doc_root('doc/pldoc')])." | swipl -q > /dev/null
devdoc:
./biocham --generate-devdoc
echo "generate_devdoc." | ./biocham_debug
# quick ones only
unit_tests: biocham_debug
echo "run_tests_and_halt." | ./biocham_debug
# slow tests too
test: biocham_debug jupyter_tests
test: biocham_debug
echo "flag(slow_test, _, true), run_tests_and_halt." | ./biocham_debug
$(MAKE) jupyter_tests
jupyter_tests: install_kernel
PATH=$(CURDIR):$(PATH) jupyter nbconvert --execute --stdout library/examples/cmsb_2017/sigmoids.ipynb > /dev/null
# runs test unit %
test_%: biocham_debug
echo "flag(slow_test, _, true), run_tests_and_halt('$*')." | ./biocham_debug
echo "flag(slow_test, _, false), 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 || pip install --user $(JUPYTER_DIR)/kernel
......@@ -198,13 +199,15 @@ gadagne_restart: gadagne
ssh -t gadagne 'cd /opt/tmpnb/ && sudo ./cleanup.sh && sudo ./tmpnb_biocham.sh'
release:
echo "current version: " && grep '^version' about.pl
@read -p "Version number (e.g. 4.1.0): " version && \
git flow release start '$$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" && \
git commit about.pl biocham_jupyter/guinbextension/package.json biocham_jupyter/kernel/biocham_kernel/__init__.py web/index.html -m "Version $$version" && \
git flow release finish '$$version' && \
git push --tags
refs: $(NOTEBOOKS) biocham
......
[![pipeline status](https://gitlab.inria.fr/lifeware/biocham/badges/develop/pipeline.svg)](https://gitlab.inria.fr/lifeware/biocham/commits/develop)
[![coverage report](https://gitlab.inria.fr/lifeware/biocham/badges/develop/coverage.svg)](https://gitlab.inria.fr/lifeware/biocham/commits/develop)
[![License](https://img.shields.io/badge/license-GPLv2-orange)](https://gitlab.inria.fr/lifeware/biocham/raw/develop/LICENSE)
# Biocham
This README file is mostly aimed at people *contributing* to Biocham
......
......@@ -8,10 +8,10 @@
about/0
]).
version('4.2.6').
version('4.3.8').
copyright(
'Copyright (C) 2003-2019 Inria, EPI Lifeware, Saclay-Île de France, France'
'Copyright (C) 2003-2020 Inria, EPI Lifeware, Saclay-Île de France, France'
).
license('GNU GPL 2').
......
:- use_module(library(plunit)).
:- begin_tests(aliases).
:- begin_tests(aliases, [setup((clear_model, reset_options))]).
test('alias', [true(Reactions == [2 * a => c])]) :-
test('alias', [true(Reactions == ['MA'(1) for 2 * a => c])]) :-
clear_model,
command(a + b => c),
command(alias(a = b)),
......
......@@ -9,6 +9,9 @@
normalize_number/2
]).
% Insert here for separate compilation and linting
:- use_module(doc).
:- use_module(util).
:- dynamic(canonical/3).
......@@ -523,6 +526,9 @@ sign(+ A, 1, A).
sign(- A, -1, A).
additive_block('_', []). % Notation of empty set in biocham
additive_block(+ A, [+A]).
additive_block(- A, [-A]).
......
:- use_module(library(plunit)).
:- begin_tests(arithmetic_rules).
:- begin_tests(arithmetic_rules, [setup((clear_model, reset_options))]).
test('distribute', [true(Out == a * a + a * b + c)]) :-
distribute(a * (a + b) + c, Out).
......
......@@ -106,6 +106,7 @@ initialize :-
command(Command)
)
),
store_default_options,
new_model,
assertz(initialized).
......@@ -152,4 +153,3 @@ biocham_command(_) :-
The additional arguments are given as a list in the last parameter.').
:-devcom('\\begin{todo}Make biocham commands functional. We need to know the result type for the gui... Furthermore, the show, list, enumerate,... commands are not so nice. The print result should be a text or a widget associated to the returned type.\\end{todo}').
:- use_module(library(plunit)).
:- begin_tests(biocham).
:- begin_tests(biocham, [setup((clear_model, reset_options))]).
test('initialize') :-
initialize.
......
{
"name": "gui",
"version": "4.2.6",
"version": "4.3.8",
"description": "biocham gui in jupyter notebook",
"main": "src/index.js",
"scripts": {
......
......@@ -12,11 +12,15 @@ commands = [
"add_ginml",
"add_influence",
"add_influences_from_ode",
"add_influences_from_ode_system",
"add_ode",
"add_qual",
"add_reaction",
"add_reactions_from_ode",
"add_reactions_from_ode_system",
"add_reactions_from_pivp",
"add_sbml",
"add_time_event",
"add_vertex",
"alias",
"bifurcations",
......@@ -27,6 +31,8 @@ commands = [
"check_multistability",
"check_oscillations",
"cleanup_ctl",
"clear_dimension",
"clear_dimensions",
"clear_initial_state",
"clear_model",
"clear_variation",
......@@ -34,6 +40,7 @@ commands = [
"compile_from_expression",
"compile_from_pivp",
"compile_program",
"compile_program_file",
"compile_transfer_function",
"compile_wgpac",
"continue",
......@@ -54,6 +61,7 @@ commands = [
"delete_reaction",
"delete_reaction_named",
"delete_reaction_prefixed",
"delete_reactions",
"delete_row",
"delete_table",
"delete_temporary_files",
......@@ -86,11 +94,10 @@ commands = [
"generate_ctl",
"generate_ctl_not",
"generate_traces",
"import_influences_from_ode_system",
"hybrid_dynamic_simulation",
"hybrid_static_simulation",
"import_ode",
"import_reactions_from_graph",
"import_reactions_from_ode_system",
"infer_reactions_from_pivp",
"influence_graph",
"influence_hypergraph",
"influence_model",
......@@ -133,8 +140,10 @@ commands = [
"load_biocham",
"load_ginml",
"load_influences_from_ode",
"load_influences_from_ode_system",
"load_qual",
"load_reactions_from_ode",
"load_reactions_from_ode_system",
"load_sbml",
"load_table",
"logarithmic_bifurcations",
......@@ -164,6 +173,7 @@ commands = [
"reduce_model",
"rename_column",
"rename_table",
"reset_options",
"restore_parameter",
"revise_model",
"robustness",
......
"""Example magic"""
__version__ = '4.2.6'
__version__ = '4.3.8'
......@@ -84,14 +84,6 @@ option('--trace', Arg, Arg) :-
leash(-all),
trace.
option('--generate-doc', Arg, Arg) :-
generate_doc,
quit.
option('--generate-devdoc', Arg, Arg) :-
generate_devdoc,
quit.
option('--version', Arg, Arg) :-
quit.
......@@ -121,7 +113,7 @@ option('--list-commands', [], []) :-
:- doc('\\texttt{biocham [file]}
launches Biocham and optionnally loads the file given as argument.').
:- doc('\\texttt{biocham --trace --generate-doc --version --list-commands} are possible options (prefixed by two dashes).').
:- doc('\\texttt{biocham --trace --version --list-commands} are possible options (prefixed by two dashes).').
:- doc('\\texttt{biocham_debug} is the command to use to launch Biocham with the Prolog toplevel.').
......
:- use_module(library(plunit)).
:- use_module(reaction_rules).
:- begin_tests(conservation_laws).
:- begin_tests(conservation_laws, [setup((clear_model, reset_options))]).
test(
......@@ -49,7 +49,7 @@ test(
setup(set_some_conservations),
cleanup(clear_model),
true(Conservations ==
'[0] a-a+2*a\n[1] b-b+2*b\n[2] c-c+2*c\n')
'[0] \'a-a\'+2*a\n[1] \'b-b\'+2*b\n[2] \'c-c\'+2*c\n')
]
) :-
with_output_to(atom(Conservations), command(list_conservations)).
......
......@@ -908,13 +908,15 @@ setup_doc :-
generate_doc :-
setup_doc,
generate_doc_file(doc),
check_doc(doc, quiet).
check_doc(doc, quiet),
!.
generate_devdoc :-
setup_doc,
generate_doc_file(devdoc),
check_doc(devdoc, quiet).
check_doc(devdoc, quiet),
!.
generate_doc_file(Type) :-
......
......@@ -3,6 +3,7 @@
[
% Public API
add_event/2,
add_time_event/2,
list_events/0,
list_model_events/0
]
......@@ -51,10 +52,22 @@ add_event(Condition, ParameterValues) :-
add_item([kind: event, item: event(Condition, ParameterValues)]).
add_time_event(Condition, ParameterValues) :-
biocham_command(*),
type(Condition, condition),
Condition =.. [_Functor, 'Time', Threshold],
type(ParameterValues, '*'(parameter_name = arithmetic_expression)),
doc('Introduce a special kind of event when Time is the only variable, they may be used
for efficiency reason during numerical integration. The only allowed syntax is of the
form: Time > a or Time >= b.'),
add_item([kind: time_event, item: event('Time'>Threshold, ParameterValues)]).
list_events :-
biocham_command,
doc('lists all the declared events.'),
list_items([kind: event]).
list_items([kind: event]),
list_items([kind: time_event]).
:- devdoc('\\section{Private predicates}').
......@@ -65,6 +78,7 @@ list_model_events :-
lists all the events in a loadable syntax
(auxiliary predicate of list_model).
'),
% List the regular events
\+ (
item(
[no_inheritance, kind: event, item: event(Condition, ParameterValues)]
......@@ -78,4 +92,19 @@ list_model_events :-
),
write(').\n')
)
),
% List the time events
\+ (
item(
[no_inheritance, kind: time_event, item: event(Condition, ParameterValues)]
),
\+ (
format('add_time_event(~w, ', [Condition]),
write_successes(
member(Parameter = Value, ParameterValues),
write(', '),
format('~w = ~w', [Parameter, Value])
),
write(').\n')
)
).
......@@ -178,6 +178,10 @@ foltl_expression(E * F) :-
foltl_expression(E),
foltl_expression(F).
foltl_expression(E ^ F) :-
foltl_expression(E),
foltl_expression(F).
foltl_expression(E / F) :-
foltl_expression(E),
foltl_expression(F).
......@@ -888,6 +892,14 @@ generate_expression(A) :-
!,
format('(*i)[~d]', [Index]).
generate_expression(A^B) :-
!,
write('pow('),
generate_expression(A),
write(', '),
generate_expression(B),
write(')').
generate_expression(Expression) :-
binary_operator(Expression, A, Op, B),
!,
......@@ -953,6 +965,21 @@ check_linearity_expression(Expression) :-
true
).
check_linearity_expression(Expression) :-
Expression = A ^ B,
!,
(
(
has_variable(A)
;
has_variable(B)
)
->
throw(error(not_linear(Expression)))
;
true
).
check_linearity_expression(Expression) :-
Expression = A / B,
!,
......
......@@ -2,7 +2,8 @@
:- use_module(foltl).
:- use_module(objects).
:- begin_tests(foltl, [condition(flag(slow_test, true, true))]).
:- begin_tests(foltl, [condition(flag(slow_test, true, true)),
setup((clear_model, reset_options))]).
test('validity_domain F', [true(Domain == (v >= 10))]) :-
clear_model,
......
:- use_module(library(plunit)).
:- begin_tests(formal_derivation).
:- begin_tests(formal_derivation, [setup((clear_model, reset_options))]).
test('dx/dt(x) = 1', [true(E == 1)]) :-
derivate(x, x, E).
......
:- use_module(library(plunit)).
:- begin_tests(functions).
:- begin_tests(functions, [setup((clear_model, reset_options))]).
test(
'function',
......
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