Loads a cellpy file.

        Args:
            cellpy_file (path, str): Full path to the cellpy file.
            parent_level (str, optional): Parent level
359067
def load(self, cellpy_file, parent_level="CellpyData"):
        

        try:
            self.logger.debug("loading cellpy-file (hdf5):")
            self.logger.debug(cellpy_file)
            new_datasets = self._load_hdf5(cellpy_file, parent_level)
            self.logger.debug("cellpy-file loaded")
        except AttributeError:
            new_datasets = []
            self.logger.warning("This cellpy-file version is not supported by"
                                "current reader (try to update cellpy).")

        if new_datasets:
            for dataset in new_datasets:
                self.datasets.append(dataset)
        else:
            # raise LoadError
            self.logger.warning("Could not load")
            self.logger.warning(str(cellpy_file))

        self.number_of_datasets = len(self.datasets)
        self.status_datasets = self._validate_datasets()
        self._invent_a_name(cellpy_file)
        return self
785353
def load(self, filename):
        """"""
        f = open(filename, "rb")
        d = pickle.load(f)
        f.close()
        self.__dict__.update(d)
888664
def load_parent(self, location):
        """"""
        assert isinstance(location, basestring)
        found = b2.util.path.glob_in_parents(
            location, self.JAMROOT + self.JAMFILE)

        if not found:
            print "error: Could not find parent for project at '%s'" % location
            print "error: Did not find Jamfile.jam or Jamroot.jam in any parent directory."
            sys.exit(1)

        return self.load(os.path.dirname(found[0]))
1059715
def find(self,cell_designation,cell_filter=lambda x,c: 'c' in x and x['c'] == c):
        
        if 'parent' in self.meta:
            return (self.meta['parent'],self.meta['parent'].find(cell_designation,cell_filter=cell_filter))
405508
def tree_load(**kwargs):
            
            str_pathDiskRoot    = ''
            b_loadJSON          = True
            b_loadPickle        = False
            for key, val in kwargs.items():
                if key == 'pathDiskRoot':   str_pathDiskRoot    = val
                if key == 'loadJSON':       b_loadJSON          = val
                if key == 'loadPickle':     b_loadPickle        = val

            l_dir   = []
            l_file  = []
            for str_root, l_directories, l_filenames in os.walk(str_pathDiskRoot):
                for str_dir in l_directories:
                    l_dir.append(os.path.join(str_root, str_dir))
                for str_file in l_filenames:
                    l_file.append(os.path.join(str_root, str_file))
            stree_dirs  = [d.replace(str_pathDiskRoot, '') for d in l_dir]
            stree_files = [f.replace(str_pathDiskRoot, '') for f in l_file]

            # Create the tree
            rtree       = C_stree()
            # Build the directory structures
            for d in stree_dirs:
                # print(d)
                rtree.mkdir(d)
            # Now read any files
            for f in stree_files:
                dirname     = os.path.dirname(f)
                filename    = os.path.basename(f)
                # print(f)
                if b_loadJSON:
                    with open(str_pathDiskRoot + '/' + f, 'r') as fp:
                        contents = json.load(fp)
                        fp.close()
                if b_loadPickle:
                    with open(str_pathDiskRoot + '/' + f, 'rb') as fp:
                        contents = pickle.load(fp)
                        fp.close()

                if rtree.cd(dirname)['status']:
                    rtree.touch(filename, contents)

            return rtree
771324
def load(cls, filename):
        

        instance = Glove()

        with open(filename, 'rb') as savefile:
            instance.__dict__ = pickle.load(savefile)

        return instance
1016644
def rp_module_level_in_stack():
    
    from traceback import extract_stack
    from rootpy import _ROOTPY_SOURCE_PATH
    modlevel_files = [filename for filename, _, func, _ in extract_stack()
                      if func == "<module>"]

    return any(path.startswith(_ROOTPY_SOURCE_PATH) for path in modlevel_files)
1326478
def _load(self, filename=None):
        """"""
        if not filename:
            filename = self.aatsr_path

        wb_ = open_workbook(filename)

        for sheet in wb_.sheets():
            ch_name = sheet.name.strip()
            if ch_name == 'aatsr_' + self.bandname:

                data = np.array([s.split() for s in
                                 sheet.col_values(0,
                                                  start_rowx=3, end_rowx=258)])
                data = data.astype('f')
                wvl = data[:, 0]
                resp = data[:, 1]

                self.rsr = {'wavelength': wvl, 'response': resp}
1059023
def cell(filename=None, mass=None, instrument=None, logging_mode="INFO",
         cycle_mode=None, auto_summary=True):
    """"""

    from cellpy import log

    log.setup_logging(default_level=logging_mode)
    cellpy_instance = setup_cellpy_instance()

    if instrument is not None:
        cellpy_instance.set_instrument(instrument=instrument)

    if cycle_mode is not None:
        cellpy_instance.cycle_mode = cycle_mode

    if filename is not None:
        filename = Path(filename)

        if filename.suffix in [".h5", ".hdf5", ".cellpy", ".cpy"]:
            logging.info(f"Loading cellpy-file: {filename}")
            cellpy_instance.load(filename)
        else:
            logging.info(f"Loading raw-file: {filename}")
            cellpy_instance.from_raw(filename)
            if mass is not None:
                logging.info("Setting mass")
                cellpy_instance.set_mass(mass)
            if auto_summary:
                logging.info("Creating step table")
                cellpy_instance.make_step_table()
                logging.info("Creating summary data")
                cellpy_instance.make_summary()

    logging.info("Created CellpyData object")
    return cellpy_instance
1091248
def load(self, list_file):
    
    with open(list_file) as f:
      for line in f:
        if line and line[0] != '#':
          splits = line.split()
          bounding_boxes = []
          for i in range(1, len(splits), 4):
            assert splits[i][0] == '[' and splits[i+3][-1] == ']'
            bounding_boxes.append(BoundingBox(topleft=(float(splits[i][1:]), float(splits[i+1])), size=(float(splits[i+2]), float(splits[i+3][:-1]))))
          self.image_paths.append(splits[0])
          self.bounding_boxes.append(bounding_boxes)
435509
def load_file(self, app, pathname, relpath, pypath):
        
        try:
            view_class = self.get_file_view_cls(relpath)
            return create_view_from_file(pathname, source_template=relpath, view_class=view_class)
        except DeclarativeViewError:
            pass
1102294
def _open_worksheet(self, xlsx_file):
        
        workbook = Workbook(xlsx_file, {'in_memory': True})
        worksheet = workbook.add_worksheet()
        yield workbook, worksheet
        workbook.close()
1079831
def load(cls, file_path):
        

        # convert back to numpy
        data = helper.read_json(file_path)
        return Concise.from_dict(data)
1043615
def loadInternalSheet(klass, p, **kwargs):
    ''
    vs = klass(p.name, source=p, **kwargs)
    options._set('encoding', 'utf8', vs)
    if p.exists():
        vd.sheets.insert(0, vs)
        vs.reload.__wrapped__(vs)
        vd.sheets.pop(0)
    return vs
1330507
def load_from_file(module_path):
    
    from imp import load_module, PY_SOURCE

    imported = None
    if module_path:
        with open(module_path, 'r') as openfile:
            imported = load_module('mod', openfile, module_path, ('imported', 'r', PY_SOURCE))
    return imported
1025675
def load(self):
        
        if self.__loaded:
            return False
        
        self.__loaded = True
        self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
        
        # loads the children for this widget
        tree = self.treeWidget()
        if tree.groupBy():
            grps = self.childRecords().grouped(tree.groupBy())
            for grp, records in grps.items():
                tree.createGroupItem(grp, records, self)
        else:
            for record in self.childRecords():
                tree.createRecordItem(record, self)
        
        return True
508823
def __find_child_classes(self, file):
        

        child_classes = []
        folder, name = os.path.split(file)
        name = os.path.splitext(name)[0]

        import imp
        module = imp.load_source(name, file)

        def filter_classes(m):
            if inspect.isclass(m):
                if inspect.getmro(m)[1] == self.__base_class:
                    return True
            return False

        for name, obj in inspect.getmembers(module, filter_classes):
            child_classes.append(obj)

        return child_classes