Skip to content

Commit 7de0769

Browse files
authored
Merge branch 'develop' into check_grad_sbml_test_suite
2 parents af7fd07 + fd1e22e commit 7de0769

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,18 @@ if(${BLAS} STREQUAL "MKL" OR DEFINED ENV{MKLROOT})
153153
CACHE STRING "")
154154
endif()
155155
elseif(NOT DEFINED ENV{BLAS_LIBS} AND NOT DEFINED ENV{BLAS_CFLAGS})
156-
set(BLAS_INCLUDE_DIRS
157-
""
158-
CACHE STRING "")
159-
set(BLAS_LIBRARIES
160-
-lcblas
161-
CACHE STRING "")
156+
# if nothing is specified via environment variables, let's try FindBLAS
157+
find_package(BLAS)
158+
if(NOT BLAS_FOUND)
159+
# Nothing specified by the user and FindBLAS didn't find anything; let's try
160+
# if cblas is available on the system paths.
161+
set(BLAS_INCLUDE_DIRS
162+
""
163+
CACHE STRING "")
164+
set(BLAS_LIBRARIES
165+
-lcblas
166+
CACHE STRING "")
167+
endif()
162168
endif()
163169
add_compile_definitions(AMICI_BLAS_${BLAS})
164170

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if(Git_FOUND)
33
execute_process(
44
COMMAND
55
sh -c
6-
"${GIT_EXECUTABLE} describe --abbrev=4 --dirty=-dirty --always --tags | cut -c 2- | tr -d '\n' | sed s/-/./"
6+
"'${GIT_EXECUTABLE}' describe --abbrev=4 --dirty=-dirty --always --tags | cut -c 2- | tr -d '\n' | sed s/-/./"
77
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
88
OUTPUT_VARIABLE PROJECT_VERSION_GIT)
99
endif()

documentation/rtd_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mock>=5.0.2
44
setuptools==67.7.2
55
pysb>=1.11.0
66
matplotlib==3.7.1
7-
nbsphinx>=0.9.1
7+
nbsphinx==0.9.1
88
nbformat==5.8.0
99
recommonmark>=0.7.1
1010
sphinx_rtd_theme>=1.2.0

python/examples/example_splines_swameye/ExampleSplinesSwameye2003.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"source": [
106106
"# If running as a Github action, just do the minimal amount of work required to check whether the code is working\n",
107107
"if os.getenv('GITHUB_ACTIONS') is not None:\n",
108-
" n_starts = 10\n",
108+
" n_starts = 15\n",
109109
" pypesto_optimizer = pypesto.optimize.FidesOptimizer(verbose=logging.WARNING, options=dict(maxiter=10))\n",
110110
" pypesto_engine = pypesto.engine.SingleCoreEngine()"
111111
]
@@ -362,7 +362,7 @@
362362
"### Maximum Likelihood estimation\n",
363363
"Using pyPESTO we can optimize for the parameter vector that maximizes the probability of observing the experimental data (maximum likelihood estimation).\n",
364364
"\n",
365-
"A multistart method with local gradient-based optimization is used and the results of each multistart can be visualized in a waterfall plot. "
365+
"A multistart method with local gradient-based optimization is used and the results of each multistart can be visualized in a waterfall plot."
366366
]
367367
},
368368
{
@@ -908,15 +908,15 @@
908908
" np.log10(regstrength) # parameter is specified as log10 scale in PEtab\n",
909909
" )\n",
910910
" regproblem = copy.deepcopy(pypesto_problem)\n",
911-
" \n",
911+
"\n",
912912
" # Load existing results if available\n",
913913
" if os.path.exists(f'{name}.h5'):\n",
914914
" regresult = pypesto.store.read_result(f'{name}.h5', problem=regproblem)\n",
915915
" else:\n",
916916
" regresult = None\n",
917917
" # Overwrite\n",
918918
" # regresult = None\n",
919-
" \n",
919+
"\n",
920920
" # Parallel multistart optimization with pyPESTO and FIDES\n",
921921
" if n_starts > 0:\n",
922922
" if regresult is None:\n",
@@ -935,10 +935,10 @@
935935
" regresult.optimize_result.sort()\n",
936936
" if regresult.optimize_result.x[0] is None:\n",
937937
" raise Exception(\"All multistarts failed (n_starts is probably too small)! If this error occurred during CI, just run the workflow again.\")\n",
938-
" \n",
938+
"\n",
939939
" # Save results to disk\n",
940940
" # pypesto.store.write_result(regresult, f'{name}.h5', overwrite=True)\n",
941-
" \n",
941+
"\n",
942942
" # Store result\n",
943943
" regproblems[regstrength] = regproblem\n",
944944
" regresults[regstrength] = regresult"
@@ -1469,15 +1469,15 @@
14691469
" np.log10(regstrength) # parameter is specified as log10 scale in PEtab\n",
14701470
" )\n",
14711471
" regproblem = copy.deepcopy(pypesto_problem)\n",
1472-
" \n",
1472+
"\n",
14731473
" # Load existing results if available\n",
14741474
" if os.path.exists(f'{name}.h5'):\n",
14751475
" regresult = pypesto.store.read_result(f'{name}.h5', problem=regproblem)\n",
14761476
" else:\n",
14771477
" regresult = None\n",
14781478
" # Overwrite\n",
14791479
" # regresult = None\n",
1480-
" \n",
1480+
"\n",
14811481
" # Parallel multistart optimization with pyPESTO and FIDES\n",
14821482
" if n_starts > 0:\n",
14831483
" if regresult is None:\n",
@@ -1496,10 +1496,10 @@
14961496
" regresult.optimize_result.sort()\n",
14971497
" if regresult.optimize_result.x[0] is None:\n",
14981498
" raise Exception(\"All multistarts failed (n_starts is probably too small)! If this error occurred during CI, just run the workflow again.\")\n",
1499-
" \n",
1499+
"\n",
15001500
" # Save results to disk\n",
15011501
" # pypesto.store.write_result(regresult, f'{name}.h5', overwrite=True)\n",
1502-
" \n",
1502+
"\n",
15031503
" # Store result\n",
15041504
" regproblems[regstrength] = regproblem\n",
15051505
" regresults[regstrength] = regresult"
@@ -1934,7 +1934,7 @@
19341934
"## Bibliography\n",
19351935
"Schelker, M. et al. (2012). “Comprehensive estimation of input signals and dynamics in biochemical reaction networks”. In: Bioinformatics 28.18, pp. i529–i534. doi: [10.1093/bioinformatics/bts393](https://doi.org/10.1093/bioinformatics/bts393).\n",
19361936
"\n",
1937-
"Swameye, I. et al. (2003). “Identification of nucleocytoplasmic cycling as a remote sensor in cellular signaling by databased modeling”. In: Proceedings of the National Academy of Sciences 100.3, pp. 1028–1033. doi: [10.1073/pnas.0237333100](https://doi.org/10.1073/pnas.0237333100)."
1937+
"Swameye, I. et al. (2003). “Identification of nucleocytoplasmic cycling as a remote sensor in cellular signaling by databased modeling”. In: Proceedings of the National Academy of Sciences 100.3, pp. 1028–1033. doi: [10.1073/pnas.0237333100](https://doi.org/10.1073/pnas.0237333100).\n"
19381938
]
19391939
}
19401940
],

python/sdist/amici/de_export.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,11 +1999,10 @@ def _compute_equation(self, name: str) -> None:
19991999

20002000
# need to check if equations are zero since we are using
20012001
# symbols
2002-
if not smart_is_zero_matrix(self.eq("stau")[ie]):
2002+
if not smart_is_zero_matrix(self.eq("stau")[ie]) \
2003+
and not smart_is_zero_matrix(self.eq("xdot")):
20032004
tmp_eq += smart_multiply(
2004-
(self.sym("xdot_old") - self.sym("xdot"))
2005-
if not smart_is_zero_matrix(self.eq("xdot"))
2006-
else self.sym("xdot_old"),
2005+
self.sym("xdot_old") - self.sym("xdot"),
20072006
self.sym("stau").T,
20082007
)
20092008

0 commit comments

Comments
 (0)