original_docstring: 
      Read all atoms and properties from deprecated ase databases.
  
      Args:
          db_path (str): Path to deprecated database
  
      Returns:
          atoms (list): All atoms objects of the database.
          properties (list): All property dictionaries of the database.
  
      
docstring: Read all atoms and properties from deprecated ase databases.
docstring_tokens: Read all atoms and properties from deprecated ase databases .
code: def read_deprecated_database(db_path):
      """
      Read all atoms and properties from deprecated ase databases.
  
      Args:
          db_path (str): Path to deprecated database
  
      Returns:
          atoms (list): All atoms objects of the database.
          properties (list): All property dictionaries of the database.
  
      """
      with connect(db_path) as conn:
          db_size = conn.count()
      atoms = []
      properties = []
      key_value_pairs = []
  
      for idx in tqdm(range(1, db_size + 1), "Reading deprecated database"):
          with connect(db_path) as conn:
              row = conn.get(idx)
  
          at = row.toatoms()
          pnames = [pname for pname in row.data.keys() if not pname.startswith("_")]
          props = {}
          for pname in pnames:
              try:
                  shape = row.data["_shape_" + pname]
                  dtype = row.data["_dtype_" + pname]
                  prop = np.frombuffer(b64decode(row.data[pname]), dtype=dtype)
                  prop = prop.reshape(shape)
              except:
                  # fallback for properties stored directly
                  # in the row
                  if pname in row:
                      prop = row[pname]
                  else:
                      prop = row.data[pname]
  
                  try:
                      prop.shape
                  except AttributeError as e:
                      prop = np.array([prop], dtype=np.float32)
              props[pname] = prop
  
          atoms.append(at)
          properties.append(props)
          key_value_pairs.append(row.key_value_pairs)
  
      return atoms, properties, key_value_pairs
code_tokens: def read_deprecated_database ( db_path ) : with connect ( db_path ) as conn : db_size = conn . count ( ) atoms = [ ] properties = [ ] key_value_pairs = [ ] for idx in tqdm ( range ( 1 , db_size + 1 ) , "Reading deprecated database" ) : with connect ( db_path ) as conn : row = conn . get ( idx ) at = row . toatoms ( ) pnames = [ pname for pname in row . data . keys ( ) if not pname . startswith ( "_" ) ] props = { } for pname in pnames : try : shape = row . data [ "_shape_" + pname ] dtype = row . data [ "_dtype_" + pname ] prop = np . frombuffer ( b64decode ( row . data [ pname ] ) , dtype = dtype ) prop = prop . reshape ( shape ) except : if pname in row : prop = row [ pname ] else : prop = row . data [ pname ] try : prop . shape except AttributeError as e : prop = np . array ( [ prop ] , dtype = np . float32 ) props [ pname ] = prop atoms . append ( at ) properties . append ( props ) key_value_pairs . append ( row . key_value_pairs ) return atoms , properties , key_value_pairs
short_docstring: Read all atoms and properties from deprecated ase databases.
short_docstring_tokens: Read all atoms and properties from deprecated ase databases .
comment: """
      Read all atoms and properties from deprecated ase databases.
  
      Args:
          db_path (str): Path to deprecated database
  
      Returns:
          atoms (list): All atoms objects of the database.
          properties (list): All property dictionaries of the database.
  
      """$SEP$# fallback for properties stored directly$SEP$# in the row