Skip to content

Commit

Permalink
Merge pull request #287 from SD2E/286-Issue-generating-new-golden-fil…
Browse files Browse the repository at this point in the history
…es-from-intentparser2.sd2e.org

286 issue generating new golden files from intentparser2.sd2e.org
  • Loading branch information
tramyn authored Oct 26, 2020
2 parents ca237e8 + 90b8ef4 commit a59bc10
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 32 deletions.
2 changes: 1 addition & 1 deletion intent_parser/table/controls_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _process_timepoint(self, cell, control):
timepoint = {dc_constants.VALUE: float(value_unit[dc_constants.VALUE]),
dc_constants.UNIT: value_unit[dc_constants.UNIT]}
result.append(timepoint)
control.add_field(dc_constants.TIMEPOINTS, timepoint)
control.add_field(dc_constants.TIMEPOINTS, result)
except TableException as err:
message = 'Controls table has invalid %s value: %s' % (intent_parser_constants.HEADER_CONTROL_TYPE_VALUE, err.get_message())
self._validation_errors.append(message)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"challenge_problem": "YEAST_STATES",
"doc_revision_id": "357",
"doc_revision_id": "570",
"experiment_id": "experiment.transcriptic.2020-05-04-YeastSTATES-1-0-Growth-Curves",
"experiment_reference": "YeastSTATES-1-0-Growth-Curves",
"experiment_reference_url": "https://docs.google.com/document/d/1fFcxyJyheMrzSsVoSsO6v7qHJKFf_0heIFtqEur02cg",
Expand Down Expand Up @@ -446,4 +446,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"challenge_problem": "YEAST_STATES",
"doc_revision_id": "442",
"doc_revision_id": "975",
"experiment_id": "experiment.transcriptic.2020-07-10-YeastSTATES-1-0-Time-Series-Round-1",
"experiment_reference": "YeastSTATES-1-0-Time-Series-Round-1",
"experiment_reference_url": "https://docs.google.com/document/d/1Mba6kqDila4W32Z46NEqXZFx868A3O36I9GIVOvMQ70",
"experiment_version": 1,
"lab": "Transcriptic",
"name": "YeastSTATES 1.0 Time Series Round 1",
"overnight_growth": {
"unit": "hour",
"value": 16.0
},
"parameters": [
{
"incubation_info.shaking": "high_speed",
Expand All @@ -28,6 +32,8 @@
}
],
"parent_git_path": "https://gitlab.sd2e.org/sd2program/cp-request/blob/master/input/structured_requests/YeastSTATES 1.0 Time Series Round 1.json",
"protocol": "TimeSeriesHTP",
"recovery_loops": [],
"runs": [
{
"measurements": [
Expand Down Expand Up @@ -75,7 +81,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -95,7 +105,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -115,7 +129,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -135,7 +153,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -156,7 +178,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -177,7 +203,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -198,7 +228,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -219,7 +253,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand Down Expand Up @@ -320,7 +358,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -340,7 +382,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -360,7 +406,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -380,7 +430,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -401,7 +455,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -422,7 +480,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -443,7 +505,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -464,7 +530,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand Down Expand Up @@ -925,7 +995,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -945,7 +1019,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -965,7 +1043,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -985,7 +1067,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/W303/1"
{
"lab_id": "name.transcriptic.W303",
"label": "W303",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/W303/1"
}
],
"timepoints": [
{
Expand All @@ -1006,7 +1092,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -1027,7 +1117,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -1048,7 +1142,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand All @@ -1069,7 +1167,11 @@
}
],
"strains": [
"https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
{
"lab_id": "name.transcriptic.UWBF_6390",
"label": "UWBF_6390",
"sbh_uri": "https://hub.sd2e.org/user/sd2e/design/UWBF_6390/1"
}
],
"timepoints": [
{
Expand Down Expand Up @@ -1237,4 +1339,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion intent_parser/tests/test_controls_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_table_with_1_timepoint(self):
self.assertEqual(1, len(control_result))
timepoint = control_result[0][dc_constants.TIMEPOINTS]
expected_timepoint = {dc_constants.VALUE: 8.0, dc_constants.UNIT: 'hour'}
self.assertEqual(timepoint, expected_timepoint)
self.assertEqual(expected_timepoint, timepoint[0])

def test_strains_with_uris(self):
ip_table = test_utils.create_fake_controls_table()
Expand Down
5 changes: 3 additions & 2 deletions intent_parser/tests/test_golden_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datetime import datetime
from unittest.mock import patch
import intent_parser.constants.intent_parser_constants as intent_parser_constants
import intent_parser.constants.google_api_constants as google_constants
import intent_parser.utils.intent_parser_utils as intent_parser_utils
import os
import json
Expand Down Expand Up @@ -61,8 +62,8 @@ def _compare_structured_requests(self, document):

doc_revision_id = golden_structured_request['doc_revision_id']

upload_mimetype = intent_parser_constants.GOOGLE_DOC_MIMETYPE
download_mimetype = intent_parser_constants.WORD_DOC_MIMETYPE
upload_mimetype = google_constants.GOOGLE_DOC_MIMETYPE
download_mimetype = google_constants.WORD_DOC_MIMETYPE

response = self.drive_accessor.get_file_with_revision(doc_id, doc_revision_id, download_mimetype)

Expand Down

0 comments on commit a59bc10

Please sign in to comment.