From 74381f784cb50ae8a2b1cf436c1e264c7762d9f1 Mon Sep 17 00:00:00 2001 From: kratman Date: Wed, 26 Jun 2024 09:50:13 -0400 Subject: [PATCH] Replace tinyurl --- pybamm/expression_tree/array.py | 12 ++++++------ pybamm/parameters/parameter_values.py | 3 +-- pybamm/plotting/plot.py | 6 ++---- pybamm/plotting/plot2D.py | 6 ++---- pybamm/solvers/algebraic_solver.py | 5 +++-- pybamm/solvers/scipy_solver.py | 5 +++-- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/pybamm/expression_tree/array.py b/pybamm/expression_tree/array.py index e16b7d17aa..d3021bb9f5 100644 --- a/pybamm/expression_tree/array.py +++ b/pybamm/expression_tree/array.py @@ -189,7 +189,8 @@ def linspace(start: float, stop: float, num: int = 50, **kwargs) -> pybamm.Array """ Creates a linearly spaced array by calling `numpy.linspace` with keyword arguments 'kwargs'. For a list of 'kwargs' see the - `numpy linspace documentation `_ + `numpy linspace documentation + `_ """ return pybamm.Array(np.linspace(start, stop, num, **kwargs)) @@ -200,9 +201,8 @@ def meshgrid( """ Return coordinate matrices as from coordinate vectors by calling `numpy.meshgrid` with keyword arguments 'kwargs'. For a list of 'kwargs' - see the `numpy meshgrid documentation `_ + see the `numpy meshgrid documentation + `_ """ - [X, Y] = np.meshgrid(x.entries, y.entries) - X = pybamm.Array(X) - Y = pybamm.Array(Y) - return X, Y + [x_grid, y_grid] = np.meshgrid(x.entries, y.entries) + return pybamm.Array(x_grid), pybamm.Array(y_grid) diff --git a/pybamm/parameters/parameter_values.py b/pybamm/parameters/parameter_values.py index 57ebf65058..815dbedcc0 100644 --- a/pybamm/parameters/parameter_values.py +++ b/pybamm/parameters/parameter_values.py @@ -256,7 +256,6 @@ def update(self, values, check_conflict=False, check_already_exists=True, path=" + "sure you want to update this parameter, use " + "param.update({{name: value}}, check_already_exists=False)" ) from err - # if no conflicts, update if isinstance(value, str): if ( value.startswith("[function]") @@ -269,7 +268,7 @@ def update(self, values, check_conflict=False, check_already_exists=True, path=" "or [2D data] is no longer supported. For functions, pass in a " "python function object. For data, pass in a python function " "that returns a pybamm Interpolant object. " - "See https://tinyurl.com/merv43ss for an example with both." + "See the Ai2020 parameter set for an example with both." ) elif value == "[input]": diff --git a/pybamm/plotting/plot.py b/pybamm/plotting/plot.py index 4037ab8fbf..ca145f9831 100644 --- a/pybamm/plotting/plot.py +++ b/pybamm/plotting/plot.py @@ -1,6 +1,3 @@ -# -# Method for creating a 1D plot of pybamm arrays -# import pybamm from .quick_plot import ax_min, ax_max from pybamm.util import import_optional_dependency @@ -10,7 +7,8 @@ def plot(x, y, ax=None, show_plot=True, **kwargs): """ Generate a simple 1D plot. Calls `matplotlib.pyplot.plot` with keyword arguments 'kwargs'. For a list of 'kwargs' see the - `matplotlib plot documentation `_ + `matplotlib plot documentation + `_ Parameters ---------- diff --git a/pybamm/plotting/plot2D.py b/pybamm/plotting/plot2D.py index 7d1f3c6bae..aa169ac39f 100644 --- a/pybamm/plotting/plot2D.py +++ b/pybamm/plotting/plot2D.py @@ -1,6 +1,3 @@ -# -# Method for creating a filled contour plot of pybamm arrays -# import pybamm from .quick_plot import ax_min, ax_max from pybamm.util import import_optional_dependency @@ -10,7 +7,8 @@ def plot2D(x, y, z, ax=None, show_plot=True, **kwargs): """ Generate a simple 2D plot. Calls `matplotlib.pyplot.contourf` with keyword arguments 'kwargs'. For a list of 'kwargs' see the - `matplotlib contourf documentation `_ + `matplotlib contourf documentation + `_ Parameters ---------- diff --git a/pybamm/solvers/algebraic_solver.py b/pybamm/solvers/algebraic_solver.py index bc711ff02a..5811e3b16d 100644 --- a/pybamm/solvers/algebraic_solver.py +++ b/pybamm/solvers/algebraic_solver.py @@ -26,8 +26,9 @@ class AlgebraicSolver(pybamm.BaseSolver): The tolerance for the solver (default is 1e-6). extra_options : dict, optional Any options to pass to the rootfinder. Vary depending on which method is chosen. - Please consult `SciPy documentation `_ for - details. + Please consult `SciPy documentation + `_ + for details. """ def __init__(self, method="lm", tol=1e-6, extra_options=None): diff --git a/pybamm/solvers/scipy_solver.py b/pybamm/solvers/scipy_solver.py index fb320f558d..9a66f5bc01 100644 --- a/pybamm/solvers/scipy_solver.py +++ b/pybamm/solvers/scipy_solver.py @@ -23,8 +23,9 @@ class ScipySolver(pybamm.BaseSolver): The tolerance to assert whether extrapolation occurs or not (default is 0). extra_options : dict, optional Any options to pass to the solver. - Please consult `SciPy documentation `_ for - details. + Please consult `SciPy documentation + `_ + for details. """ def __init__(