mdciao.sites.x2site

mdciao.sites.x2site(site, fmt='AAresSeq')

Return a site dictionary from a dict or an ascii file

Parameters
  • site (str or dict) – Path to the ascii file. If the file isn’t a json file, or doesn’t contain the ‘name’-field, the filename itself will be used as ‘name’ in the output If a dict is passed, it’s checked that the dictionary has the needed keys to function as a site. See mdciao.sites for more info on how sites are defined.

  • fmt (str, default is "AAresSeq") – The expected format in case of reading a file. Only used when reading a file.

Returns

site

Keys are:
  • pairs

  • n_pairs

  • name

site[“pairs”] is itself a dictionary valued with a list of pairs, e.g [“L394”,”K270”] or [[10,20],[300-4]]], depending on the type input

Return type

dict