scinumtools package
Subpackages
- scinumtools.dip package
- Subpackages
- scinumtools.dip.config package
- Submodules
- scinumtools.dip.config.export module
- scinumtools.dip.config.export_bash module
- scinumtools.dip.config.export_c module
- scinumtools.dip.config.export_cpp module
- scinumtools.dip.config.export_fortran module
- scinumtools.dip.config.export_json module
- scinumtools.dip.config.export_rust module
- scinumtools.dip.config.export_toml module
- scinumtools.dip.config.export_yaml module
- Module contents
- scinumtools.dip.datatypes package
- scinumtools.dip.docs package
- Subpackages
- Submodules
- scinumtools.dip.docs.documentation module
- scinumtools.dip.docs.item_import module
- scinumtools.dip.docs.item_injection module
- scinumtools.dip.docs.item_node module
- scinumtools.dip.docs.item_parameter module
- scinumtools.dip.docs.item_source module
- scinumtools.dip.docs.item_unit module
- scinumtools.dip.docs.settings module
- Module contents
- scinumtools.dip.lists package
- scinumtools.dip.nodes package
- Submodules
- scinumtools.dip.nodes.node module
- scinumtools.dip.nodes.node_base module
- scinumtools.dip.nodes.node_boolean module
- scinumtools.dip.nodes.node_case module
- scinumtools.dip.nodes.node_condition module
- scinumtools.dip.nodes.node_constant module
- scinumtools.dip.nodes.node_description module
- scinumtools.dip.nodes.node_empty module
- scinumtools.dip.nodes.node_float module
- scinumtools.dip.nodes.node_format module
- scinumtools.dip.nodes.node_group module
- scinumtools.dip.nodes.node_import module
- scinumtools.dip.nodes.node_integer module
- scinumtools.dip.nodes.node_mod module
- scinumtools.dip.nodes.node_option module
- scinumtools.dip.nodes.node_select module
- scinumtools.dip.nodes.node_source module
- scinumtools.dip.nodes.node_string module
- scinumtools.dip.nodes.node_table module
- scinumtools.dip.nodes.node_tags module
- scinumtools.dip.nodes.node_unit module
- scinumtools.dip.nodes.parser module
- Module contents
- scinumtools.dip.pygments package
- scinumtools.dip.qt package
- scinumtools.dip.solvers package
- scinumtools.dip.config package
- Submodules
- scinumtools.dip.dip module
- scinumtools.dip.environment module
- scinumtools.dip.settings module
- Module contents
- Subpackages
- scinumtools.harmony package
- scinumtools.materials package
- Submodules
- scinumtools.materials.composite module
- scinumtools.materials.element module
- scinumtools.materials.material module
- scinumtools.materials.material_solver module
- scinumtools.materials.matter module
- scinumtools.materials.periodic_table module
- scinumtools.materials.substance module
- scinumtools.materials.substance_solver module
- Module contents
- scinumtools.solver package
- Submodules
- scinumtools.solver.atom module
- scinumtools.solver.expression module
- scinumtools.solver.operators module
OperatorAdd
OperatorAnd
OperatorBase
OperatorCos
OperatorEq
OperatorExp
OperatorGe
OperatorGt
OperatorLe
OperatorLog
OperatorLog10
OperatorLogb
OperatorLt
OperatorMul
OperatorNe
OperatorNot
OperatorOr
OperatorPar
OperatorPow
OperatorPowb
OperatorSin
OperatorSqrt
OperatorSub
OperatorTan
OperatorTruediv
Otype
- scinumtools.solver.solver module
- scinumtools.solver.tokens module
- Module contents
- scinumtools.units package
- Submodules
- scinumtools.units.base_units module
- scinumtools.units.constant module
- scinumtools.units.dimensions module
- scinumtools.units.fraction module
- scinumtools.units.magnitude module
- scinumtools.units.nan module
- scinumtools.units.quantity module
- scinumtools.units.settings module
- scinumtools.units.systems module
- scinumtools.units.unit module
- scinumtools.units.unit_environment module
- scinumtools.units.unit_list module
- scinumtools.units.unit_solver module
- scinumtools.units.unit_types module
- Module contents
Submodules
scinumtools.cached_function module
- scinumtools.cached_function.CachedFunction(file_cache)
Decorator function that cashes data produced by a function
- Parameters:
file_cache (str) – Name of the file that will store cached data
- scinumtools.cached_function.hash_file_name(file_cache, args, kwargs)
scinumtools.data_combination module
scinumtools.data_plot_grid module
scinumtools.image_metadata module
scinumtools.normalize_data module
- class scinumtools.normalize_data.NormalizeData(xaxis=None, yaxis=None)
Bases:
object
Normalize numerical data across multiple plots
- append(vdata, xdata=None, ydata=None)
Append data to the range collector
Statistics of x and y axes is optional
- Parameters:
vdata – Numerical data
xdata – X-axis points
ydata – Y-axis points
- data()
Return collected ranges as a dictionary
- extent(xlog=False, ylog=False)
- items()
- linnorm()
Return linear norm from ranges
- lognorm()
Return logarithmic norm from ranges
- xaxis: str
- xranges()
Return x-axis ranges
- yaxis: str
- yranges()
Return y-axis ranges
- zranges()
Return data ranges
scinumtools.parameter_table module
- class scinumtools.parameter_table.ParameterSettings(settings)
Bases:
object
ParameterSettings class contain all settings of a parameter
- data()
- items()
- keys()
- class scinumtools.parameter_table.ParameterTable(settings: list, parameters: list | dict | None = None, keys: bool = False, keyname: str = '#')
Bases:
object
ParameterDict class collects parameters in a concise form and create a dictionary
- append(*args)
- data()
- items()
- keys()
- shape()
- to_dataframe()
- to_text(**kwargs)
scinumtools.progress_bar module
scinumtools.row_collector module
- class scinumtools.row_collector.RowCollector(columns: list | dict = [], rows: list | None = None, array: bool = False)
Bases:
object
RowCollector class collect table rows and transform them into one of available formats
Example of use:
import scinumtools as snt with snt.structs.RowCollector(['col1','col2','col3']) as rc: rc.append([1,2,3]) rc.append([4,5,6]) data = rc.to_dict()
- Parameters:
columns – This can be either a list of column names or a dictionary with column array settings
array (bool) – Stores values as numpy arrays if ‘True’, otherwise store data in lists
- append(values: list | dict)
Append a single row
- Parameters:
values – List of values for each column
- shape()
- size()
Get number of items in columns
- sort(name: str, reverse=False)
Sort all columns according to one
- Parameters:
name (str) – name of the sorting column
- to_csv(file_name: str, **kwargs)
Save class data as a CSV formatted file
- Parameters:
str (file_name) – Name of the new file
- to_dataframe(columns: list | dict | None = None)
Convert class data to a pandas data frame
- Parameters:
columns – This can be either a list of columns or a dictionary of column:title pairs. If not set, all coumns are being taken.
- to_dict(transpose: str | None = None)
Convert class data to a dictionary of lists/arrays
- to_file(file_name: str, **kwargs)
Save tabulated class data as a text file
- Parameters:
str (file_name) – Name of the new file
- to_text(**kwargs)
Convert class data to a text using pandas dataframe
- Parameters:
kwargs – kwargs of DataFrame’s to_string() method
scinumtools.stopwatch module
- class scinumtools.stopwatch.Stopwatch
Bases:
object
Helper class that measures time of various processes in the code
All nodes have to be closed in an oposite order as started.
- observer(name: str)
Start an observer
- Parameters:
name (str) – Name of a node
- report()
Print time report for all nodes
- start(name: str)
Start a new measuring node
- Parameters:
name (str) – Name of a node
- stop(name: str)
Stop existing node
- Parameters:
name (str) – Name of a node
scinumtools.thumbnail_image module
- class scinumtools.thumbnail_image.ThumbnailImage(data, extent: list | None = None, mode=None)
Bases:
object
Create a thumbnail from an image
- Parameters:
data – Image data array or a file name string
extent (tuple) – Extent of an image (xmin, xmax, ymin, ymax)
mode (str) – Image mode F/RGB/RGBA
- crop(left: float | tuple, right: float | None = None, bottom: float | None = None, top: float | None = None, bgcolor=0)
Change image extent
- Parameters:
left – Tuple with an image extent, or left extent
right (float) – Right extent
bottom (float) – Bottom extent
top (float) – Top extent
bgcolor – Color of the thumbnail padding (float or a tuple)
- draw(ax=None, **kwargs)
Draw current image on an axis
- Parameters:
ax – Matplotlib axis
- extent: list
- im: <module 'PIL.Image' from '/home/runner/.local/lib/python3.10/site-packages/PIL/Image.py'> = None
- resize(xres: int | None = None, yres: int | None = None)
Change image resolution
- Parameters:
xres (int) – Resolution on the X-axis
yres (int) – Resolution on the Y-axis
- save(file_name: str, format: str | None = None)
Save thumbnail as a file
- Parameters:
file_name (str) – Name of the image file