Nanoscipy

Latest version: v3.0.17

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

Scan your dependencies

Page 7 of 10

2.1.2

Quick fix for fit_data

2.1.1

Important Changes
fit_data: extMax and extMin keys are replaced with extrp key, which will automatically determine if the extrapolation is a minimum or a maximum, if a list of two numeric values are given, it will set the first elememt as minimum and the second as maximum.

plot_data: added options for limiting and scaling axis.

Optimizations
fit_data: optimized parameters

2.1.0

Important Changes
'stepFinder()' has changed to 'step_finder()', and 'xData' has changed to 'x_data', and 'yData' to 'y_data'
'data_extrema()' is now inactivated by default.

Features
'plot_data()' now autocolors the first 20 data sets. If more data sets are used, it is nescessary to define costum colors with dcol.

Misc
Better error handling.

2.0.1

2.0.0alpha10

New doc strings

1.518

>>> | dxy = 1.5404826304421216e-07 m
>>> | dz = 5.47646986653663e-07 m
>>> | rxy = 7.702413152210608e-08 m
>>> | rz = 2.738234933268315e-07 m
>>> | V = 6.804761940761147e-21 m^3


Note that this feature is overwritten by using the `add_res` parameter in `.calc()`:
python
test1.add_cns('k=34')
test1.calc('b=34k', 'g')
test1.constants()


>>> Result: g = 34·k = 1156
>>> | k = 34
>>> Currently defined constants:
>>> | k = 34
>>> | g = 1156


In addition, as seen in the example above, the 'result name' now shows up in the console print.

modules.DatAn
An early stage feature has been added, that allows for defining functions to fit data to, as in any other CAS tool. E.g.;
python
import nanoscipy.modules as nsm
temps = [800, 900, 1000, 1100, 1200]
chis = [(i * 10 ** -5) ** - 1 for i in (3.3, 2.1, 1.55, 1.2, 1.0)]
func = 'f(T)=(C/(T-theta))^-1'
data = nsm.DatAn(temps, chis, func, [1e-3, 1])

Rather than having to define the function as:
python
func = lambda T, theta, C: (C / (T - theta)) ** - 1

or
python
def func(T, theta, C):
return (C / (T - theta)) ** - 1

The functionality of this is that the part before `'='` states which variable is varying, so in the example above `'T'` is the variable. The function name (above `'f'`) can be anything, as it is only used for display. In addition to this, the attribute `func_out` has been added, and displays the function as it would be written down on paper. E.g. for the example above:
python
print(data.func_out)
>>> ['f(T)=(0.005711/(T-627.9))^-1']

Note that by default it rounds the values to four decimals. An option to change this will be added in the upcoming patch. Note also importantly that this is a very early stage feature, and is currently significantly slower than the normal way, and the guess values generally needs to be better than usual for it not to run into dead ends. Furthermore, this is only supported for `method='curve_fit'`.

util.split()
It is now possible to do a direct replacement of the delimiter during the split with the parameter `rep`. This can in principle be any var type.

util.multi_split()
Similarly, as for `util.split()` a direct replacement feature has been added as the parameter `rep`. Note that this must be a list, and if the length of the replacement list does not match the delimiter list, then the script will execute replacements per available replacement. That is, if `items=['alpha', 'beta', 'gamma']` with `reps=['α', 'δ']` then after the split, all the previous elements of `'alpha'` is now `'α'` and `'beta'` is now `'δ'`, but all `'gamma'` elements are still `'gamma'`.

Changes
util.split()
Has been changed and optimized. Should be slightly faster now.

modules.NumAn
.calc()
When overwriting constants from `.calc(add_res=)`, the console prompt now shows up _before_ the result-print, rather than directly after.

In addition, the way console printing is done has been changed completely. This should not affect anything on the user end.

Natural constants are now displayed slightly different, to set them apart from constants that may have been defined.

mathpar.parser()
Note the vision here: `mathpar.parser()` should be reduced to simply the backend of the calculator, which is intended to be `modules.NumAn` and therefore, the following changes have been made: The kwargs `true_string` and `unit_res` have been removed along with their functionality. The parameter `cprint` is now a bool, and the console print will always have explicit multiplication. The reasoning behind these changes is that by reducing the `mathpar.parser()` to just a backend script for `modules.NumAn`, a lot of efficiency should be gained, as nothing will be checked multiple times, and checker scripts can be simplified emmensely, as much of the preparation for numerical calculation is being done by `NumAn` itself.

Optimizations has also been done, and the script should be notably faster for large calculations.

unitpar.unit_parser()
The same changes has been made as the ones for `mathpar.parser()` with the same vision. Additionally, `cprint` is now a parameter rather than a kwarg.

Bug fixes
unitpar.unit_parser()
Fixed an infinite loop issue that would sometimes occur if there were lone units next to a `'/()'` term.

modules.NuAm
.calc()
Fixed an issue where constants could not be printed in the console if they were closed off with parentheses without any mathematical operator.

Page 7 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.