resistics.common.print module¶
-
resistics.common.print.
arrayToString
(data: numpy.ndarray, tabs: bool = False, decimals: int = 8) → str[source]¶ Convert an array to a string separated by commas
- Parameters
- datanp.ndarray
Data array
- tabsbool, optional
Bool flag for using tabs instead of commas
- decimalsint, optional
Number of decimal places to print
- Returns
- outstr
Output string
-
resistics.common.print.
arrayToStringInt
(data: numpy.ndarray) → str[source]¶ Convert an array to a string of integers numbers separated by commas
- Parameters
- datanp.ndarray
Data array
- Returns
- outstr
Output string
-
resistics.common.print.
arrayToStringSci
(data: numpy.ndarray) → str[source]¶ Convert an array to a string of scientific numbers separated by commas
- Parameters
- datanp.ndarray
Data array
- Returns
- outstr
Output string
-
resistics.common.print.
blockPrint
(pre: str, text: Union[List, str]) → None[source]¶ Prints a block of information to the terminal with separators
- Parameters
- prestr
String describing where the information is being output from
- textstr, List
Information string or a list of strings to print out in the black
-
resistics.common.print.
breakComment
() → str[source]¶ Returns a string to show a break in data comments
- Returns
- str
A separator string
-
resistics.common.print.
breakPrint
() → None[source]¶ Prints a break in the terminal to make things easier to read
-
resistics.common.print.
errorPrint
(pre: str, info: str, quitRun: bool = False)[source]¶ Print an error
- Parameters
- prestr
String describing where the information is being output from
- infostr
Information string
- quitRunbool, optional
Bool flag for quitting execution of the code due to the error
-
resistics.common.print.
generalPrint
(pre: str, info: str) → None[source]¶ Print to terminal
- Parameters
- prestr
String describing where the information is being output from
- infostr
Information string
-
resistics.common.print.
list2ranges
(data: Union[List, Set])[source]¶ Convert a list of numbers to a list of ranges
For example, the list [1, 2, 3, 4, 6, 8, 10, 12, 15, 18, 21, 24, 26, 35, 40, 45] becomes “1-4:1,6-12:2,15-24:3,26,35-45:5”
- Parameters
- datalist, set
List or set of numbers
- Returns
- outstr
Output string
-
resistics.common.print.
list2rangesFormatter
(start: Union[int, str], end: Union[int, str], step: Union[int, str]) → str[source]¶ A string for showing a range as shown below
1-5:1 represents 1,2,3,4,5 2-10:2 represents 2,4,6,8,10
- Parameters
- startint
Start point
- endint
End point
- stepint
Step
- Returns
- outstr
Output string