message: Code review: Do not print warnings on import gudhi
diff: from os import path
  from math import isfinite
  import numpy as np
  -from functools import lru_cache
  from gudhi.reader_utils import read_persistence_intervals_in_dimension
  from gudhi.reader_utils import read_persistence_intervals_grouped_by_dimension
  @@ -20,20 +19,7 @@ __author__ = "Vincent Rouvreau, Bertrand Michel, Theo Lacombe"
  __copyright__ = "Copyright (C) 2016 Inria"
  __license__ = "MIT"
  -@lru_cache(maxsize=1)
  -def _matplotlib_can_use_tex():
  - """This function returns True if matplotlib can deal with LaTeX, False otherwise.
  - The returned value is cached.
  - """
  - try:
  - from matplotlib import checkdep_usetex
  - return checkdep_usetex(True)
  - except ImportError:
  - print("This function is not available, you may be missing matplotlib.")
  -
  -
  -_gudhi_matplotlib_use_tex = _matplotlib_can_use_tex()
  -
  +_gudhi_matplotlib_use_tex = True
  def __min_birth_max_death(persistence, band=0.0):
  """This function returns (min_birth, max_death) from the persistence.
  @@ -71,6 +57,16 @@ def _array_handler(a):
  else:
  return a
  +def _matplotlib_can_use_tex():
  + """This function returns True if matplotlib can deal with LaTeX, False otherwise.
  + The returned value is cached.
  + """
  + try:
  + from matplotlib import checkdep_usetex
  + return checkdep_usetex(True)
  + except ImportError:
  + print("This function is not available, you may be missing matplotlib.")
  +
  def plot_persistence_barcode(
  persistence=[],
  @@ -121,7 +117,7 @@ def plot_persistence_barcode(
  import matplotlib.pyplot as plt
  import matplotlib.patches as mpatches
  from matplotlib import rc
  - if _gudhi_matplotlib_use_tex:
  + if _gudhi_matplotlib_use_tex and _matplotlib_can_use_tex():
  plt.rc('text', usetex=True)
  plt.rc('font', family='serif')
  else:
  @@ -270,7 +266,7 @@ def plot_persistence_diagram(
  import matplotlib.pyplot as plt
  import matplotlib.patches as mpatches
  from matplotlib import rc
  - if _gudhi_matplotlib_use_tex:
  + if _gudhi_matplotlib_use_tex and _matplotlib_can_use_tex():
  plt.rc('text', usetex=True)
  plt.rc('font', family='serif')
  else:
  @@ -446,7 +442,7 @@ def plot_persistence_density(
  import matplotlib.patches as mpatches
  from scipy.stats import kde
  from matplotlib import rc
  - if _gudhi_matplotlib_use_tex:
  + if _gudhi_matplotlib_use_tex and _matplotlib_can_use_tex():
  plt.rc('text', usetex=True)
  plt.rc('font', family='serif')
  else:
  