# Path: lib/eofs/tests/reference.py
# def reference_solution(container_type, weights):
#     """Obtain a reference EOF analysis solution.
# 
#     **Arguments:**
# 
#     *container_type*
#         Either 'standard', 'cdms', 'iris' or 'xarray'.
# 
#     *weights*
#         Weights method. One of 'equal', 'latitude', or 'area'.
# 
#     """
#     container_type = container_type.lower()
#     weights = weights.lower()
#     if container_type not in ('standard', 'iris', 'cdms', 'xarray'):
#         raise ValueError("unknown container type "
#                          "'{!s}'".format(container_type))
#     solution = _read_reference_solution(weights)
#     time_units = 'months since 0-1-1 00:00:0.0'
#     neofs = len(solution['eigenvalues'])
#     _get_wrapper(container_type)(solution, neofs, time_units)
#     return solution


import numpy as np
    import cdms2
import pytest
import eofs
from eofs.tests import EofsTest
from .reference import reference_solution
try:
except ImportError:
    pass




# Create a mapping from interface name to solver class.
solvers = {'standard': eofs.standard.Eof}
try:
    solvers['cdms'] = eofs.cdms.Eof
except AttributeError:
    pass
try:
    solvers['iris'] = eofs.iris.Eof
except AttributeError:
    pass
try:
    solvers['xarray'] = eofs.xarray.Eof
except AttributeError:
    pass


class ErrorHandlersTest(EofsTest):
    interface = None
    weights = None

    @classmethod
    def setup_class(cls):
        try:

# Path: lib/eofs/tests/reference.py
# def reference_solution(container_type, weights):
#     """Obtain a reference EOF analysis solution.
# 
#     **Arguments:**
# 
#     *container_type*
#         Either 'standard', 'cdms', 'iris' or 'xarray'.
# 
#     *weights*
#         Weights method. One of 'equal', 'latitude', or 'area'.
# 
#     """
#     container_type = container_type.lower()
#     weights = weights.lower()
#     if container_type not in ('standard', 'iris', 'cdms', 'xarray'):
#         raise ValueError("unknown container type "
#                          "'{!s}'".format(container_type))
#     solution = _read_reference_solution(weights)
#     time_units = 'months since 0-1-1 00:00:0.0'
#     neofs = len(solution['eigenvalues'])
#     _get_wrapper(container_type)(solution, neofs, time_units)
#     return solution


# Path: lib/eofs/tests/test_error_handling.py
import numpy as np
    import cdms2
import pytest
import eofs
from eofs.tests import EofsTest
from .reference import reference_solution

try:
except ImportError:
    pass




# Create a mapping from interface name to solver class.
solvers = {'standard': eofs.standard.Eof}
try:
    solvers['cdms'] = eofs.cdms.Eof
except AttributeError:
    pass
try:
    solvers['iris'] = eofs.iris.Eof
except AttributeError:
    pass
try:
    solvers['xarray'] = eofs.xarray.Eof
except AttributeError:
    pass


class ErrorHandlersTest(EofsTest):
    interface = None
    weights = None

    @classmethod
    def setup_class(cls):
        try:

            cls.solution = reference_solution(cls.interface, cls.weights)