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.Reprwith 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
NDReprinstance attributes. AnAttributeErroris 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
floatdecimals. 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.ndarrayrow. Passed as argument to thenumpy.printoptions()function:threshold = self.maxndarrayedgeitems = self.maxndarray // 2
See also
NDRepr.repr_ndarray().- Type:
- maxSeries
The maximum number of rows per
pandas.Seriesinstance. 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.DataFrameinstance. Passed as values topandas.options.display:pandas.options.display.max_rows = self.maxdataframepandas.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
strrepresentation of an :exc`Exception` instance.
- NDRepr.repr_method(obj: builtins.method, level: int) str[source]
Create a
strrepresentation of a bound method.
- NDRepr.repr_method_descriptor(obj: builtins.method_descriptor, level: int) str[source]
Create a
strrepresentation of an unbound method.
- NDRepr.repr_function(obj: builtins.function, level: int) str[source]
Create a
strrepresentation of a function.
- NDRepr.repr_builtin_function_or_method(obj: builtins.builtin_function_or_method, level: int) str[source]
Create a
strrepresentation of a builtin function or method.
- NDRepr.repr_module(obj: builtins.module, level: int) str[source]
Create a
strrepresentation of a module.
- NDRepr.repr_dict_values(obj: ValuesView[Any], level: int) str[source]
Create a
strrepresentation of aValuesView.
- NDRepr.repr_Molecule(obj: scm.plams.mol.molecule.Molecule, level: int) str[source]
Create a
strrepresentation of aplams.Moleculeinstance.
- NDRepr.repr_Settings(obj: scm.plams.core.settings.Settings, level: int) str[source]
Create a
strrepresentation of aplams.Settingsinstance.
- NDRepr.repr_Atom(obj: scm.plams.mol.molecule.Atom, level: int) str[source]
Create a
strrepresentation of aplams.Atominstance.
- NDRepr.repr_Bond(obj: scm.plams.mol.molecule.Bond, level: int) str[source]
Create a
strrepresentation of aplams.Bondinstance.
- NDRepr.repr_ndarray(obj: ndarray[Any, Any], level: int) str[source]
Create a
strrepresentation of anumpy.ndarrayinstance.
- NDRepr.repr_DataFrame(obj: pandas.core.frame.DataFrame, level: int) str[source]
Create a
strrepresentation of apandas.DataFrameinstance.
- NDRepr.repr_Series(obj: pandas.core.series.Series, level: int) str[source]
Create a
strrepresentation of apandas.Seriesinstance.