ocelot.curator package

Submodules

ocelot.curator.Contribution module

class ocelot.curator.Contribution.Contribution(data_access, folder_path)[source]

Bases: object

__init__(data_access, folder_path)[source]

Initialize self. See help(type(self)) for accurate signature.

collect_rawdata(collect_folder, get_extra_property_from_path=None)[source]
RawData
= content (cif_string no diffraction)
  • data_access

  • _id (data_access & cif_header)

Parameters
  • collect_folder – a folder to store cif files without diffraction info

  • get_extra_property_from_path – the path here means the absolute path of a file in self.folder_path

Returns

collected_filepaths: absolute path raw_data_list: a list of RawData

collect_with_log(log_folder, collect_folder, get_property_from_path=None)[source]
curate_all(logfolder, rawdata_list: [<class 'ocelot.curator.DataSchema.RawData'>], wdir_for_curate, unittimelimit=60)[source]
curate_one(rawdata: ocelot.curator.DataSchema.RawData, wdir)[source]

CuratedData = content(structural_schemas) + data_access( RawData.data_access) + _id(hashconfig or ‘failed RawData._id’) + properties: {integrity_class: x, rawdataid: RawData._id, method: …}

exception ocelot.curator.Contribution.CuratorError[source]

Bases: Exception

exception ocelot.curator.Contribution.TimeoutException[source]

Bases: Exception

ocelot.curator.Contribution.clear_cif_from_crystalmaker(s)[source]
ocelot.curator.Contribution.curate_cifstring(cifstring)[source]

:return integrity_class

3 can run all calculations 2 can only run geometric analyses 1 do not run any calculations (exception)

outputs

files written by this function

structural_schemas

structural_schemas[‘configuration’]: the major config structural_schemas[‘molgraphs’]: a list of unique molgraphs from the major config, rsorted by # of atoms structural_schemas[‘molsmiles’]: a list of unique molecular smiles from the major config, rsorted by # of atoms

identifier

hashconfig(major_config)

ocelot.curator.Contribution.get_property_basename(filename)[source]
ocelot.curator.Contribution.get_property_header(filename)[source]
ocelot.curator.Contribution.get_property_lattice(filename)[source]
ocelot.curator.Contribution.get_property_md5(filename)[source]
ocelot.curator.Contribution.get_unique_files(absolute_path_to_files, unique_property='md5')[source]
ocelot.curator.Contribution.read_and_trim(filename: str)[source]
ocelot.curator.Contribution.readfile(file: str)[source]
ocelot.curator.Contribution.time_limit(seconds)[source]
ocelot.curator.Contribution.trim_diffraction(cifstring: str, start_trim='_atom_site_aniso_label')[source]

ocelot.curator.DataSchema module

class ocelot.curator.DataSchema.CuratedData(data_content, data_access: ocelot.curator.DataSchema.DataAccess, _id: str, data_properties=None)[source]

Bases: ocelot.curator.DataSchema.DataEntry

mongo_insert(mongo_uri, database_name, collection_name=None, overwrite=False, rawdatacheck=True, rawdatacollection='RawData')[source]

check if raw data is there

class ocelot.curator.DataSchema.DataAccess(sharedby: ocelot.curator.DataSchema.DataProvider, accessdate: datetime.date, license: license.base.License)[source]

Bases: monty.json.MSONable

__init__(sharedby: ocelot.curator.DataSchema.DataProvider, accessdate: datetime.date, license: license.base.License)[source]

Initialize self. See help(type(self)) for accurate signature.

as_dict() → dict[source]

A JSON serializable dict representation of an object.

classmethod from_dict(d)[source]
Parameters

d – Dict representation.

Returns

MSONable class.

class ocelot.curator.DataSchema.DataEntry(data_content, data_access: ocelot.curator.DataSchema.DataAccess, _id: str, data_properties=None)[source]

Bases: monty.json.MSONable

__init__(data_content, data_access: ocelot.curator.DataSchema.DataAccess, _id: str, data_properties=None)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod from_json(s)[source]
classmethod from_jsonfile(jsonfile)[source]
classmethod from_mongo(mongo_query, mongo_uri, database_name, collection_name=None)[source]
mongo_insert(mongo_uri, database_name, collection_name=None, overwrite=False)[source]

insert RawData as an entry into a mongodb using pymongo

Parameters

mongo_uri – port level is enough

Returns

to_jsonfile(jsonfile)[source]
class ocelot.curator.DataSchema.DataProvider(name: str, institution: str, url: str)[source]

Bases: monty.json.MSONable

__init__(name: str, institution: str, url: str)[source]

this can represent a research group, a journal, or a database

classmethod from_publication_doi(doi)[source]
exception ocelot.curator.DataSchema.DataSchemaError[source]

Bases: Exception

class ocelot.curator.DataSchema.RawData(data_content, data_access: ocelot.curator.DataSchema.DataAccess, _id: str, data_properties=None)[source]

Bases: ocelot.curator.DataSchema.DataEntry

ocelot.curator.DataSchema.string_acronym(s)[source]

Module contents