assertionlib.ndrepr
A module for holding the NDRepr
class, a subclass of the builtin reprlib.Repr
class.
Index
|
A subclass of |
Type-specific repr methods:
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
|
Create a |
API
- class assertionlib.ndrepr.NDRepr(**kwargs: int | Mapping[str, Any])[source]
A subclass of
reprlib.Repr
with methods for handling additional object types.Has additional methods for handling:
PLAMS Molecules, Atoms, Bonds and Settings
NumPy arrays
Pandas Series and DataFrames
Callables
- Parameters:
**kwargs (object) – User-specified values for one or more
NDRepr
instance attributes. AnAttributeError
is raised upon encountering unrecognized keys.
- maxSignature
The maximum length of callables’ signatures before further parameters are truncated. See also
NDRepr.repr_Signature()
.- Type:
- maxfloat
The number of to-be displayed
float
decimals. See alsoNDRepr.repr_float()
.- Type:
- maxMolecule
The maximum number of to-be displayed atoms and bonds in PLAMS molecules. See also
NDRepr.repr_Molecule()
.- Type:
- maxndarray
The maximum number of items in a
numpy.ndarray
row. Passed as argument to thenumpy.printoptions()
function:threshold = self.maxndarray
edgeitems = self.maxndarray // 2
See also
NDRepr.repr_ndarray()
.- Type:
- maxSeries
The maximum number of rows per
pandas.Series
instance. Passed as value topandas.options.display
.pandas.options.display.max_rows = self.series
See also
NDRepr.repr_Series()
.- Type:
- maxDataFrame
The maximum number of rows per
pandas.DataFrame
instance. Passed as values topandas.options.display
:pandas.options.display.max_rows = self.maxdataframe
pandas.options.display.max_columns = self.maxdataframe // 2
See also
NDRepr.repr_DataFrame()
.- Type:
- np_printoptions
Additional keyword arguments for
numpy.printoptions()
.Note
Arguments provided herein will take priority over those specified internally in
NDRepr.repr_ndarray()
.- Type:
- pd_printoptions
Additional “keyword arguments” for
pandas.options
.Note
Arguments provided herein will take priority over those specified internally in
NDRepr.repr_DataFrame()
andNDRepr.repr_Series()
.- Type:
- NDRepr.repr_Exception(obj: Exception, level: int) str [source]
Create a
str
representation of an :exc`Exception` instance.
- NDRepr.repr_method(obj: builtins.method, level: int) str [source]
Create a
str
representation of a bound method.
- NDRepr.repr_method_descriptor(obj: builtins.method_descriptor, level: int) str [source]
Create a
str
representation of an unbound method.
- NDRepr.repr_function(obj: builtins.function, level: int) str [source]
Create a
str
representation of a function.
- NDRepr.repr_builtin_function_or_method(obj: builtins.builtin_function_or_method, level: int) str [source]
Create a
str
representation of a builtin function or method.
- NDRepr.repr_module(obj: builtins.module, level: int) str [source]
Create a
str
representation of a module.
- NDRepr.repr_dict_values(obj: ValuesView[Any], level: int) str [source]
Create a
str
representation of aValuesView
.
- NDRepr.repr_Molecule(obj: scm.plams.mol.molecule.Molecule, level: int) str [source]
Create a
str
representation of aplams.Molecule
instance.
- NDRepr.repr_Settings(obj: scm.plams.core.settings.Settings, level: int) str [source]
Create a
str
representation of aplams.Settings
instance.
- NDRepr.repr_Atom(obj: scm.plams.mol.molecule.Atom, level: int) str [source]
Create a
str
representation of aplams.Atom
instance.
- NDRepr.repr_Bond(obj: scm.plams.mol.molecule.Bond, level: int) str [source]
Create a
str
representation of aplams.Bond
instance.
- NDRepr.repr_ndarray(obj: ndarray[Any, Any], level: int) str [source]
Create a
str
representation of anumpy.ndarray
instance.
- NDRepr.repr_DataFrame(obj: pandas.core.frame.DataFrame, level: int) str [source]
Create a
str
representation of apandas.DataFrame
instance.
- NDRepr.repr_Series(obj: pandas.core.series.Series, level: int) str [source]
Create a
str
representation of apandas.Series
instance.