def __init__(self, from_path, to_path, from_format, to_format, spectrum_name, plsplit=None, noise_generator=None, nmrstar_version="3"):
        """StarFileToPeakList initializer.

        :param str from_path: Path to input file(s).
        :param str to_path: Path to output file(s).
        :param str from_format: Input format: `nmrstar` or `json`.
        :param str to_format: Output format: `json` or `sparky`.
        :param str spectrum_name: Name of spectrum from which to simulate peak list.
        :param tuple plsplit: How to split peak list in order to account for multiple sources of variance.
        :param str nmrstar_version: Version of NMR-STAR format to use for look up chemical shifts loop.
        :param noise_generator: Subclasses of :class:`~nmrstarlib.noise.NoiseGenerator` object.
        :type noise_generator: :class:`~nmrstarlib.noise.NoiseGenerator`
        """
        super(StarFileToPeakList, self).__init__(from_path, to_path, from_format, to_format)

        if plsplit is None:
            plsplit = (100,)

        if all(0 <= i <= 1 for i in plsplit):
            plsplit = tuple(i*100 for i in plsplit)
        elif all(0 <= i <= 100 for i in plsplit):
            plsplit = tuple(i for i in plsplit)
        else:
            raise ValueError("All percentages must be in interval from 0 to 1 or from 0 % to 100 %.")

        if sum(plsplit) == 100:
            pass
        else:
            raise ValueError('"plsplit" percentages must sum up to 100%, current sum is {}%'.format(sum(plsplit)))

        if noise_generator is not None:
            for param_name, param_values in noise_generator.parameters.items():
                if len(param_values) == len(plsplit):
                    continue
                else:
                    raise ValueError('Length of noise values of "{}" parameter must be equal to length of peak list split.'.format(param_name))

        self.plsplit = plsplit
        self.noise_generator = noise_generator
        self.spectrum = self.create_spectrum(spectrum_name)
        self.nmrstar_version = nmrstar_version
def __init__ ( self , from_path , to_path , from_format , to_format , spectrum_name , plsplit = None , noise_generator = None , nmrstar_version = "3" ) : super ( StarFileToPeakList , self ) . __init__ ( from_path , to_path , from_format , to_format ) if plsplit is None : plsplit = ( 100 , ) if all ( 0 <= i <= 1 for i in plsplit ) : plsplit = tuple ( i * 100 for i in plsplit ) elif all ( 0 <= i <= 100 for i in plsplit ) : plsplit = tuple ( i for i in plsplit ) else : raise ValueError ( "All percentages must be in interval from 0 to 1 or from 0 % to 100 %." ) if sum ( plsplit ) == 100 : pass else : raise ValueError ( '"plsplit" percentages must sum up to 100%, current sum is {}%' . format ( sum ( plsplit ) ) ) if noise_generator is not None : for param_name , param_values in noise_generator . parameters . items ( ) : if len ( param_values ) == len ( plsplit ) : continue else : raise ValueError ( 'Length of noise values of "{}" parameter must be equal to length of peak list split.' . format ( param_name ) ) self . plsplit = plsplit self . noise_generator = noise_generator self . spectrum = self . create_spectrum ( spectrum_name ) self . nmrstar_version = nmrstar_version
StarFileToPeakList initializer.

        :param str from_path: Path to input file(s).
        :param str to_path: Path to output file(s).
        :param str from_format: Input format: `nmrstar` or `json`.
        :param str to_format: Output format: `json` or `sparky`.
        :param str spectrum_name: Name of spectrum from which to simulate peak list.
        :param tuple plsplit: How to split peak list in order to account for multiple sources of variance.
        :param str nmrstar_version: Version of NMR-STAR format to use for look up chemical shifts loop.
        :param noise_generator: Subclasses of :class:`~nmrstarlib.noise.NoiseGenerator` object.
        :type noise_generator: :class:`~nmrstarlib.noise.NoiseGenerator`