# Path: cclib/method/calculationmethod.py
# class Method:
#     """Abstract base class for all cclib method classes.
# 
#     Subclasses defined by cclib:
#         CDA - charde decomposition analysis
#         CSPA - C-squared population analysis
#         Density - density matrix calculation
#         FragmentAnalysis - fragment analysis for ADF output
#         LPA - Löwdin population analysis
#         MBO - Mayer's bond orders
#         Moments - multipole moments calculations
#         MPA - Mulliken population analysis
#         Nuclear - properties of atomic nuclei
#         OPA - overlap population analysis
#         Population - base class for population analyses
#         Volume - volume/grid calculations
# 
#     All the modules containing methods should be importable.
#     """
#     required_attrs = ()
#     def __init__(self, data, progress=None, loglevel=logging.INFO, logname="Log"):
#         """Initialise the Logfile object.
# 
#         This constructor is typically called by the constructor of a subclass.
#         """
# 
#         self.data = data
#         self.progress = progress
#         self.loglevel = loglevel
#         self.logname = logname
#         self._check_required_attributes()
#         self.logger = logging.getLogger('%s %s' % (self.logname, self.data))
#         self.logger.setLevel(self.loglevel)
#         self.logformat = "[%(name)s %(levelname)s] %(message)s"
#         handler = logging.StreamHandler(sys.stdout)
#         handler.setFormatter(logging.Formatter(self.logformat))
#         self.logger.addHandler(handler)
# 
#     def _check_required_attributes(self):
#         """Check if required attributes are present in data."""
#         missing = [x for x in self.required_attrs
#                     if not hasattr(self.data, x)]
#         if missing:
#             missing = ' '.join(missing)
#             raise MissingAttributeError(
#                 'Could not parse required attributes to use method: ' + missing)


import logging
import numpy as np
    import periodictable as pt
    import scipy.constants
from cclib.method.calculationmethod import Method
from cclib.parser.utils import PeriodicTable
from cclib.parser.utils import find_package
        raise ImportError("You must install `scipy` to use this function")


def get_most_abundant_isotope(element):
    """Given a `periodictable` element, return the most abundant
    isotope.
    """
    most_abundant_isotope = element.isotopes[0]
    abundance = 0
    for iso in element:
        if iso.abundance > abundance:
            most_abundant_isotope = iso
            abundance = iso.abundance
    return most_abundant_isotope


def get_isotopic_masses(charges):
    """Return the masses for the given nuclei, respresented by their
    nuclear charges.
    """
    _check_periodictable(_found_periodictable)
    masses = []
    for charge in charges:
        el = pt.elements[charge]
        isotope = get_most_abundant_isotope(el)
        mass = isotope.mass
        masses.append(mass)
    return np.array(masses)



# Path: cclib/method/calculationmethod.py
# class Method:
#     """Abstract base class for all cclib method classes.
# 
#     Subclasses defined by cclib:
#         CDA - charde decomposition analysis
#         CSPA - C-squared population analysis
#         Density - density matrix calculation
#         FragmentAnalysis - fragment analysis for ADF output
#         LPA - Löwdin population analysis
#         MBO - Mayer's bond orders
#         Moments - multipole moments calculations
#         MPA - Mulliken population analysis
#         Nuclear - properties of atomic nuclei
#         OPA - overlap population analysis
#         Population - base class for population analyses
#         Volume - volume/grid calculations
# 
#     All the modules containing methods should be importable.
#     """
#     required_attrs = ()
#     def __init__(self, data, progress=None, loglevel=logging.INFO, logname="Log"):
#         """Initialise the Logfile object.
# 
#         This constructor is typically called by the constructor of a subclass.
#         """
# 
#         self.data = data
#         self.progress = progress
#         self.loglevel = loglevel
#         self.logname = logname
#         self._check_required_attributes()
#         self.logger = logging.getLogger('%s %s' % (self.logname, self.data))
#         self.logger.setLevel(self.loglevel)
#         self.logformat = "[%(name)s %(levelname)s] %(message)s"
#         handler = logging.StreamHandler(sys.stdout)
#         handler.setFormatter(logging.Formatter(self.logformat))
#         self.logger.addHandler(handler)
# 
#     def _check_required_attributes(self):
#         """Check if required attributes are present in data."""
#         missing = [x for x in self.required_attrs
#                     if not hasattr(self.data, x)]
#         if missing:
#             missing = ' '.join(missing)
#             raise MissingAttributeError(
#                 'Could not parse required attributes to use method: ' + missing)


# Path: cclib/method/nuclear.py
import logging
import numpy as np
    import periodictable as pt
    import scipy.constants
from cclib.method.calculationmethod import Method
from cclib.parser.utils import PeriodicTable
from cclib.parser.utils import find_package

        raise ImportError("You must install `scipy` to use this function")


def get_most_abundant_isotope(element):
    """Given a `periodictable` element, return the most abundant
    isotope.
    """
    most_abundant_isotope = element.isotopes[0]
    abundance = 0
    for iso in element:
        if iso.abundance > abundance:
            most_abundant_isotope = iso
            abundance = iso.abundance
    return most_abundant_isotope


def get_isotopic_masses(charges):
    """Return the masses for the given nuclei, respresented by their
    nuclear charges.
    """
    _check_periodictable(_found_periodictable)
    masses = []
    for charge in charges:
        el = pt.elements[charge]
        isotope = get_most_abundant_isotope(el)
        mass = isotope.mass
        masses.append(mass)
    return np.array(masses)



class Nuclear(Method):