oscarbranson / latools

Tools for the reproducible reduction of LA-ICPMS data.
http://latools.readthedocs.io
MIT License
15 stars 10 forks source link

ValueError not raised when initializing analyse object #38

Closed sunwillrise closed 5 years ago

sunwillrise commented 5 years ago

Hello.

When initializing analyse object using latools.analyse(), ValueError is not raised even when the internal_standard is not in self.analytes.

This is because the code looks like

 if internal_standard in self.analytes:
            self.internal_standard = internal_standard
        else:
            ValueError('The internal standard ({}) is not amongst the'.format(internal_standard) +
                       'analytes in\nyour data files. Please make sure it is specified correctly.')

This should look like

 if internal_standard in self.analytes:
            self.internal_standard = internal_standard
        else:
            raise ValueError('The internal standard ({}) is not amongst the '.format(internal_standard) +
                       'analytes in\nyour data files. Please make sure it is specified correctly.')

**I think I'll soon make a pull request!

sunwillrise commented 5 years ago

I noticed this bug when I was working on the files produced (splitted) with long_file() function. Be aware that when you use the long_file() function, the name of the analyte is always renamed to "namemass" (i.e. Fe57) instead of "massname" (i.e. 57Fe) :)