This commit is contained in:
allegroai 2020-11-29 23:30:25 +02:00
parent 89f5e78a93
commit da32cd8f90
10 changed files with 38 additions and 17 deletions

View File

@ -1,4 +1,3 @@
import os
import shutil
import tarfile
from random import random

View File

@ -367,7 +367,7 @@ class Task(_Task):
.. code-block:: py
auto_connect_streams={'stdout': True, 'stderr': True`, 'logging': False}
auto_connect_streams={'stdout': True, 'stderr': True, 'logging': False}
:return: The main execution Task (Task context).
"""

View File

@ -13,3 +13,8 @@ from __future__ import absolute_import
from .renderer import PlotlyRenderer
from .mplexporter import Exporter
__all__ = [
"PlotlyRenderer",
"Exporter"
]

View File

@ -1,2 +1,7 @@
from .renderers import Renderer
from .exporter import Exporter
__all__ = [
"Renderer",
"Exporter"
]

View File

@ -9,9 +9,10 @@ import io
from . import utils
import matplotlib
from matplotlib import transforms, collections
from matplotlib import transforms, collections # noqa: F401
from matplotlib.backends.backend_agg import FigureCanvasAgg
class Exporter(object):
"""Matplotlib Exporter
@ -43,7 +44,7 @@ class Exporter(object):
# Calling savefig executes the draw() command, putting elements
# in the correct place.
if fig.canvas is None:
canvas = FigureCanvasAgg(fig)
canvas = FigureCanvasAgg(fig) # noqa: F841
fig.savefig(io.BytesIO(), format='png', dpi=fig.dpi)
if self.close_mpl:
import matplotlib.pyplot as plt

View File

@ -10,3 +10,13 @@ from .base import Renderer
from .vega_renderer import VegaRenderer, fig_to_vega
from .vincent_renderer import VincentRenderer, fig_to_vincent
from .fake_renderer import FakeRenderer, FullFakeRenderer
__all__ = [
"Renderer",
"VegaRenderer",
"fig_to_vega",
"VincentRenderer",
"fig_to_vincent",
"FakeRenderer",
"FullFakeRenderer"
]

View File

@ -37,6 +37,7 @@ def _many_to_one(input_dict):
for keys, val in input_dict.items()
for key in keys)
LINESTYLES = _many_to_one({('solid', '-', (None, None)): 'none',
('dashed', '--'): "6,6",
('dotted', ':'): "2,2",

View File

@ -83,7 +83,7 @@ def convert_dash(mpl_dash):
def convert_path(path):
verts = path[0] # may use this later
verts = path[0] # noqa: F841, may use this later
code = tuple(path[1])
if code in PATH_MAP:
return PATH_MAP[code]
@ -542,7 +542,7 @@ def mpl_dates_to_datestrings(dates, mpl_formatter):
try:
dates = matplotlib.dates.epoch2num([date * 24 * 60 * 60 for date in dates])
dates = matplotlib.dates.num2date(dates)
except:
except: # noqa: E722
return _dates
# the rest of mpl dates are in floating point days since
@ -551,7 +551,7 @@ def mpl_dates_to_datestrings(dates, mpl_formatter):
else:
try:
dates = matplotlib.dates.num2date(dates)
except:
except: # noqa: E722
return _dates
time_stings = [