We should add a TimeCrystal.compare function that takes in one or more TimeCrystal instances as inputs (i.e. either a single TimeCrystal object or a list of TimeCrystal objects). The function should:
Check to ensure that all of the inputted crystals have the same number of timepoints as self. If not, raise an exception
If self.corr is a list ("within" mode), check that all inputted crystals' corr attributes are also lists, and of the same length. Otherwise raise an exception.
If self.corr is a numpy array ("across" mode), check that all inputted crystals' corr attributes are also numpy arrays of the same dimensions. Otherwise raise an exception.
If "across" mode was used, return a numpy array (one column per inputted crysta, one row per timepoint) with correlations between each row of self.corrs and the corresponding row of each TimeCrystal object the user provides. (For "within" mode, return a list of numpy arrays)
Also consider a plot_it parameter that generates a nice looking plot. There could also be a labels parameter that allows the user to name the crystals. This could be used to make a nice legend.
We should add a
TimeCrystal.compare
function that takes in one or moreTimeCrystal
instances as inputs (i.e. either a singleTimeCrystal
object or alist
ofTimeCrystal
objects). The function should:self
. If not, raise an exceptionself.corr
is a list ("within" mode), check that all inputted crystals'corr
attributes are also lists, and of the same length. Otherwise raise an exception.self.corr
is a numpy array ("across" mode), check that all inputted crystals'corr
attributes are also numpy arrays of the same dimensions. Otherwise raise an exception.self.corrs
and the corresponding row of eachTimeCrystal
object the user provides. (For "within" mode, return a list of numpy arrays)plot_it
parameter that generates a nice looking plot. There could also be alabels
parameter that allows the user to name the crystals. This could be used to make a nice legend.