Nanoscipy

Latest version: v3.0.17

Safety actively analyzes 701868 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 10

3.0.11

Bug fixes
modules.NumAn
.calc()
Fixed an issue where unitless results were saved with the extension `' a.u.'` with `add_res=`, which caused issues when these new constants were used in later calculations.

3.0.10

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

3.0.9

Bug fixes
modules.NumAn
.calc()
Fixed an issue where computations could not be done, if they had no units.

3.0.8

Changes
Updated the README file.

modules.NumAn
The prompt message for overwriting constants has been changed slightly.

Bug fixes
modules.NumAn
Fixed an issue, where constants were sometimes saved incorrectly, if the unit identifier was something else than `' '`.

.calc()
Fixed a potential issue, where constants might not be displayed correctly after changing significant figures.

Fixed issue where constants where not displaying correctly for computed result.

Fixed an issue where constants were displayed unintendedly if they were contained in units.

3.0.7

New features
Added a getting started with unit calculations guide in the README file.

mathpar.parser(), unitpar.unit_parser(), modules.NumAn
It is now possible to specify how many significant figures should be displayed when using `cprint` with the optional argument `sf` (for NumAn - this is a kwarg for unit_parser() and parser()). If set to `None` there is made no attempt to change the significant figures, otherwise if set to an int, an attempt will be made to conform to that significant figure. This feature is based on the mpmath `workdps` function. Note that for NumAn, this can also be specified per calculation (`.calc(sf=)`). The default for NumAn is 4. For the other functions it is None.

Changes
modules.NumAn
Changed how added constants got put in a bracket, to ensure correct computation with units.

.del_cns()
Now works with *args, rather than a single argument. Thus, multiple constants can be deleted by just adding more constants to the expression, e.g. `.del_cns('A', 'lambda')` will delete both constants `'A'` and `'lambda'` (before `.del_cns(('A', 'lambda'))`). Note that `.del_cns('A, lambda')` will work in the same way (here the delimiter `';'` may be used instead of `','` if desired).

.calc()
Changed the way constants are displayed after computations. In addition, now the script saves computed constants as input, so that they do not have to be computed every time they are used in an expression. This should increase efficiency slightly.

Changed the way constants are checked regarding being an expression or a value. This new method should be much more accurate.

Changed `cprint` to kwarg rather than parameter.

mathpar.parser()
Removed rare instances of pi-prettifying.

Bug fixes
mathpar.parser()
Fixed instances where the unit `'amu'` was unintendedly swapped by the prettifier to `'aµ'`.

modules.NumAn
Fixed an issue where units were unintendedly swapped with defined constants, if the constants were in the unit, bricking calculations from that point and onwards.

.calc()
Fixed a potential issue in the way computed constants were saved.

Fixed unintended display of defined constants, if they were part of a function such as `cos()`, `exp()`, etc., but not in the expression itself.

Fixed issues, where `cprint=None` was read as defined from `__init__()` rather than as the option `None`.

3.0.6

New features
modules.NumAn
It is now possible to set a global default for `cprint` for all instances of .calc(). It is however, still possible to set it specifically for individual instances of .calc().

.constants()
This new function displays all the currently defined constants and their respective values.

Bug fixes
unitpar.parser()
Fixed an issue where equations where a number with a unit divided by a number without a unit in parentheses caused an infinite loop.

modules.NumAn
.calc()
Fixed an issue where constants defined with `add_res` did not overwrite previously defined constant with same name (if any). The same issue has been fixed with .add_res().

Page 2 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.