# Path: finitediff/grid/make.py
# def adapted_grid(xstart, xstop, cb, grid_additions=(50, 50), **kwargs):
#     """ " Creates an adapted (1D) grid by subsequent subgrid insertions.
# 
#     Parameters
#     ----------
#     xstart : float
#     xstop : float
#     cb : callbable
#         Function to be evaluated (note that noise is handled poorly).
#     grid_additions : iterable of ints (even numbers)
#         Sequence specifying how many gridpoints to add each time.
#     \\*\\*kwargs : see :func:`refine_grid`.
#     """
#     grid = np.linspace(xstart, xstop, grid_additions[0])
#     return refine_grid(grid, cb, grid_additions=grid_additions[1:], **kwargs)


import numpy as np
    import matplotlib.pyplot as plt
from .make import adapted_grid
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function



def plot_convergence(key, values, cb, metric=None, xstart=0, xstop=2, **kwargs):

    if key in kwargs:
        raise ValueError("Cannot have key=%s when given in kwargs" % key)
    fig, axes = plt.subplots(
        1, len(values), figsize=(16, 5), sharey=True, gridspec_kw={"wspace": 0}
    )

# Path: finitediff/grid/make.py
# def adapted_grid(xstart, xstop, cb, grid_additions=(50, 50), **kwargs):
#     """ " Creates an adapted (1D) grid by subsequent subgrid insertions.
# 
#     Parameters
#     ----------
#     xstart : float
#     xstop : float
#     cb : callbable
#         Function to be evaluated (note that noise is handled poorly).
#     grid_additions : iterable of ints (even numbers)
#         Sequence specifying how many gridpoints to add each time.
#     \\*\\*kwargs : see :func:`refine_grid`.
#     """
#     grid = np.linspace(xstart, xstop, grid_additions[0])
#     return refine_grid(grid, cb, grid_additions=grid_additions[1:], **kwargs)


# Path: finitediff/grid/plotting.py
import numpy as np
    import matplotlib.pyplot as plt
from .make import adapted_grid

# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function



def plot_convergence(key, values, cb, metric=None, xstart=0, xstop=2, **kwargs):

    if key in kwargs:
        raise ValueError("Cannot have key=%s when given in kwargs" % key)
    fig, axes = plt.subplots(
        1, len(values), figsize=(16, 5), sharey=True, gridspec_kw={"wspace": 0}
    )

    scores, grid_sizes = [], []