Nanoscipy

Latest version: v3.0.17

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

Scan your dependencies

Page 3 of 10

3.0.5

Bug fixes
modules.NumAn
.add_cns()
Fixed an issue, where the warning when overwriting constants was not working as intended.
In addition, the warning has been changed to a simple print, to increase clarification around messaging.

3.0.4

Changes
modules.NumAn()
.calc()
Improved error handling.
Additionally, now the `'symc'` and `'symc_ex'` printing options only display the constants relavant to the computed expression, rather than displaying _all_ constants at every computation.

util.string_sorter() -> util.list_sorter()
The function string_sorter() has been renamed more appropriately to list_sorter(). The functionality is more or less the same, however, the previous `stype='size'` is now `stype='str_size'`, due to the new `stype='int_size'` functionality being added. This new sorting type, sorts according to values in the first list.

mathpar.parser()
The Boltzmann constant now displays as `'kᴮ'` to increase clarification in print (before `'k'`).

util.replace()
Has been completely rewritten. Now supports replacements of any size (rather than the previous max of 10). Additionally, depending on the situation, the script is somewhere between 1.5 to 60 times faster (emphasis on situational).

Bug fixes
unitpar.unit_solver()
Fixed an issue where implicit multiplication between powers and units was not recognized correctly.

3.0.3

Bug fixes
Updated a list to contain decomposed derivation units and respective derivations. The unit_abbreviator functionality should work as intended now.

3.0.2

New features
util.replace()
Now it is possible to have a single replacement string to replace all given elements.

Bug fixes
The added feature to util.replace() fixes an issue in the working scheme for modules.NumAn() in version 3.0.1.

3.0.1

New features
mathpar.parser()
Updated multiplication symbol. Now displays properly in Windows 11 terminal.

unitpar.unit_abbreviator()
Added this function, which takes a decomposed SI unit, and replaces those SI units, with its decomposition. Currently only has limited use. Can detect only units to the power of 1 or -1. Expect extended support in later updates.

util.replace()
Added a keyword argument, which allows output as a list instead of the collected string (by util.list_to_string()) as is (now) the default.

Changes
modules.NumAn()
.add_cns()
Changed the way the function works. Instead of pre-computing the constant, it simply fixes them, so that if these constants are defined with other constants, the other constants are replaced with their respective equation. This makes it so that computations are only done once; when the .calc() attribute function is called.

Bug fixes
modules.NumAn()
Fixed an issue where units were replaced by defined constants.

.calc()
Fixed an issue, where implicit multiplication was not handled in a way that allowed for picking up multiplication errors for undefined constants.

mathpar.product_parser()
Fixed an issue where implicit multiplication was not placed correctly for a value and a starting bracket.

3.0.0

New features
unitpar.unit_parser()
A completely new module that allows for computation with units. At the moment, it does not have support for candela, and derived units thereof. Has support for the following base units:
`'s', 'm', 'g', 'A', 'K', 'mol', 'N', 'C', 'kat', 'Hz', 'Bq', 'J', 'Pa', 'W', 'Gy', 'Sv', 'V', 'Wb', 'Ω', 'F', 'S', 'H', 'T', 'eV', 'Da', 'L', 'cal', 'bar', 'Torr'`
which may be used along with a supported prefix:
`'Y', 'Z', 'E', 'P', 'T', 'G', 'M', 'k', 'h', 'da', 'd', 'c', 'm', 'µ', 'n', 'p', 'f', 'a', 'z', 'y'`
Also supports some special units:
`'Å', 'u', 'amu', 'atm', 'min'`
Note importantly that units are denoted with a `unit_identifier`, by default this is set to `' '`, so a unit in any computation should be denoted as `' cm'` e.g. This can in principle be set to anything (but be smart about it). For example if `unit_identifier='~'`, then every unit should be denoted as `'~cm'`.
Regarding the functionality of the units themselves: they act as a multiplicative scalar to whatever is in front of them. This is, however, not true for the case of division. E.g. the expression `'2/5 s'` is read as `'2/(5 s)'` rather than `'(2/5) s`. Thus, it is important to denote, whether the unit is part of the denominator or the numerator. This enables denoting units as e.g. `'2 m/ s'`:
![image](https://user-images.githubusercontent.com/87773847/198370854-a75afcf9-5c36-43a1-8895-da40960a31ea.png)
There is however, an exception to this. If the unit is not an SI unit, and has to be decomposed into other SI units, then this will function sort of in a mixed way and not work correctly. Thus, it is adviced to always use parentheses when dividing, and otherwise use powers whenever possible.
Note also that if the unit result in no unit, the expression will have `'a.u.'` to signal either arbitrary units or that the result is a unitless quantity (see example below).
Currently, the `'sqrt()'` function does not work with units.

modules.NumAn
All constants are now being inserted as a bracket clause, ensuring that the expression is always read as expected. The effect of this can be seen, when choosing `cprint='num'`.
Now also supports definition of a NumAn object, without defining any constants. This allows for much more versatility, when using this class. Naturally, constants may be added at any time still, either by changing the initial definition, or by using `.add_cns()` or `.add_res()`
Now also support usage of units in computations. This works both for added constants and the calculation expressions:
![image](https://user-images.githubusercontent.com/87773847/198371144-51b75c00-d1f0-4732-afb3-e67a8e7969ad.png)

Note importantly that now by default, all natural constants have a unit attached to them. This can have unintended consequences if the script is used to calculate without units. To avoid issues with this, a new optional parameter in NumAn has been made. If no units is desired, set `units=False`.


.calc()
Added cprint options `'sym_ex'` and `'symc_ex'`, which allows for printing the input expression with explicit multiplication (see example above). Note that `cprint='num'` now always displays explicit multiplication, in addition to having all constants displayed as numbers, always.

mathpar.parser()
Added electron mass `'_me'` and proton mass `'_mp'` as natural constants.

Page 3 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.