def generate_test_figures_2d_histogram(cls):
"""generate_test_figures_2d_histogram class method.
Generate a tuple of 2d histogram figures.
"""
# Create series. Will be divided by more than //2 when all plots are
# ready.
def dist_function01(): return np.random.normal(
size=cls.n_lines_test_pandas)
def dist_function02(): return np.random.randint(
0,
99999) * np.arange(cls.n_lines_test_pandas)
def dist_function03(): return np.random.randint(
0,
99999) * np.ones(cls.n_lines_test_pandas)
dist_functions = (dist_function01, dist_function02, dist_function03)
iterable_of_series = (pd.Series(np.random.choice(dist_functions)())
for _ in range(cls.n_graphical_tests//2))
# Create figures from series.
figures = tuple(map(
cls.figure_from_plot_function,
itertools.repeat(lambda x: sns.distplot(x, kde=False)),
iterable_of_series))
return figures
test_matplotlib_utilities.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录