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
Mix-in for DataArray subclasses, that may be averaged based on populations of conformers. |
|
|
Special kind of data array for band values, to which spectral data or activities corespond. |
|
For handling data of |
|
Base class for data holding objects. |
|
For handling electronic spectral activity data. |
|
For handling electronic data that is not a spectral activity. |
|
For handling data about the energy of conformers. |
|
Special case of |
|
For handling data of |
|
For handling information about geometry of conformers. |
|
For handling data of |
|
For handling data of |
|
For handling scattering spectral activity data. |
|
For handling scattering data that is not a spectral activity. |
|
Base class for spectral activities genres. |
|
Base class for spectral data genres, that are not spectral activities. |
|
For handling information about electronic transitions from ground to excited state contributing to each band. |
|
For handling electronic spectral activity data. |
|
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
ArrayPropertyfor 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
inttype.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
ArrayPropertyfor 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
floattype.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
ArrayPropertyfor 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
strtype.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
ArrayPropertyfor 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:
(optionally) sanitized with user-provided sanitizer function;
(optionally) compared with another array-like attribute of the owner regarding their shape;
transformed to
numpy.ndarrayof desired data type;stored in owner’s
__dict__.
Setting, getting and deletition of the value may be customized using standard
setter,getteranddeleterdecorators. Additionally,ArrayPropertyprovides anArrayProperty.sanitizerdecorator. 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,
InconsistentDataErroris raised.Value is always transformed to
numpy.ndarrayof specified dtype (floatby default.) If such conversion cannot be done because value is a jagged array,InconsistentDataErrorwill be raised. However, if owner allows for data inconsistency by definingowner.allow_data_inconsistency = True, non-matching shapes will be ignored and jugged arrays will be padded with fill_value and stored asnumpy.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
booltype.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
ArrayPropertyfor 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
populationsandgenreattributes, 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
- 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
ArrayPropertyfor 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:
freqorwavelenshould be overridden with a concrete setter and getter - use ofArrayPropertyis recommended. The other one may use implementation from this base class by call tosuper().freqorsuper().wavelento 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
ArrayPropertyfor 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
wavelenis provided, this may be overridden with a simple call tosuper():@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
freqis provided, this may be overridden with a simple call tosuper():@property def wavelen(self): return super().wavelen() # values converted to nm
- 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
ArrayPropetyfor 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.
- 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
ArrayPropetyfor 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.
- 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
ArrayPropertyfor 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
wavelenis provided, this may be overridden with a simple call tosuper():@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.
- 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
ArrayPropertyfor 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
populationsandgenreattributes, 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
- 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
wavelenis provided, this may be overridden with a simple call tosuper():@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”.
- 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
ArrayPropetyfor details).
- average_conformers(energies) tesliper.glassware.arrays.DataArray
A method for averaging values by population of conformers.
- Parameters
energies (Energies or iterable) – Object with
populationsandgenreattributes, 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
- 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
- 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.
- 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
ArrayPropetyfor 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
populationsandgenreattributes, 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
- 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
- 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.
- 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
ArrayPropertyfor 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
- 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
populationsandgenreattributes, 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
- 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
wavelenis provided, this may be overridden with a simple call tosuper():@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”.
- 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, andvalues, 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
ArrayPropetyfor 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
ArrayPropetyfor 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.