{"action":"created","comment":{"url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/comments/224144983","pull_request_review_id":163440310,"id":224144983,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDE0NDk4Mw==","diff_hunk":"@@ -1,44 +1,85 @@\n import time\n+import logging\n+\n+from lsst.ts.scheduler import Driver\n+from lsst.ts.scheduler.sal_utils import SALUtils\n+\n from SALPY_scheduler import SAL_scheduler, scheduler_logevent_validSettingsC\n+from scheduler_config.constants import CONFIG_DIRECTORY, CONFIG_DIRECTORY_PATH\n+\n+try:\n+    from git import Repo\n+except ImportError:\n+    raise ImportError(\"gitpython not installed. Please install it with 'pip install gitpython' before proceeding.\")\n \n DEFAULT_STATE = \"OFFLINE\"\n \n class Model():\n-    \"\"\"The model contains all business logic related to the scheduler.\n-\n-    The Model class is designed to solely interact with an interface object\n-    called Driver. This is so that we can \"plug and play\" different scheduling\n-    algorithms as long as they can interact with the Driver. Most of the methods\n-    called on this class are called by the state machine, assuming we are in\n-    operations mode. In order for any model to interact with the state machine\n-    from ts_statemachine it must have an attribute \"state\". The \"state\" attribute is\n-    used to store the current state of the state machine.\n+    \"\"\"A class that contains that contains the necessary attributes and methods\n+    for a statemachine to control the Scheduling algorith.\n+\n+    Parameters\n+    ----------\n+    driver : ``module``\n+        Optional driver for the Model to use. This allows external developers\n+        to plug in thier own scheduling algorithms. External Driver's must\n+        comply with the the Driver interface here \n+        https://docs.google.com/document/d/1wQ467QGqVP2e4iXOKcW2slLMgOzI_1Qk284b1gDGqaI\n+\n+    Notes\n+    -----\n+    The Model is the highest level interface for the State Machine to interact\n+    with. The Scheduler State Machine has multiple states. Rather than having\n+    to import many objects from different locations we import this Model object.\n+    Allowing the Scheduler State Machine one unified object to make all its\n+    calls from.\n     \"\"\"\n \n-    def __init__(self):\n+    def __init__(self, driver = Driver()):\n+        self._current_state = DEFAULT_STATE\n+        self._previous_state = DEFAULT_STATE","path":"python/lsst/ts/scheduler/model.py","position":50,"original_position":50,"commit_id":"60e5368bbb14120821c334a2c7e6f4092853b699","original_commit_id":"60e5368bbb14120821c334a2c7e6f4092853b699","user":{"login":"tribeiro","id":2581045,"node_id":"MDQ6VXNlcjI1ODEwNDU=","avatar_url":"https://avatars2.githubusercontent.com/u/2581045?v=4","gravatar_id":"","url":"https://api.github.com/users/tribeiro","html_url":"https://github.com/tribeiro","followers_url":"https://api.github.com/users/tribeiro/followers","following_url":"https://api.github.com/users/tribeiro/following{/other_user}","gists_url":"https://api.github.com/users/tribeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/tribeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tribeiro/subscriptions","organizations_url":"https://api.github.com/users/tribeiro/orgs","repos_url":"https://api.github.com/users/tribeiro/repos","events_url":"https://api.github.com/users/tribeiro/events{/privacy}","received_events_url":"https://api.github.com/users/tribeiro/received_events","type":"User","site_admin":false},"body":"Maybe these should be `None` at the initialization?","created_at":"2018-10-10T16:12:22Z","updated_at":"2018-10-10T16:20:11Z","html_url":"https://github.com/lsst-ts/ts_scheduler/pull/13#discussion_r224144983","pull_request_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/comments/224144983"},"html":{"href":"https://github.com/lsst-ts/ts_scheduler/pull/13#discussion_r224144983"},"pull_request":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13","id":220786799,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzg2Nzk5","html_url":"https://github.com/lsst-ts/ts_scheduler/pull/13","diff_url":"https://github.com/lsst-ts/ts_scheduler/pull/13.diff","patch_url":"https://github.com/lsst-ts/ts_scheduler/pull/13.patch","issue_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/13","number":13,"state":"open","locked":false,"title":"Feature/andrewheyer/valid settings","user":{"login":"andrewbheyer","id":31416633,"node_id":"MDQ6VXNlcjMxNDE2NjMz","avatar_url":"https://avatars2.githubusercontent.com/u/31416633?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewbheyer","html_url":"https://github.com/andrewbheyer","followers_url":"https://api.github.com/users/andrewbheyer/followers","following_url":"https://api.github.com/users/andrewbheyer/following{/other_user}","gists_url":"https://api.github.com/users/andrewbheyer/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewbheyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewbheyer/subscriptions","organizations_url":"https://api.github.com/users/andrewbheyer/orgs","repos_url":"https://api.github.com/users/andrewbheyer/repos","events_url":"https://api.github.com/users/andrewbheyer/events{/privacy}","received_events_url":"https://api.github.com/users/andrewbheyer/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-05T18:28:26Z","updated_at":"2018-10-10T16:20:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ee8ed2d5271bde4b05b3c91e5381756d9d149f2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13/commits","review_comments_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13/comments","review_comment_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/13/comments","statuses_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/statuses/60e5368bbb14120821c334a2c7e6f4092853b699","head":{"label":"lsst-ts:feature/andrewheyer/validSettings","ref":"feature/andrewheyer/validSettings","sha":"60e5368bbb14120821c334a2c7e6f4092853b699","user":{"login":"lsst-ts","id":13056264,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDU2MjY0","avatar_url":"https://avatars2.githubusercontent.com/u/13056264?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst-ts","html_url":"https://github.com/lsst-ts","followers_url":"https://api.github.com/users/lsst-ts/followers","following_url":"https://api.github.com/users/lsst-ts/following{/other_user}","gists_url":"https://api.github.com/users/lsst-ts/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst-ts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst-ts/subscriptions","organizations_url":"https://api.github.com/users/lsst-ts/orgs","repos_url":"https://api.github.com/users/lsst-ts/repos","events_url":"https://api.github.com/users/lsst-ts/events{/privacy}","received_events_url":"https://api.github.com/users/lsst-ts/received_events","type":"Organization","site_admin":false},"repo":{"id":56880668,"node_id":"MDEwOlJlcG9zaXRvcnk1Njg4MDY2OA==","name":"ts_scheduler","full_name":"lsst-ts/ts_scheduler","private":false,"owner":{"login":"lsst-ts","id":13056264,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDU2MjY0","avatar_url":"https://avatars2.githubusercontent.com/u/13056264?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst-ts","html_url":"https://github.com/lsst-ts","followers_url":"https://api.github.com/users/lsst-ts/followers","following_url":"https://api.github.com/users/lsst-ts/following{/other_user}","gists_url":"https://api.github.com/users/lsst-ts/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst-ts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst-ts/subscriptions","organizations_url":"https://api.github.com/users/lsst-ts/orgs","repos_url":"https://api.github.com/users/lsst-ts/repos","events_url":"https://api.github.com/users/lsst-ts/events{/privacy}","received_events_url":"https://api.github.com/users/lsst-ts/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/lsst-ts/ts_scheduler","description":null,"fork":false,"url":"https://api.github.com/repos/lsst-ts/ts_scheduler","forks_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/forks","keys_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/teams","hooks_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/hooks","issue_events_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/events","assignees_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/tags","blobs_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/languages","stargazers_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/stargazers","contributors_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/contributors","subscribers_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/subscribers","subscription_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/subscription","commits_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/merges","archive_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/downloads","issues_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/labels{/name}","releases_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/releases{/id}","deployments_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/deployments","created_at":"2016-04-22T19:37:59Z","updated_at":"2018-10-09T16:13:35Z","pushed_at":"2018-10-09T18:14:31Z","git_url":"git://github.com/lsst-ts/ts_scheduler.git","ssh_url":"git@github.com:lsst-ts/ts_scheduler.git","clone_url":"https://github.com/lsst-ts/ts_scheduler.git","svn_url":"https://github.com/lsst-ts/ts_scheduler","homepage":null,"size":2106,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"lsst-ts:master","ref":"master","sha":"f82e5242af5e10c91d9415f9c5baa8ca2f0375a3","user":{"login":"lsst-ts","id":13056264,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDU2MjY0","avatar_url":"https://avatars2.githubusercontent.com/u/13056264?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst-ts","html_url":"https://github.com/lsst-ts","followers_url":"https://api.github.com/users/lsst-ts/followers","following_url":"https://api.github.com/users/lsst-ts/following{/other_user}","gists_url":"https://api.github.com/users/lsst-ts/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst-ts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst-ts/subscriptions","organizations_url":"https://api.github.com/users/lsst-ts/orgs","repos_url":"https://api.github.com/users/lsst-ts/repos","events_url":"https://api.github.com/users/lsst-ts/events{/privacy}","received_events_url":"https://api.github.com/users/lsst-ts/received_events","type":"Organization","site_admin":false},"repo":{"id":56880668,"node_id":"MDEwOlJlcG9zaXRvcnk1Njg4MDY2OA==","name":"ts_scheduler","full_name":"lsst-ts/ts_scheduler","private":false,"owner":{"login":"lsst-ts","id":13056264,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDU2MjY0","avatar_url":"https://avatars2.githubusercontent.com/u/13056264?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst-ts","html_url":"https://github.com/lsst-ts","followers_url":"https://api.github.com/users/lsst-ts/followers","following_url":"https://api.github.com/users/lsst-ts/following{/other_user}","gists_url":"https://api.github.com/users/lsst-ts/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst-ts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst-ts/subscriptions","organizations_url":"https://api.github.com/users/lsst-ts/orgs","repos_url":"https://api.github.com/users/lsst-ts/repos","events_url":"https://api.github.com/users/lsst-ts/events{/privacy}","received_events_url":"https://api.github.com/users/lsst-ts/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/lsst-ts/ts_scheduler","description":null,"fork":false,"url":"https://api.github.com/repos/lsst-ts/ts_scheduler","forks_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/forks","keys_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/teams","hooks_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/hooks","issue_events_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/events","assignees_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/tags","blobs_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/languages","stargazers_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/stargazers","contributors_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/contributors","subscribers_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/subscribers","subscription_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/subscription","commits_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/merges","archive_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/downloads","issues_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/labels{/name}","releases_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/releases{/id}","deployments_url":"https://api.github.com/repos/lsst-ts/ts_scheduler/deployments","created_at":"2016-04-22T19:37:59Z","updated_at":"2018-10-09T16:13:35Z","pushed_at":"2018-10-09T18:14:31Z","git_url":"git://github.com/lsst-ts/ts_scheduler.git","ssh_url":"git@github.com:lsst-ts/ts_scheduler.git","clone_url":"https://github.com/lsst-ts/ts_scheduler.git","svn_url":"https://github.com/lsst-ts/ts_scheduler","homepage":null,"size":2106,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13"},"html":{"href":"https://github.com/lsst-ts/ts_scheduler/pull/13"},"issue":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/13"},"comments":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/lsst-ts/ts_scheduler/statuses/60e5368bbb14120821c334a2c7e6f4092853b699"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tribeiro"}}