Пример #1
0
 def test_plotting(self):
     """
     Testing the fit function
     and the image data when data are available
     """
     plot = ScatterPlot(1)
     plot.set_data([0, 1], [0, 1])
     img_data = plot.get_image_data()
     assert plot.get_fit_function()
     assert img_data
Пример #2
0
 def test_plotting(self):
     """
     Testing the fit function
     and the image data when data are available
     """
     plot = ScatterPlot(1)
     plot.set_data([0, 1], [0, 1])
     img_data = plot.get_image_data()
     assert plot.get_fit_function()
     assert img_data
Пример #3
0
 def test_plotting_empty(self):
     """
     Testing the fit function
     and the image data when no data is available
     or when weather data are random
     and thus not among the allowed discrete values
     """
     plot = ScatterPlot(1)
     img_data = plot.get_image_data()
     assert not(plot.get_fit_function())
     plot.set_data([random.random(), random.random()], [random.random(), random.random()])
     assert not(plot.get_fit_function())
     assert img_data
Пример #4
0
 def test_plotting_empty(self):
     """
     Testing the fit function
     and the image data when no data is available
     or when weather data are random
     and thus not among the allowed discrete values
     """
     plot = ScatterPlot(1)
     img_data = plot.get_image_data()
     assert not (plot.get_fit_function())
     plot.set_data([random.random(), random.random()],
                   [random.random(), random.random()])
     assert not (plot.get_fit_function())
     assert img_data
Пример #5
0
def plot():
    """
    This page displays a scatter plot of all gathered tweets
    The x-axis is the sentiment value.
    The y-axis is the weather value.
    The closer points are to the 'identity' line,
    the closer they fit our hypothesis
    """
    scatter_plot = ScatterPlot(1)
    scatter_plot.load_data()
    img_data = scatter_plot.get_image_data()
    refresh = request.args.get('refresh', 0, type=int)
    if refresh:
        return img_data
    return render_template('plot.html', data=img_data)
Пример #6
0
def plot():
    """
    This page displays a scatter plot of all gathered tweets
    The x-axis is the sentiment value.
    The y-axis is the weather value.
    The closer points are to the 'identity' line,
    the closer they fit our hypothesis
    """
    scatter_plot = ScatterPlot(1)
    scatter_plot.load_data()
    img_data = scatter_plot.get_image_data()
    refresh = request.args.get('refresh', 0, type=int)
    if refresh:
        return img_data
    return render_template('plot.html', data=img_data)