-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!!
@@ -443,6 +470,16 @@ def get_worker_assignment_pairing(self, worker_id, assignment_id): | |||
results = c.fetchone() | |||
return results | |||
|
|||
def get_all_run_data(self, start=0, count=30): | |||
'''get all the run data for all task_group_ids.''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for all of our docstrings elsewhere we use double quotation marks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, good catch. Fixing!
parlai/mturk/webapp/server.py
Outdated
except Exception: | ||
req = {} | ||
|
||
# self.render( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left in by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup - fixed
parlai/mturk/webapp/server.py
Outdated
'level name or int (example: 20)') | ||
FLAGS = parser.parse_args() | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm pretty sure a call to _checkLevel already typechecks for you, so you can just always call that (and you don't neeed this try/except block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all looks great to me, just some minor comments
parlai/mturk/webapp/dev/app.jsx
Outdated
getColumnValue(header_name, item) { | ||
switch(header_name) { | ||
case 'run_id': return item.run_id; | ||
case 'run_status': return 'complete'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so run_status
is always complete for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should put a TODO here - I haven't been able to write the part that actually computes this value for a HIT yet
parlai/mturk/webapp/server.py
Outdated
def ensure_dir_exists(path): | ||
"""Make sure the parent dir exists for path so we can write a file.""" | ||
try: | ||
os.makedirs(os.path.dirname(path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you going for os.makedirs(os.path.dirname(path), exists_ok=True)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that works a lot better than this. Thanks for the note!
parlai/mturk/webapp/server.py
Outdated
results = self.data_handler.get_all_worker_data() | ||
processed_results = [] | ||
for res in results: | ||
processed_results.append(dict(zip(res.keys(), res))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you could use your row_to_dict
function from above for res
This PR lays the groundwork for the frontend webapp that will eventually be used to test UIs, launch tasks, manage qualifications, review work, manage workers, and more.
Right now it hooks up to the DB that is created when using the optional
use_db
flag. It can be used by runningnpm install; npm run dev; python server.py
from inside thewebapp
directory.Current features:
Provides views into runs and workers (currently it acts as a passive way to view metadata about runs).
Next up I'll be adding the reviewer interface, which will follow a change to how PMT stores data.