Commit 6bd75701 authored by Sylvain Soliman's avatar Sylvain Soliman

Merge branch 'release/4.3.9'

parents 30a57e91 7284cff7
......@@ -201,13 +201,13 @@ gadagne_restart: gadagne
release:
echo "current version: " && grep '^version' about.pl
@read -p "Version number (e.g. 4.1.0): " version && \
git flow release start '$$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 && \
sed -i'' -e "s+^<h1>version.*</h1>+<h1>version $$version $(shell LC_ALL=C date '+%B %Y')</h1>+" web/index.html && \
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 flow release finish "$$version" && \
git push --tags
refs: $(NOTEBOOKS) biocham
......
......@@ -8,7 +8,7 @@
about/0
]).
version('4.3.8').
version('4.3.9').
copyright(
'Copyright (C) 2003-2020 Inria, EPI Lifeware, Saclay-Île de France, France'
......
......@@ -99,7 +99,8 @@ initialize :-
set_draw_graph_driver(graph_pdf),
nb_setval(graph_pdf, 0),
nb_setval(current_models, []),
load_biocham('library:initial'),
new_model,
set_model_name('initial'),
\+ (
initial_command(Command),
\+ (
......
{
"name": "gui",
"version": "4.3.8",
"version": "4.3.9",
"description": "biocham gui in jupyter notebook",
"main": "src/index.js",
"scripts": {
......
"""Example magic"""
__version__ = '4.3.8'
__version__ = '4.3.9'
......@@ -75,6 +75,8 @@ check_conservations :-
check_conservation(C, Conserv)
).
:- initial(option(conservation_size: 4)).
search_conservations :-
biocham_command,
......
......@@ -4,7 +4,6 @@
% Grammar
foltl/1,
foltl_predicate/1,
foltl_expression/1,
parameter_between_interval/1,
variable_objective/1,
time_value/1,
......@@ -124,80 +123,43 @@ foltl(F) :-
foltl_predicate(E = F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E <> F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E << F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E >> F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E < F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E <= F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E > F) :-
foltl_expression(E),
foltl_expression(F).
arithmetic_expression(E),
arithmetic_expression(F).
foltl_predicate(E >= F) :-
foltl_expression(E),
foltl_expression(F).
:- grammar(foltl_expression).
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).
foltl_expression(E ^ F) :-
foltl_expression(E),
foltl_expression(F).
foltl_expression(E / F) :-
foltl_expression(E),
foltl_expression(F).
foltl_expression(E) :-
number(E).
foltl_expression(FunctionApplication) :-
function_application(foltl_expression, FunctionApplication).
foltl_expression(E) :-
name(E).
foltl_expression([E]) :-
name(E).
arithmetic_expression(E),
arithmetic_expression(F).
:- grammar(time_value).
......@@ -544,7 +506,7 @@ expand_formula(Formula, ExpandedFormula) :-
grammar_map(
foltl,
[foltl:foltl:expand_formula,
foltl_expression:foltl:expand_expression],
arithmetic_expression:foltl:expand_expression],
Formula,
ExpandedFormula
).
......@@ -565,8 +527,8 @@ expand_expression(Expression, ExpandedExpression) :-
expand_expression(Expression, ExpandedExpression) :-
grammar_map(
foltl_expression,
[foltl_expression:foltl:expand_expression],
arithmetic_expression,
[arithmetic_expression:foltl:expand_expression],
Expression,
ExpandedExpression
).
......@@ -712,6 +674,7 @@ compute_domain~w(const Table &table) {
\+ (
sub_formula(SubFormula, Index),
\+ (
format('// ~w~n', [SubFormula]),
generate_sub_formula(SubFormula, Index)
)
),
......@@ -892,20 +855,15 @@ generate_expression(A) :-
!,
format('(*i)[~d]', [Index]).
generate_expression(A^B) :-
!,
write('pow('),
generate_expression(if C then A else B) :-
write_condition_to_c(C, foltl:generate_expression),
write(' ? '),
generate_expression(A),
write(', '),
generate_expression(B),
write(')').
write(' : '),
generate_expression(B).
generate_expression(Expression) :-
binary_operator(Expression, A, Op, B),
!,
generate_expression_with_parentheses(A),
write(Op),
generate_expression_with_parentheses(B).
write_expression_to_c(Expression, foltl:generate_expression).
binary_predicate(A = B, A, '==', B).
......@@ -938,11 +896,19 @@ binary_operator(A / B, A, '/', B).
check_linearity(Formula) :-
grammar_iter(
foltl,
[foltl_expression: foltl:check_linearity_expression],
[arithmetic_expression: foltl:check_linearity_expression],
Formula
).
check_linearity_expression(+Expression) :-
!,
check_linearity_expression(Expression).
check_linearity_expression(-Expression) :-
!,
check_linearity_expression(Expression).
check_linearity_expression(Expression) :-
(
Expression = A + B
......@@ -992,6 +958,22 @@ check_linearity_expression(Expression) :-
),
check_linearity_expression(A).
check_linearity_expression(if _Condition then A else B) :-
!,
check_linearity_expression(A),
check_linearity_expression(B).
check_linearity_expression(Expression) :-
compound(Expression),
!,
(
has_variable(Expression)
->
throw(error(not_linear(Expression)))
;
true
).
check_linearity_expression(_).
......@@ -1006,13 +988,11 @@ generate_expression_with_parentheses(A) :-
has_variable(A) :-
binary_operator(A, Left, _Op, Right),
compound(A),
!,
(
has_variable(Left)
;
has_variable(Right)
).
A =.. [_ | Args],
member(Arg, Args),
has_variable(Arg).
has_variable(A) :-
is_free_variable(A).
......
......@@ -185,118 +185,12 @@ write_arithmetic_expression(p(ParameterIndex)) :-
write_arithmetic_expression(f(ParameterIndex)) :-
format('f[~d]', [ParameterIndex]).
write_arithmetic_expression(- A) :-
write('- '),
write_arithmetic_expression_with_parentheses(A).
write_arithmetic_expression(A + B) :-
write_arithmetic_expression_with_parentheses(A),
write(' + '),
write_arithmetic_expression_with_parentheses(B).
write_arithmetic_expression(A - B) :-
write_arithmetic_expression_with_parentheses(A),
write(' - '),
write_arithmetic_expression_with_parentheses(B).
write_arithmetic_expression(A * B) :-
write_arithmetic_expression_with_parentheses(A),
write(' * '),
write_arithmetic_expression_with_parentheses(B).
write_arithmetic_expression(A / B) :-
write_arithmetic_expression_with_parentheses(A),
write(' / '),
write_arithmetic_expression_with_parentheses(B).
write_arithmetic_expression(A ^ B) :-
write('pow('),
write_arithmetic_expression(A),
write(', '),
write_arithmetic_expression(B),
write(')').
write_arithmetic_expression(sqrt(A)) :-
write('sqrt('),
write_arithmetic_expression(A),
write(')').
write_arithmetic_expression(cos(A)) :-
write('cos('),
write_arithmetic_expression(A),
write(')').
write_arithmetic_expression(sin(A)) :-
write('sin('),
write_arithmetic_expression(A),
write(')').
write_arithmetic_expression(exp(A)) :-
write('exp('),
write_arithmetic_expression(A),
write(')').
write_arithmetic_expression(log(A)) :-
write('log('),
write_arithmetic_expression(A),
write(')').
write_arithmetic_expression_with_parentheses(Expression) :-
write('('),
write_arithmetic_expression(Expression),
write(')').
write_condition(A = B) :-
write_arithmetic_expression_with_parentheses(A),
write(' == '),
write_arithmetic_expression_with_parentheses(B).
write_condition(A < B) :-
write_arithmetic_expression_with_parentheses(A),
write(' < '),
write_arithmetic_expression_with_parentheses(B).
write_condition(A > B) :-
write_arithmetic_expression_with_parentheses(A),
write(' > '),
write_arithmetic_expression_with_parentheses(B).
write_condition(A <= B) :-
write_arithmetic_expression_with_parentheses(A),
write(' <= '),
write_arithmetic_expression_with_parentheses(B).
write_condition(A >= B) :-
write_arithmetic_expression_with_parentheses(A),
write(' >= '),
write_arithmetic_expression_with_parentheses(B).
write_condition(true) :-
write('true').
write_condition(false) :-
write('false').
write_condition(A or B) :-
write_condition_with_parentheses(A),
write(' || '),
write_condition_with_parentheses(B).
write_condition(A and B) :-
write_condition_with_parentheses(A),
write(' && '),
write_condition_with_parentheses(B).
write_condition(not(A)) :-
write('!'),
write_condition_with_parentheses(A).
write_arithmetic_expression(E) :-
write_expression_to_c(E, gsl:write_arithmetic_expression).
write_condition_with_parentheses(Condition) :-
write('('),
write_condition(Condition),
write(')').
write_condition(C) :-
write_condition_to_c(C, gsl:write_arithmetic_expression).
write_initial_parameter_values(Options) :-
......
......@@ -8,19 +8,31 @@ then
if hash brew 2>/dev/null
then
echo "Using existing homebrew…"
brew update
else
echo "Installing homebrew…"
## xcode-select --install will need a GUI :/
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew install swi-prolog gsl gnuplot graphviz pkg-config ppl
# https://stackoverflow.com/questions/43619480/upgrade-or-install-a-homebrew-formula
function install_or_upgrade {
if brew ls --versions "$1" >/dev/null; then
HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade "$1"
else
HOMEBREW_NO_AUTO_UPDATE=1 brew install "$1"
fi
}
brew tap brewsci/science
brew install libsbml nusmv
brew install node
brew upgrade
brew cleanup
brewlings='swi-prolog gsl gnuplot graphviz pkg-config ppl libsbml nusmv node'
for brewling in $brewlings ; do
install_or_upgrade "$brewling"
done
release=
elif [[ -r /etc/debian_version ]]
then
conda_arch="Linux"
......@@ -110,28 +122,33 @@ else
fi
### Glucose
if [[ "$conda_arch" == "Linux" ]]
then
sudo cp glucose.py /usr/local/bin
else
cp glucose.py /usr/local/bin
if [[ ! -f /usr/local/bin/glucose.py ]] ; then
echo "Copying biocham's glucose.py to /usr/local/bin/"
if [[ "$conda_arch" == "Linux" ]]
then
sudo cp glucose.py /usr/local/bin
else
cp glucose.py /usr/local/bin
fi
fi
### Jupyter and python-sat
packages='python-sat jupyter bokeh ipywidgets'
if (hash pip3 2>/dev/null) || \
(hash pip 2> /dev/null) && [[ $(pip --version) == *"python 3"* ]]
if python3 -m pip --version 2>/dev/null
then
python3 -m pip install -U $packages
echo "Using existing pip for python3…"
else
if hash conda 2>/dev/null
then
echo "Using existing conda install to get pip…"
conda install -y pip
else
if [[ "$conda_arch" == "Linux" ]]
then
echo "Using apt to get python3-pip…"
sudo apt-get -qy install python3-pip
else
echo "Installing miniconda3…"
# Note that miniconda is available through brew cask, but to avoid adding
# brew cask if not necessary, we just do without
curl -fsSLO https://repo.continuum.io/miniconda/Miniconda3-latest-${conda_arch}-x86_64.sh
......@@ -142,8 +159,9 @@ else
conda install -y pip
fi
fi
python3 -m pip install -U $packages
fi
echo "installing python packages ($packages)…"
python3 -m pip install -U $packages
### trust all our notebooks but make them read-only
find . -name '*.ipynb' -print0 | xargs -0 jupyter trust
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -1148,5 +1148,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1495,5 +1495,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1881,5 +1881,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1418,5 +1418,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1537,5 +1537,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1200,5 +1200,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1682,5 +1682,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -1005,5 +1005,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -10146,5 +10146,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -5295,5 +5295,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
......@@ -2841,5 +2841,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 2
}
option(
fast_rate: 1000,
time: 20,
show: {},
method: bsimp, % msbdf,
error_epsilon_absolute: 1e-6,
error_epsilon_relative: 1e-6,
initial_step_size: 1e-6,
maximum_step_size: 1e-2,
minimum_step_size: 1e-5,
precision: 6, %5
nusmv_initial_states: all,
nusmv_counter_example: no,
boolean_semantics: negative,
logscale: '',
against: 'Time',
conservation_size: 4,
query: current_spec,
output_to_library: no,
simplify_variable_init: no, % used in odefunction.pl
zero_ultra_mm: no % used in odefunction.pl
).
......@@ -114,6 +114,14 @@ filter(no_filter).
filter(only_extrema).
:- grammar_doc('\\emphright{Only keeps the points that are an extremum for some variable.}').
:- initial(option(method: bsimp)).
:- initial(option(error_epsilon_absolute: 1e-6)).
:- initial(option(error_epsilon_relative: 1e-6)).
:- initial(option(initial_step_size: 1e-6)).
:- initial(option(maximum_step_size: 1e-2)).
:- initial(option(minimum_step_size: 1e-5)).
:- initial(option(precision: 6)).
:- initial(option(time: 20)).