Skip to content

Instantly share code, notes, and snippets.

View klieret's full-sized avatar
💭
🦊

Kilian Lieret klieret

💭
🦊
View GitHub Profile
@klieret
klieret / cachedCalc.wl
Last active May 17, 2021 21:36
Cache the result of Mathematica calculations and load it again later.
cachedCalc::usage="Cache the result of a calculation into a .mx file at \
<notebook directory>/<notebook name>/<variable name>.mx
Arg1: variable (variable as symbol or variable name as string)
Arg2: expression (how to calculate value of the variable)
Arg3: forceRecalculate (bool; default False; recalculate even if found in Cache).
Optional arguments:
quiet (bool: should debug messages be printed?)
maxAge (date difference object: if the cache is older than that age, a \

Use basf2 installation:

Set up basf2

cd /cvmfs/belle.cern.ch/ubuntu1604/
source tools/setup_belle2
cd releases/build-2017-10-16/
setuprel

Rerun those commands every time you start working agai!