def add_package(self, p):
    '\n        Add a package.\n\n        Parameters\n        ----------\n        p : Package object\n\n        '
    for (idx, u) in enumerate(p.unit_number):
        if (u != 0):
            if ((u in self.package_units) or (u in self.external_units)):
                try:
                    pn = p.name[idx]
                except:
                    pn = p.name
                if self.verbose:
                    print(f'''
WARNING:
    unit {u} of package {pn} already in use.''')
        self.package_units.append(u)
    for (i, pp) in enumerate(self.packagelist):
        if pp.allowDuplicates:
            continue
        elif isinstance(p, type(pp)):
            if self.verbose:
                print(f'''
WARNING:
    Two packages of the same type, Replacing existing '{p.name[0]}' package.''')
            self.packagelist[i] = p
            return
    if self.verbose:
        print('adding Package: ', p.name[0])
    self.packagelist.append(p)
Add a package.

Parameters
----------
p : Package object
def add_package(self, p):
    '\n        Add a package.\n\n        Parameters\n        ----------\n        p : Package object\n\n        '
    for (idx, u) in enumerate(p.unit_number):
        if (u != 0):
            if ((u in self.package_units) or (u in self.external_units)):
                try:
                    pn = p.name[idx]
                except:
                    pn = p.name
                if self.verbose:
                    print(f'
WARNING:
    unit {u} of package {pn} already in use.')
        self.package_units.append(u)
    for (i, pp) in enumerate(self.packagelist):
        if pp.allowDuplicates:
            continue
        elif isinstance(p, type(pp)):
            if self.verbose:
                print(f'
WARNING:
    Two packages of the same type, Replacing existing '{p.name[0]}' package.')
            self.packagelist[i] = p
            return
    if self.verbose:
        print('adding Package: ', p.name[0])
    self.packagelist.append(p)