tesliper.glassware.arrays

Implements DataArray-like objects for handling arrayed data.

DataArray-like objects are concrete implementations of ArrayBase base class that collect specific data for multiple conformers and provide an easy access to genre-specific functionality. Instances of DataArray subclasses are produced by the Conformers.arrayed() method and Tesliper’s subscription mechanism.

Classes

Averagable()

Mix-in for DataArray subclasses, that may be averaged based on populations of conformers.

Bands(genre, filenames, values[, ...])

Special kind of data array for band values, to which spectral data or activities corespond.

BooleanArray(genre, filenames, values[, ...])

For handling data of bool type.

DataArray(genre, filenames, values[, ...])

Base class for data holding objects.

ElectronicActivities(genre, filenames, ...)

For handling electronic spectral activity data.

ElectronicData(genre, filenames, values, wavelen)

For handling electronic data that is not a spectral activity.

Energies(genre, filenames, values[, t, ...])

For handling data about the energy of conformers.

FilenamesArray([genre, filenames, values, ...])

Special case of DataArray, holds only filenames.

FloatArray(genre, filenames, values[, ...])

For handling data of float type.

Geometry(genre, filenames, values, atoms[, ...])

For handling information about geometry of conformers.

InfoArray(genre, filenames, values[, ...])

For handling data of str type.

IntegerArray(genre, filenames, values[, ...])

For handling data of int type.

ScatteringActivities(genre, filenames, ...)

For handling scattering spectral activity data.

ScatteringData(genre, filenames, values, freq)

For handling scattering data that is not a spectral activity.

SpectralActivities(genre, filenames, values)

Base class for spectral activities genres.

SpectralData(genre, filenames, values[, ...])

Base class for spectral data genres, that are not spectral activities.

Transitions(genre, filenames, values[, ...])

For handling information about electronic transitions from ground to excited state contributing to each band.

VibrationalActivities(genre, filenames, ...)

For handling electronic spectral activity data.

VibrationalData(genre, filenames, values, freq)

For handling vibrational data that is not a spectral activity.

class tesliper.glassware.arrays.DataArray(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

Base class for data holding objects.

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.IntegerArray(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

For handling data of int type.

Genres associated with this class:

charge

multiplicity

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.FloatArray(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

For handling data of float type.

Genres associated with this class:

zpecorr

tencorr

entcorr

gibcorr

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.InfoArray(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

For handling data of str type.

Genres associated with this class:

command

stoichiometry

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.FilenamesArray(genre: str = 'filenames', filenames: Union[Sequence, numpy.ndarray] = (), values: Optional[Any] = None, allow_data_inconsistency: bool = False)[source]

Special case of DataArray, holds only filenames. values property returns same as filenames and ignores any value given to its setter. Only genre associated with this class is filenames pseudo-genre.

Parameters
  • genre (str) – Name of genre, should be ‘filenames’.

  • filenames (numpy.ndarray(dtype=str)) – List of filenames of gaussian output files, from which data were extracted.

  • values (numpy.ndarray(dtype=str)) – Always returns same as filenames.

property values

Property, that validates array-like value given to its setter and stores it as numpy.ndarray.

Value given to property setter is:

  1. (optionally) sanitized with user-provided sanitizer function;

  2. (optionally) compared with another array-like attribute of the owner regarding their shape;

  3. transformed to numpy.ndarray of desired data type;

  4. stored in owner’s __dict__.

Setting, getting and deletition of the value may be customized using standard setter, getter and deleter decorators. Additionally, ArrayProperty provides an ArrayProperty.sanitizer decorator. If sanitizer function is provided, it is called as a first step of data validation and should return sanitized array-like value (given original value as a positional parameter).

Validation regarding shape of the value is triggered if check_against parameter is provided. It should be a name of owner’s other array-like attribute as a string. Shape of the value is than compared to the shape of this reference attribute. If shapes are not identical up to the first check_depth dimensions, InconsistentDataError is raised.

Value is always transformed to numpy.ndarray of specified dtype (float by default.) If such conversion cannot be done because value is a jagged array, InconsistentDataError will be raised. However, if owner allows for data inconsistency by defining owner.allow_data_inconsistency = True, non-matching shapes will be ignored and jugged arrays will be padded with fill_value and stored as numpy.ma.masked_array.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.BooleanArray(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

For handling data of bool type.

Genres associated with this class:

normal_termination

optimization_completed

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.Energies(genre, filenames, values, t=298.15, allow_data_inconsistency=False)[source]

For handling data about the energy of conformers.

Genres associated with this class:

scf

zpe

ten

ent

gib

Parameters
  • genre (str) – genre of energy.

  • filenames (numpy.ndarray(dtype=str)) – List of filenames of gaussian output files, from which data were extracted.

  • values (numpy.ndarray(dtype=float)) – Energy value for each conformer.

  • t (int or float) – Temperature of calculated state in K.

property as_kcal_per_mol

Energy values converted to kcal/mol.

property deltas

Calculates energy difference between each conformer and lowest energy conformer. Converts energy to kcal/mol.

Returns

List of energy differences from lowest energy in kcal/mol.

Return type

numpy.ndarray

property min_factors

Calculates list of conformers’ Boltzmann factors respective to lowest energy conformer in system.

Notes

Boltzmann factor of two states is defined as: F(state_1)/F(state_2) = exp((E_1 - E_2)/kt) where E_1 and E_2 are energies of states 1 and 2, k is Boltzmann constant, k = 0.0019872041 kcal/(mol*K), and t is temperature of the system.

Returns

List of conformers’ Boltzmann factors respective to lowest energy conformer.

Return type

numpy.ndarary

property populations

Calculates Boltzmann distribution of conformers.

Returns

List of conformers populations calculated as Boltzmann distribution.

Return type

numpy.ndarary

calculate_populations(t)[source]

Calculates conformers’ Boltzmann distribution in given temperature.

Parameters

t (int or float) – Temperature of calculated state in K.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.Averagable[source]

Mix-in for DataArray subclasses, that may be averaged based on populations of conformers.

average_conformers(energies) tesliper.glassware.arrays.DataArray[source]

A method for averaging values by population of conformers.

Parameters

energies (Energies or iterable) – Object with populations and genre attributes, containing respectively: list of populations values as numpy.ndarray and string specifying energy type. Alternatively, list of weights for each conformer.

Returns

New instance of DataArray’s subclass, on which average method was called, containing averaged values.

Return type

DataArray

Raises

TypeError – If creation of an instance based on its __init__ signature is impossible.

class tesliper.glassware.arrays.Bands(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

Special kind of data array for band values, to which spectral data or activities corespond. Provides an easy way to convert values between their different representations: frequency, wavelength, and excitation energy.

Genres associated with this class:

freq

wavelen

ex_en

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

property freq

Values converted to frequencies in \(\mathrm{cm}^{-1}\).

property frequencies

Values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for Bands.frequencies.

property wavelen

Values converted to wavelengths in nm.

property wavelengths

Values converted to wavelengths in nm. A convenience alias for Bands.wavelen.

property ex_en

Values converted to excitation energy in eV.

property excitation_energy

Values converted to excitation energy in eV. A convenience alias for Bands.ex_en.

property imaginary

Finds number of imaginary frequencies of each conformer.

Returns

Number of imaginary frequencies of each conformer.

Return type

numpy.ndarray

find_imaginary()[source]

Reports number of imaginary frequencies of each conformer that has any.

Returns

Dictionary of {filename: number-of-imaginary-frequencies} for each conformer with at least one imaginary frequency.

Return type

dict

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.SpectralData(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

Base class for spectral data genres, that are not spectral activities.

When subclassed, one of the attributes: freq or wavelen should be overridden with a concrete setter and getter - use of ArrayProperty is recommended. The other one may use implementation from this base class by call to super().freq or super().wavelen to get converted values.

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

abstract property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

abstract property freq

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). If wavelen is provided, this may be overridden with a simple call to super():

@property
def freq(self):
    return super().freq()  # values converted to cm^(-1)
property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

abstract property wavelen

Bands values converted to wavelengths in nm. If freq is provided, this may be overridden with a simple call to super():

@property
def wavelen(self):
    return super().wavelen()  # values converted to nm
property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.VibrationalData(genre, filenames, values, freq, allow_data_inconsistency=False)[source]

For handling vibrational data that is not a spectral activity.

Genres associated with this class:

mass

frc

emang

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • freq – Frequency for each value in each conformer in \(\mathrm{cm}^{-1}\) units.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayPropety for details).

property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

property wavelen

Bands values converted to wavelengths in nm.

property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.ScatteringData(genre, filenames, values, freq, t=298.15, laser=532, allow_data_inconsistency=False)[source]

For handling scattering data that is not a spectral activity.

Genres associated with this class:

depolarp

depolaru

depp

depu

alpha2

beta2

alphag

gamma2

delta2

cid1

cid2

cid3

rc180

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • freq – Frequency for each value in each conformer in \(\mathrm{cm}^{-1}\) units.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayPropety for details).

property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

property wavelen

Bands values converted to wavelengths in nm.

property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.ElectronicData(genre, filenames, values, wavelen, allow_data_inconsistency=False)[source]

For handling electronic data that is not a spectral activity.

Genres associated with this class:

eemang

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

property freq

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). If wavelen is provided, this may be overridden with a simple call to super():

@property
def freq(self):
    return super().freq()  # values converted to cm^(-1)
property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.SpectralActivities(genre: str, filenames: Sequence[str], values: Sequence, allow_data_inconsistency: bool = False)[source]

Base class for spectral activities genres.

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

property intensities

Converts spectral activity calculated by quantum chemistry software to signal intensity.

Returns

Signal intensities for each conformer.

Return type

numpy.ndarray

Raises

NotImplementedError – if genre does not provide values conversion to intensities.

average_conformers(energies) tesliper.glassware.arrays.DataArray

A method for averaging values by population of conformers.

Parameters

energies (Energies or iterable) – Object with populations and genre attributes, containing respectively: list of populations values as numpy.ndarray and string specifying energy type. Alternatively, list of weights for each conformer.

Returns

New instance of DataArray’s subclass, on which average method was called, containing averaged values.

Return type

DataArray

Raises

TypeError – If creation of an instance based on its __init__ signature is impossible.

abstract property freq

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). If wavelen is provided, this may be overridden with a simple call to super():

@property
def freq(self):
    return super().freq()  # values converted to cm^(-1)
property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

abstract property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

abstract property wavelen

Bands values converted to wavelengths in nm. If freq is provided, this may be overridden with a simple call to super():

@property
def wavelen(self):
    return super().wavelen()  # values converted to nm
property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.VibrationalActivities(genre, filenames, values, freq, allow_data_inconsistency=False)[source]

For handling electronic spectral activity data.

Genres associated with this class:

iri

dip

rot

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • freq – Frequency for each value in each conformer in \(\mathrm{cm}^{-1}\) units.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayPropety for details).

average_conformers(energies) tesliper.glassware.arrays.DataArray

A method for averaging values by population of conformers.

Parameters

energies (Energies or iterable) – Object with populations and genre attributes, containing respectively: list of populations values as numpy.ndarray and string specifying energy type. Alternatively, list of weights for each conformer.

Returns

New instance of DataArray’s subclass, on which average method was called, containing averaged values.

Return type

DataArray

Raises

TypeError – If creation of an instance based on its __init__ signature is impossible.

calculate_spectra(start, stop, step, width, fitting)

Calculates spectrum for each individual conformer.

Parameters
  • start (int or float) – Number representing start of spectral range in relevant units.

  • stop (int or float) – Number representing end of spectral range in relevant units.

  • step (int or float) – Number representing step of spectral range in relevant units.

  • width (int or float) – Number representing half width of maximum peak height.

  • fitting (function) – Function, which takes spectral data, freqs, abscissa, width as parameters and returns numpy.array of calculated, non-corrected spectrum points.

Returns

Calculated spectrum.

Return type

SingleSpectrum

Raises

ValueError – If given start, stop, and step values would produce an empty or one-element sequence; i.e. if start is grater than stop or if start - stop < step, assuming step is a positive value.

property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

property intensities

Converts spectral activity calculated by quantum chemistry software to signal intensity.

Returns

Signal intensities for each conformer.

Return type

numpy.ndarray

Raises

NotImplementedError – if genre does not provide values conversion to intensities.

property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

property wavelen

Bands values converted to wavelengths in nm.

property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.ScatteringActivities(genre, filenames, values, freq, t=298.15, laser=532, allow_data_inconsistency=False)[source]

For handling scattering spectral activity data.

Genres associated with this class:

ramanactiv

ramact

raman1

roa1

raman2

roa2

raman3

roa3

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • freq – Frequency for each value in each conformer in \(\mathrm{cm}^{-1}\) units.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayPropety for details).

property intensities

Converts spectral activity calculated by quantum chemistry software to signal intensity.

Returns

Signal intensities for each conformer.

Return type

numpy.ndarray

Raises

NotImplementedError – if genre does not provide values conversion to intensities.

average_conformers(energies) tesliper.glassware.arrays.DataArray

A method for averaging values by population of conformers.

Parameters

energies (Energies or iterable) – Object with populations and genre attributes, containing respectively: list of populations values as numpy.ndarray and string specifying energy type. Alternatively, list of weights for each conformer.

Returns

New instance of DataArray’s subclass, on which average method was called, containing averaged values.

Return type

DataArray

Raises

TypeError – If creation of an instance based on its __init__ signature is impossible.

calculate_spectra(start, stop, step, width, fitting)

Calculates spectrum for each individual conformer.

Parameters
  • start (int or float) – Number representing start of spectral range in relevant units.

  • stop (int or float) – Number representing end of spectral range in relevant units.

  • step (int or float) – Number representing step of spectral range in relevant units.

  • width (int or float) – Number representing half width of maximum peak height.

  • fitting (function) – Function, which takes spectral data, freqs, abscissa, width as parameters and returns numpy.array of calculated, non-corrected spectrum points.

Returns

Calculated spectrum.

Return type

SingleSpectrum

Raises

ValueError – If given start, stop, and step values would produce an empty or one-element sequence; i.e. if start is grater than stop or if start - stop < step, assuming step is a positive value.

property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

property wavelen

Bands values converted to wavelengths in nm.

property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.ElectronicActivities(genre, filenames, values, wavelen, allow_data_inconsistency=False)[source]

For handling electronic spectral activity data.

Genres associated with this class:

vdip

ldip

vrot

lrot

vosc

losc

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – Sequence of values for genre for each conformer in filenames.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayProperty for details).

property intensities

Converts spectral activity calculated by quantum chemistry software to signal intensity.

Returns

Signal intensities for each conformer.

Return type

numpy.ndarray

Raises

NotImplementedError – if genre does not provide values conversion to intensities.

calculate_spectra(start, stop, step, width, fitting)[source]

Calculates spectrum for each individual conformer.

Parameters
  • start (int or float) – Number representing start of spectral range in relevant units.

  • stop (int or float) – Number representing end of spectral range in relevant units.

  • step (int or float) – Number representing step of spectral range in relevant units.

  • width (int or float) – Number representing half width of maximum peak height.

  • fitting (function) – Function, which takes spectral data, freqs, abscissa, width as parameters and returns numpy.array of calculated, non-corrected spectrum points.

Returns

Calculated spectrum.

Return type

SingleSpectrum

Raises

ValueError – If given start, stop, and step values would produce an empty or one-element sequence; i.e. if start is grater than stop or if start - stop < step, assuming step is a positive value.

average_conformers(energies) tesliper.glassware.arrays.DataArray

A method for averaging values by population of conformers.

Parameters

energies (Energies or iterable) – Object with populations and genre attributes, containing respectively: list of populations values as numpy.ndarray and string specifying energy type. Alternatively, list of weights for each conformer.

Returns

New instance of DataArray’s subclass, on which average method was called, containing averaged values.

Return type

DataArray

Raises

TypeError – If creation of an instance based on its __init__ signature is impossible.

property freq

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). If wavelen is provided, this may be overridden with a simple call to super():

@property
def freq(self):
    return super().freq()  # values converted to cm^(-1)
property frequencies

Bands values converted to frequencies in \(\mathrm{cm}^{-1}\). A convenience alias for freq.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

property spectra_type

Type of spectra, that genres associated with SpectralData’s subclass relate to. Should be a class-level attribute with value of either “vibrational”, “electronic”, or “scattering”.

property wavelengths

Bands values converted to wavelengths in nm. A convenience alias for wavelen.

class tesliper.glassware.arrays.Transitions(genre: str, filenames: Sequence[str], values: Sequence[Sequence[Sequence[Tuple[int, int, float]]]], allow_data_inconsistency: bool = False)[source]

For handling information about electronic transitions from ground to excited state contributing to each band.

Data is stored in three attributes: ground, excited, and values, which are respectively: list of ground state electronic subshells, list of excited state electronic subshells, and list of coefficients of transitions from corresponding ground to excited subshell. Each of these arrays is of shape (conformers, bands, max_transitions), where ‘max_transitions’ is a highest number of transitions contributing to single band across all bands of all conformers.

Genres associated with this class:

transitions

values

List of coefficients of each transition. It is a 3-dimensional of shape (conformers, bands, max_transitions).

Type

numpy.ndarray(dtype=float)

ground

List of ground state electronic subshells, stored as integers assigned to them by used quantum computations program. It is a 3-dimensional array of shape (conformers, bands, max_transitions).

Type

numpy.ndarray(dtype=int)

excited

List of excited state electronic subshells, stored as integers assigned to them by used quantum computations program. It is a 3-dimensional array of shape (conformers, bands, max_transitions).

Type

numpy.ndarray(dtype=int)

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values (list of lists of lists of tuples of (int, int, float)) – Transitions data (ground and excited state electronic subshell and coefficient of transition from former to latter) for each transition of each band of each conformer.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayPropety for details).

static unpack_values(values: Sequence[Sequence[Sequence[Tuple[int, int, float]]]])[source]

Unpack transitions data stored as list of tuples of (ground, excited, coefficient) to separate lists for each information pice, keeping original dimensionality (conformers, bands, transitions).

Parameters

values (list of lists of lists of tuples of (int, int, float)) – Transitions data (ground and excited state electronic subshell and coefficient of transition from former to latter) for each transition of each band of each conformer.

Returns

  • list of lists of lists of int,

  • list of lists of lists of int,

  • list of lists of lists of float – Transitions data separated to lists of ground, excited, and coefficients, for each transition of each band of each conformer.

property coefficients: numpy.ndarray

Coefficients of each transition, alias for values.

property contribution: numpy.ndarray

Contribution of each transition to given band, calculated as 2 * coef^2. To get values in percent, multiply by 100.

property indices_highest: Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]

Indices of coefficients of highest contribution to band in form that can be used in numpy’s advanced indexing mechanism.

property highest_contribution: Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]

Electronic transitions data limited to transition of highest contribution to each band. Returns tuple with 4 arrays: ground and excited state electronic subshell, coefficient of transition from former to latter, and its contribution, for each band of each conformer.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter]]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

class tesliper.glassware.arrays.Geometry(genre: str, filenames: Sequence[str], values: Sequence[Sequence[Sequence[float]]], atoms: Union[Sequence[Union[int, str]], Sequence[Sequence[Union[int, str]]]], allow_data_inconsistency: bool = False)[source]

For handling information about geometry of conformers.

Genres associated with this class:

last_read_geom

input_geom

optimized_geom

Parameters
  • genre – Name of the data genre that values represent.

  • filenames – Sequence of conformers’ identifiers.

  • values – List of x, y, z coordinated for each conformer, for each atom.

  • allow_data_inconsistency – Flag signalizing if instance should allow data inconsistency (see ArrayPropety for details). False by default.

  • atoms – List of atomic numbers representing atoms in conformer, one for each coordinate. Should be a list of integers or list of strings, that can be interpreted as integers or symbols of atoms. May also be a list of such lists - one list of atoms for each conformer. All those lists should be identical in such case, otherwise InconsistentDataError is raised. Only one list of atoms is stored in either case.

get_repr_args() Dict[str, Any]

Returns dictionary that can be used as keword-value pairs to instantiate identical object.

classmethod get_init_params() Dict[str, Union[str, inspect.Parameter, tesliper.glassware.array_base.DependentParameter]][source]

Returns parameters used to instantiate this class. genre is a genre of data array that is to be instantiated.