# Path: amdtk/io/persistent_model.py
# class PersistentModel(metaclass=abc.ABCMeta):
#     """Base class for classes that can be serialized."""
# 
#     @abc.abstractmethod
#     def to_dict(self):
#         """Get the data of the model into a dictionary.
# 
#         Returns
#         -------
#         dict : dictionary
#             Dictionary containing the model's data.
# 
#         """
#         pass
# 
#     @abc.abstractclassmethod
#     def load_from_dict(cls, model_data):
#         """Create and initialize the model from a dictionary.
# 
#         Parameters
#         ----------
#         model_data : dictionary
#             Dictionary containing the model's data.
# 
#         Returns
#         -------
#         model : :class:`PersistentModel`
#             Model initialized from the data.
# 
#         """
#         pass
# 
#     def save(self, fname):
#         """Store the model.
# 
#         Parameters
#         ----------
#         fname : string
#             String where to store the model.
# 
#         """
#         retval = self.to_dict()
#         retval['class'] = self.__class__
#         with open(fname, 'wb') as fid:
#             pickle.dump(retval, fid)
# 
#     @staticmethod
#     def load(file_obj):
#         """Load a model.
# 
#         Parameters
#         ----------
#         file_obj : file object
#             File-like object  where to store the model.
# 
#         Returns
#         -------
#         model : :class:`PersistentModel`
#             Model initialized from the stored data.
# 
#         """
#         model_data = pickle.load(file_obj)
#         cls = model_data['class']
#         return cls.load_from_dict(model_data)


import abc
import numpy as np
from ..io.persistent_model import PersistentModel

"""
Base class for members of the Exponential Family of distribution (EFD).

Copyright (C) 2017, Lucas Ondel

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""




# Path: amdtk/io/persistent_model.py
# class PersistentModel(metaclass=abc.ABCMeta):
#     """Base class for classes that can be serialized."""
# 
#     @abc.abstractmethod
#     def to_dict(self):
#         """Get the data of the model into a dictionary.
# 
#         Returns
#         -------
#         dict : dictionary
#             Dictionary containing the model's data.
# 
#         """
#         pass
# 
#     @abc.abstractclassmethod
#     def load_from_dict(cls, model_data):
#         """Create and initialize the model from a dictionary.
# 
#         Parameters
#         ----------
#         model_data : dictionary
#             Dictionary containing the model's data.
# 
#         Returns
#         -------
#         model : :class:`PersistentModel`
#             Model initialized from the data.
# 
#         """
#         pass
# 
#     def save(self, fname):
#         """Store the model.
# 
#         Parameters
#         ----------
#         fname : string
#             String where to store the model.
# 
#         """
#         retval = self.to_dict()
#         retval['class'] = self.__class__
#         with open(fname, 'wb') as fid:
#             pickle.dump(retval, fid)
# 
#     @staticmethod
#     def load(file_obj):
#         """Load a model.
# 
#         Parameters
#         ----------
#         file_obj : file object
#             File-like object  where to store the model.
# 
#         Returns
#         -------
#         model : :class:`PersistentModel`
#             Model initialized from the stored data.
# 
#         """
#         model_data = pickle.load(file_obj)
#         cls = model_data['class']
#         return cls.load_from_dict(model_data)


# Path: amdtk/densities/efd.py
import abc
import numpy as np
from ..io.persistent_model import PersistentModel


"""
Base class for members of the Exponential Family of distribution (EFD).

Copyright (C) 2017, Lucas Ondel

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""




class EFDPrior(PersistentModel, metaclass=abc.ABCMeta):