Repository: vogt4nick/dequindre

Issue:
Rework schedule methods
`Dequindre.get_task_priorities` and `Dequindre.get_priorities` is a little opaque. 

### Proposal A

We rename `get_task_priorities` to `get_task_schedules`, and rename `get_priorities` to `get_schedules`. They'll return the same values, but the new names will be more obvious to users. 

### Proposal B

We keep `get_task_priorities` and `get_priorities` as they are. We introduce `get_schedules` which returns an ordered list of when the tasks will be run at runtime. 

Proposal A sounds best right now, but we should stew on it a bit before making a final decision. 

Discussion:

Patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index a13f5ef..b6ca05f 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.5.0.dev0
+current_version = 0.5.0.dev1
 commit = True
 tag = False
 parse = (?P<major>\d+)
diff --git a/dequindre/__init__.py b/dequindre/__init__.py
index ad99842..b8e0a67 100644
--- a/dequindre/__init__.py
+++ b/dequindre/__init__.py
@@ -16,7 +16,7 @@ from subprocess import check_output, CalledProcessError
 from time import sleep
 
 
-__version__ = '0.5.0.dev0'
+__version__ = '0.5.0.dev1'
 
 
 class CyclicGraphError(Exception):
@@ -360,8 +360,8 @@ class Dequindre:
         return None
 
 
-    def get_task_priorities(self) -> Dict[Task, int]:
-        """Define priority level for each task
+    def get_task_schedules(self) -> Dict[Task, int]:
+        """Define schedule priority level for each task
 
         Example:
             make_tea -> pour_tea -> drink_tea will give the dict
@@ -388,8 +388,8 @@ class Dequindre:
         return task_priority
 
 
-    def get_priorities(self) -> Dict[int, Set[Task]]:
-        """Define tasks for each priority level.
+    def get_schedules(self) -> Dict[int, Set[Task]]:
+        """Schedule tasks by priority level.
 
         Example:
             make_tea -> pour_tea -> drink_tea will give the dict
@@ -400,7 +400,7 @@ class Dequindre:
             }
         """
         priorities = defaultdict(set)
-        task_priorities = self.get_task_priorities()
+        task_priorities = self.get_task_schedules()
         for k, v in task_priorities.items():
             priorities[v].add(k)
 
@@ -425,7 +425,7 @@ class Dequindre:
     def run_tasks(self):
         """Run all tasks on the DAG"""
         self.refresh_dag()  # refresh just in case
-        priorities = self.get_priorities()
+        priorities = self.get_schedules()
 
         for k, tasks in priorities.items():
             for task in tasks:
diff --git a/readme.md b/readme.md
index 6215e39..1e03959 100644
--- a/readme.md
+++ b/readme.md
@@ -37,7 +37,7 @@ Dequindre allows dynamic configuration with Python. By example, we may program t
 >>>
 >>> # run tasks
 >>> dq = Dequindre(dag, check_conda=False)
->>> dq = dq.get_priorities()
+>>> dq = dq.get_schedules()
 defaultdict(<class 'set'>, {
     1: {Task(make_tea.py), Task(prep_infuser.py)},
     2: {Task(boil_water.py)},


Test patch:
diff --git a/dequindre/tests/test_Dequindre.py b/dequindre/tests/test_Dequindre.py
index a48eb58..82b8b1c 100644
--- a/dequindre/tests/test_Dequindre.py
+++ b/dequindre/tests/test_Dequindre.py
@@ -68,7 +68,7 @@ def test__Dequindre_refresh_dag():
         assert t == nt
 
 
-def test__Dequindre_get_task_priorities():
+def test__Dequindre_get_task_schedules():
     A = Task('A.py', 'test-env')
     B = Task('B.py', 'test-env')
     C = Task('C.py', 'test-env')
@@ -78,7 +78,7 @@ def test__Dequindre_get_task_priorities():
     dag.add_edges({A:B, B:C})
     dq = Dequindre(dag)
 
-    priorities = dq.get_task_priorities()
+    priorities = dq.get_task_schedules()
 
     testable = {hash(k): v for k, v in priorities.items()}
     assert testable == {
@@ -89,7 +89,7 @@ def test__Dequindre_get_task_priorities():
     }
 
 
-def test__Dequindre_get_priorities():
+def test__Dequindre_get_schedules():
     A = Task('A.py', 'test-env')
     B = Task('B.py', 'test-env')
     C = Task('C.py', 'test-env')
@@ -99,7 +99,7 @@ def test__Dequindre_get_priorities():
     dag.add_edges({A:B, B:C})
     dq = Dequindre(dag)
 
-    priorities = dq.get_priorities()
+    priorities = dq.get_schedules()
     testable = {}
 
     # build a testable result dict