Skip to content

Commit

Permalink
Closes #5: Rename ActivityStreamExperimentDashboard to ExperimentDash…
Browse files Browse the repository at this point in the history
…board.
  • Loading branch information
Marina Samuel committed Feb 12, 2018
1 parent 8bfddef commit 03c0991
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -2,11 +2,11 @@ lint:
flake8 stmoab/utils.py
flake8 stmoab/dashboards/SummaryDashboard.py
flake8 stmoab/dashboards/StatistcalDashboard.py
flake8 stmoab/dashboards/ActivityStreamExperimentDashboard.py
flake8 stmoab/dashboards/ExperimentDashboard.py
flake8 stmoab/tests/base.py
flake8 stmoab/tests/test_summary_dashboard.py
flake8 stmoab/test/test_utils.py
flake8 stmoab/tests/test_activity_stream_experiment_dashboard.py
flake8 stmoab/tests/test_experiment_dashboard.py
flake8 stmoab/tests/test_statistical_dashboard.py

test: lint
Expand Down
Expand Up @@ -5,7 +5,7 @@
from stmoab.SummaryDashboard import SummaryDashboard


class ActivityStreamExperimentDashboard(SummaryDashboard):
class ExperimentDashboard(SummaryDashboard):
# These are either strings representing both the measurement name
# event being measured or a key value pair: {<measurement_name>: <events>}
DEFAULT_EVENTS = ["CLICK", "SEARCH", "BLOCK", "DELETE",
Expand Down Expand Up @@ -41,7 +41,7 @@ def __init__(self, api_key, project_name, dash_name, exp_id,
start_date=None, end_date=None):
DASH_TITLE = "{project}: {dash}".format(
project=project_name, dash=dash_name)
super(ActivityStreamExperimentDashboard, self).__init__(
super(ExperimentDashboard, self).__init__(
api_key,
DASH_TITLE,
self.DEFAULT_EVENTS_TABLE,
Expand All @@ -54,7 +54,7 @@ def __init__(self, api_key, project_name, dash_name, exp_id,

self._params["experiment_id"] = self._experiment_id
self._logger.info((
"ActivityStreamExperimentDashboard: {name} "
"ExperimentDashboard: {name} "
"Initialization Complete".format(name=dash_name)))

def _get_title(self, template_name):
Expand Down Expand Up @@ -138,15 +138,15 @@ def _add_template_to_dashboard(self, template, chart_data, title,
viz_width, description):
# Remove graphs if they already exist.
if title in chart_data:
self._logger.info(("ActivityStreamExperimentDashboard: "
self._logger.info(("ExperimentDashboard: "
"{template} graph exists and is being removed"
.format(template=title)))

query_id = chart_data[title]["query_id"]
widget_id = chart_data[title]["widget_id"]
self.remove_graph_from_dashboard(widget_id, query_id)

self._logger.info(("ActivityStreamExperimentDashboard: "
self._logger.info(("ExperimentDashboard: "
"New {title} graph is being added"
.format(title=title)))
public_url = self._add_forked_query_to_dashboard(
Expand Down Expand Up @@ -175,7 +175,7 @@ def _apply_functions_to_templates(
for template in templates:
if "event" in template["name"].lower():
self._logger.info((
"ActivityStreamExperimentDashboard: "
"ExperimentDashboard: "
"Processing template '{template_name}'"
.format(template_name=template["name"])))
events_function(
Expand All @@ -186,7 +186,7 @@ def _apply_functions_to_templates(
title)
else:
self._logger.info((
"ActivityStreamExperimentDashboard: "
"ExperimentDashboard: "
"Processing template '{template_name}'"
.format(template_name=template["name"])))
public_url = general_function(template, chart_data)
Expand All @@ -197,7 +197,7 @@ def _apply_functions_to_templates(
def add_graph_templates(self, template_keyword,
events_list=None, events_table=None):
self._logger.info(
"ActivityStreamExperimentDashboard: Adding templates.")
"ExperimentDashboard: Adding templates.")

if events_list is None:
events_list = self.DEFAULT_EVENTS
Expand Down
6 changes: 3 additions & 3 deletions stmoab/StatisticalDashboard.py
Expand Up @@ -7,11 +7,11 @@

from stmoab.utils import upload_as_json, create_boto_transfer
from stmoab.constants import TTableSchema
from stmoab.ActivityStreamExperimentDashboard import (
ActivityStreamExperimentDashboard)
from stmoab.ExperimentDashboard import (
ExperimentDashboard)


class StatisticalDashboard(ActivityStreamExperimentDashboard):
class StatisticalDashboard(ExperimentDashboard):
TTABLE_DESCRIPTION = (
"Smaller p-values (e.g. <= 0.05) indicate a high "
"probability that the variants have different distributions. Alpha "
Expand Down
Expand Up @@ -2,23 +2,23 @@
import time

from stmoab.tests.base import AppTest
from stmoab.ActivityStreamExperimentDashboard import (
ActivityStreamExperimentDashboard)
from stmoab.ExperimentDashboard import (
ExperimentDashboard)


class TestActivityStreamExperimentDashboard(AppTest):
class TestExperimentDashboard(AppTest):

START_DATE = "2017-17-02"
END_DATE = time.strftime("%Y-%m-%d")
DASH_PROJECT = "Activity Stream Experiment"
DASH_PROJECT = "Test Experiment"
DASH_NAME = "Screenshots Long Cache"
EXPERIMENT_ID = "exp-014-screenshotsasync"

def get_dashboard(self, api_key):
self.mock_requests_get.return_value = self.get_mock_response()
self.mock_requests_post.return_value = self.get_mock_response()

dashboard = ActivityStreamExperimentDashboard(
dashboard = ExperimentDashboard(
self.API_KEY,
self.DASH_PROJECT,
self.DASH_NAME,
Expand Down

0 comments on commit 03c0991

Please sign in to comment.