New features
modules.NumAn
Added kwarg `supp_prompt` that allows for suppressing console prompts during script runtime. Currently there is only the options `'cns_change'`, which suppresses the constant change prompts, and `'all'`, which suppresses all prompts that may occur.
.calc()
Newly computed result may be added directly from the expression itself as if defining a constant:
python
import nanoscipy.modules as nsm
test1 = nsm.NumAn('lambda=500 nm, na=1.4, n=1.518')
test1.add_cns('dxy=0.61lambda/(sqrt(2)na), dz=2lambdan/(sqrt(2)(na)^2)')
test1.add_cns('rxy=dxy/2, rz=dz/2')
test1.calc('V=4/3pi*(rxy)^2*(rz)')
test1.constants()
>>> Result: V = 4/3·π·(rxy)^2·(rz) = 6.805e-21 m^3
>>> | rxy = 7.702e-8 m
>>> | rz = 2.738e-7 m
>>> Currently defined constants:
>>> | lambda = 500 nm