# Path: metatlas/datastructures/metatlas_objects.py
# FETCH_STUBS = True
# ADDUCTS = ('','[M]+','[M+H]+','[M+H]2+','[M+2H]2+','[M+H-H2O]2+','[M+K]2+','[M+NH4]+','[M+Na]+','[M+H-H2O]+','[M-H]-','[M-2H]-','[M-H+Cl]-','[M-2H]2-','[M+Cl]-','[2M+H]+','[2M-H]-','[M-H+Na]+','[M+K]+','[M+2Na]2+','[M-e]+','[M+acetate]-','[M+formate]-','[M-H+Cl]2-','[M-H+2Na]+')
# POLARITY = ('positive', 'negative', 'alternating')
# FRAGMENTATION_TECHNIQUE = ('hcd','cid','etd','ecd','irmpd')
# ID_GRADES: Dict[str, IdentificationGrade] = dict()
#     FETCH_STUBS = False
#         FETCH_STUBS = True
#     FETCH_STUBS = True
# def retrieve(object_type, **kwargs):
# def remove(object_type, **kwargs):
# def remove_objects(objects, all_versions=True, **kwargs):
# def store(objects, **kwargs):
#     def __init__(self, **kwargs):
#     def _update(self, override_user=False):
#     def clone(self, recursive=False):
#     def show_diff(self, unique_id=None):
#     def _on_update(self, change):
#     def __str__(self):
#     def __repr__(self):
#     def __getattribute__(self, name):
#     def validate(self, obj, value):
# def find_invalid_runs(**kwargs):
# def to_dataframe(objects):
# class MetatlasObject(HasTraits):
# class Method(MetatlasObject):
# class Sample(MetatlasObject):
# class LcmsRun(MetatlasObject):
# class FunctionalSet(MetatlasObject):
# class Compound(MetatlasObject):
# class Reference(MetatlasObject):
# class IdentificationGrade(MetatlasObject):
# class _IdGradeTrait(MetInstance):
# class Group(MetatlasObject):
# class MzIntensityPair(MetatlasObject):
# class FragmentationReference(Reference):
# class RtReference(Reference):
# class MzReference(Reference):
# class IntensityReference(Reference):
# class CompoundIdentification(MetatlasObject):
# class Atlas(MetatlasObject):
# class MZMineTask(MetatlasObject):


import logging
from typing import NewType
from metatlas.datastructures import metatlas_objects as metob
"""Utility functions for working with metatlas data structures"""




logger = logging.getLogger(__name__)

AtlasName = NewType("AtlasName", str)
Username = NewType("Username", str)


def get_atlas(name: AtlasName, username: Username) -> metob.Atlas:
    """Load atlas from database"""

# Path: metatlas/datastructures/metatlas_objects.py
# FETCH_STUBS = True
# ADDUCTS = ('','[M]+','[M+H]+','[M+H]2+','[M+2H]2+','[M+H-H2O]2+','[M+K]2+','[M+NH4]+','[M+Na]+','[M+H-H2O]+','[M-H]-','[M-2H]-','[M-H+Cl]-','[M-2H]2-','[M+Cl]-','[2M+H]+','[2M-H]-','[M-H+Na]+','[M+K]+','[M+2Na]2+','[M-e]+','[M+acetate]-','[M+formate]-','[M-H+Cl]2-','[M-H+2Na]+')
# POLARITY = ('positive', 'negative', 'alternating')
# FRAGMENTATION_TECHNIQUE = ('hcd','cid','etd','ecd','irmpd')
# ID_GRADES: Dict[str, IdentificationGrade] = dict()
#     FETCH_STUBS = False
#         FETCH_STUBS = True
#     FETCH_STUBS = True
# def retrieve(object_type, **kwargs):
# def remove(object_type, **kwargs):
# def remove_objects(objects, all_versions=True, **kwargs):
# def store(objects, **kwargs):
#     def __init__(self, **kwargs):
#     def _update(self, override_user=False):
#     def clone(self, recursive=False):
#     def show_diff(self, unique_id=None):
#     def _on_update(self, change):
#     def __str__(self):
#     def __repr__(self):
#     def __getattribute__(self, name):
#     def validate(self, obj, value):
# def find_invalid_runs(**kwargs):
# def to_dataframe(objects):
# class MetatlasObject(HasTraits):
# class Method(MetatlasObject):
# class Sample(MetatlasObject):
# class LcmsRun(MetatlasObject):
# class FunctionalSet(MetatlasObject):
# class Compound(MetatlasObject):
# class Reference(MetatlasObject):
# class IdentificationGrade(MetatlasObject):
# class _IdGradeTrait(MetInstance):
# class Group(MetatlasObject):
# class MzIntensityPair(MetatlasObject):
# class FragmentationReference(Reference):
# class RtReference(Reference):
# class MzReference(Reference):
# class IntensityReference(Reference):
# class CompoundIdentification(MetatlasObject):
# class Atlas(MetatlasObject):
# class MZMineTask(MetatlasObject):


# Path: metatlas/datastructures/utils.py
import logging
from typing import NewType
from metatlas.datastructures import metatlas_objects as metob

"""Utility functions for working with metatlas data structures"""




logger = logging.getLogger(__name__)

AtlasName = NewType("AtlasName", str)
Username = NewType("Username", str)


def get_atlas(name: AtlasName, username: Username) -> metob.Atlas:
    """Load atlas from database"""

    atlases = metob.retrieve("Atlas", name=name, username=username)