Functions in standard in BLISS shell
Following a question during the general presentation, I would like to know which mathematical functions you are interested to get in BLISS shell by default.
-
For info, here are the built-in functions in SPEC for example:
-
The more we add functions by default, the more a typo can occur.
- we can just add:
import math
import numpy as np
in bliss shell.
- we can just add:
-
from numpy import *
is not a recommanded practice. -
It there a reason to prefer functions from
math
module rather than functions fromnumpy
module ?-
math
functions can be faster on scalars -> we don't care
-
-
Of course it's always possible to import what you want with:
from math import cosh
or
from numpy import cosh
and to put that in the setup of your session.
List
-
strings
-
length()
:len()
-
index()
rsplit()
split()
substr()
:str
-
asc()
: ->ord()
-
sscanf()
: no -
gsub()
gensub()
match()
:re
-
-
mathematic
-
pow()
:np.power()
-
sqrt()
:np.sqrt()
-
exp()
:np.exp()
-
exp10()
:1e
-
log()
log10()
:np.log()
np.log10()
-
sin()
cos()
tan()
:np.sin()
-
acos()
asin()
atan()
atan2()
:np.arccos()
np.arcsin()
np.arctan()
np.arctan2()
-
deg()
:np.degrees()
-
rad()
:np.radians()
ornp.deg2rad()
? -
fabs()
:abs()
-
srand()
rand()
:import random
orfrom numpy.random import rand
-
-
time
-
date()
:time.asctime()
->'Thu Feb 27 13:03:36 2020'
-
time()
:time.time()
sleep()
-
-
misc
-
unix()
: no -
sleep()
: !! must begevent.sleep
-
dcb
: no
-
Edited by Cyril Guilloud