# Path: metatlas/datastructures/object_helpers.py
# ON_NERSC = 'METATLAS_LOCAL' not in os.environ
# def callback_method(func):
#     def notify(self, *args, **kwargs):
#     def __getitem__(self, item):
#     def __init__(self, *args):
#     def register_callback(self, cb):
#     def unregister_callback(self, cbid):
# def set_docstring(cls):
# def _get_subclasses(cls):
#     def __init__(self):
#     def get_instance(cls):
#     def get_connection(self):
#     def close_connection(self):
#     def convert_to_double(self, table, entry):
#     def save_objects(self, objects, _override=False):
#     def create_link_tables(self, klass):
#     def _get_save_data(self, obj, override=False):
#     def fix_table(self, table_name):
#     def retrieve(self, object_type, **kwargs):
#     def remove(self, object_type, **kwargs):
#     def remove_objects(self, objects, all_versions=True, **kwargs):
# def format_timestamp(tstamp):
#     def validate(self, obj, value):
#     def retrieve(self):
#     def __repr__(self):
#     def __str__(self):
#     def validate(self, obj, value):
# def get_from_nersc(user, relative_path):
# def rollback_and_log(db_connection, err):
# class NotifyList(list):
# class Workspace(object):
# class MetList(List):
# class MetUnicode(CUnicode):
# class MetFloat(CFloat):
# class MetInt(CInt):
# class MetBool(CBool):
# class Stub(HasTraits):
# class MetInstance(Instance):
# class MetEnum(Enum):


import getpass
import logging
import os
import pprint
import time
import uuid
import pandas as pd
from typing import Dict
from pwd import getpwuid
from tabulate import tabulate
from .object_helpers import (
    set_docstring, Workspace, format_timestamp, MetList,
    MetUnicode, MetFloat, MetInstance, MetInt, MetEnum, MetBool, HasTraits,
    Stub
)
from six.moves import zip
    chebi_url = MetUnicode(help='Reference database table url')
    lipidmaps_url = MetUnicode(help='Reference database table url')

    #RDKIT Calculates these with some helper functions
    formula = MetUnicode()
    mono_isotopic_molecular_weight = MetFloat()
    permanent_charge = MetInt()
    number_components = MetInt(help='Must be one or greater')
    num_free_radicals = MetInt()
    inchi = MetUnicode()
    inchi_key = MetUnicode()
    neutralized_inchi = MetUnicode()
    neutralized_inchi_key = MetUnicode()
    neutralized_2d_inchi = MetUnicode()
    neutralized_2d_inchi_key = MetUnicode()

    #reference_xrefs = MetList(MetInstance(ReferenceDatabase),
    #                       help='Tag a compound with compound ids from ' +
    #                            'external databases')
    #functional_sets = MetList(MetInstance(FunctionalSet))


@set_docstring
class Reference(MetatlasObject):
    """Place holder for future reference sources.
    We expect many in silico methods will soon be robust enough to suggest
    retention times, m/z, and fragmentation.
    Pactolus is a great example of this.
    """
    lcms_run = MetInstance(LcmsRun)

# Path: metatlas/datastructures/object_helpers.py
# ON_NERSC = 'METATLAS_LOCAL' not in os.environ
# def callback_method(func):
#     def notify(self, *args, **kwargs):
#     def __getitem__(self, item):
#     def __init__(self, *args):
#     def register_callback(self, cb):
#     def unregister_callback(self, cbid):
# def set_docstring(cls):
# def _get_subclasses(cls):
#     def __init__(self):
#     def get_instance(cls):
#     def get_connection(self):
#     def close_connection(self):
#     def convert_to_double(self, table, entry):
#     def save_objects(self, objects, _override=False):
#     def create_link_tables(self, klass):
#     def _get_save_data(self, obj, override=False):
#     def fix_table(self, table_name):
#     def retrieve(self, object_type, **kwargs):
#     def remove(self, object_type, **kwargs):
#     def remove_objects(self, objects, all_versions=True, **kwargs):
# def format_timestamp(tstamp):
#     def validate(self, obj, value):
#     def retrieve(self):
#     def __repr__(self):
#     def __str__(self):
#     def validate(self, obj, value):
# def get_from_nersc(user, relative_path):
# def rollback_and_log(db_connection, err):
# class NotifyList(list):
# class Workspace(object):
# class MetList(List):
# class MetUnicode(CUnicode):
# class MetFloat(CFloat):
# class MetInt(CInt):
# class MetBool(CBool):
# class Stub(HasTraits):
# class MetInstance(Instance):
# class MetEnum(Enum):


# Path: metatlas/datastructures/metatlas_objects.py
import getpass
import logging
import os
import pprint
import time
import uuid
import pandas as pd
from typing import Dict
from pwd import getpwuid
from tabulate import tabulate
from .object_helpers import (
    set_docstring, Workspace, format_timestamp, MetList,
    MetUnicode, MetFloat, MetInstance, MetInt, MetEnum, MetBool, HasTraits,
    Stub
)
from six.moves import zip

    chebi_url = MetUnicode(help='Reference database table url')
    lipidmaps_url = MetUnicode(help='Reference database table url')

    #RDKIT Calculates these with some helper functions
    formula = MetUnicode()
    mono_isotopic_molecular_weight = MetFloat()
    permanent_charge = MetInt()
    number_components = MetInt(help='Must be one or greater')
    num_free_radicals = MetInt()
    inchi = MetUnicode()
    inchi_key = MetUnicode()
    neutralized_inchi = MetUnicode()
    neutralized_inchi_key = MetUnicode()
    neutralized_2d_inchi = MetUnicode()
    neutralized_2d_inchi_key = MetUnicode()

    #reference_xrefs = MetList(MetInstance(ReferenceDatabase),
    #                       help='Tag a compound with compound ids from ' +
    #                            'external databases')
    #functional_sets = MetList(MetInstance(FunctionalSet))


@set_docstring
class Reference(MetatlasObject):
    """Place holder for future reference sources.
    We expect many in silico methods will soon be robust enough to suggest
    retention times, m/z, and fragmentation.
    Pactolus is a great example of this.
    """
    lcms_run = MetInstance(LcmsRun)

    enabled = MetBool(True)