|
48 | 48 | INSIDE_FIELD1 = parser.get('file_headers', 'INSIDE_FIELD1') |
49 | 49 | INSIDE_FIELD2 = parser.get('file_headers', 'INSIDE_FIELD2') |
50 | 50 | INSIDE_FIELD3 = parser.get('file_headers', 'INSIDE_FIELD3') |
51 | | -INSIDE_FIELDS = tuple([INSIDE_FIELD1, INSIDE_FIELD2, INSIDE_FIELD3]) |
| 51 | +SENSOR_FIELDS = tuple([INSIDE_FIELD1, INSIDE_FIELD2, INSIDE_FIELD3]) |
52 | 52 |
|
53 | | -# THERMO_ID_FIELD is the string heading of corresponding field |
54 | | -# INSIDE_ID_INDEX gives the index of the INSIDE field containing device ID |
55 | | -# in the tuple INSIDE_FIELDS. |
56 | | -THERMO_ID_FIELD = INSIDE_FIELDS[int(parser.get('file_headers', 'INSIDE_ID_INDEX'))] |
| 53 | +# SENSOR_ID_FIELD is the string heading of corresponding field |
| 54 | +# SENSOR_ID_INDEX gives the index of the INSIDE field containing device ID |
| 55 | +# in the tuple SENSOR_FIELDS. |
| 56 | +SENSOR_ID_FIELD = SENSOR_FIELDS[int(parser.get('file_headers', 'SENSOR_ID_INDEX'))] |
57 | 57 |
|
58 | 58 | # Ints: 0-based positions of fields in raw file |
59 | | -INSIDE_ID_INDEX = int(parser.get('file_headers', 'INSIDE_ID_INDEX')) |
60 | | -INSIDE_LOG_DATE_INDEX = int(parser.get('file_headers', 'INSIDE_LOG_DATE_INDEX')) |
61 | | -INSIDE_DEGREES_INDEX = int(parser.get('file_headers', 'INSIDE_DEGREES_INDEX')) |
| 59 | +SENSOR_ID_INDEX = int(parser.get('file_headers', 'SENSOR_ID_INDEX')) |
| 60 | +SENSORS_LOG_DATE_INDEX = int(parser.get('file_headers', 'SENSORS_LOG_DATE_INDEX')) |
| 61 | +SENSORS_DATA_INDEX = int(parser.get('file_headers', 'SENSORS_DATA_INDEX')) |
62 | 62 | # INSIDE_TEMP_FIELD is the string heading of corresponding field |
63 | 63 | # INSIDE_TEMP_INDEX is index of field containing inside temperature |
64 | | -INSIDE_TEMP_FIELD = INSIDE_FIELDS[int(parser.get('file_headers', 'INSIDE_DEGREES_INDEX'))] |
| 64 | +INSIDE_TEMP_FIELD = SENSOR_FIELDS[int(parser.get('file_headers', 'SENSORS_DATA_INDEX'))] |
65 | 65 |
|
66 | 66 | # Outside observation file column names |
67 | 67 | OUTSIDE_FIELD1 = parser.get('file_headers', 'OUTSIDE_FIELD1') |
68 | 68 | OUTSIDE_FIELD2 = parser.get('file_headers', 'OUTSIDE_FIELD2') |
69 | 69 | OUTSIDE_FIELD3 = parser.get('file_headers', 'OUTSIDE_FIELD3') |
70 | | -OUTSIDE_FIELDS = tuple([OUTSIDE_FIELD1, OUTSIDE_FIELD2, OUTSIDE_FIELD3]) |
| 70 | +GEOSPATIAL_FIELDS = tuple([OUTSIDE_FIELD1, OUTSIDE_FIELD2, OUTSIDE_FIELD3]) |
71 | 71 |
|
72 | 72 | OUTSIDE_TIMESTAMP_LABEL = parser.get('file_headers', 'OUTSIDE_TIMESTAMP_LABEL') |
73 | 73 | OUTSIDE_DEGREES_LABEL = parser.get('file_headers', 'OUTSIDE_DEGREES_LABEL') |
74 | 74 | # Column heading that is unique to outside data file |
75 | | -UNIQUE_OUTSIDE_FIELD = OUTSIDE_FIELDS[int(parser.get('file_headers', 'UNIQUE_OUTSIDE_FIELD_INDEX'))] |
| 75 | +UNIQUE_GEOSPATIAL_FIELD = GEOSPATIAL_FIELDS[int(parser.get('file_headers', 'UNIQUE_GEOSPATIAL_FIELD_INDEX'))] |
76 | 76 | # Ints: 0-based positions of fields in raw files |
77 | | -OUTSIDE_ID_INDEX = int(parser.get('file_headers', 'OUTSIDE_ID_INDEX')) |
78 | | -OUTSIDE_LOG_DATE_INDEX = int(parser.get('file_headers', 'OUTSIDE_LOG_DATE_INDEX')) |
79 | | -OUTSIDE_DEGREES_INDEX = int(parser.get('file_headers', 'OUTSIDE_DEGREES_INDEX')) |
| 77 | +GEOSPATIAL_ID_INDEX = int(parser.get('file_headers', 'GEOSPATIAL_ID_INDEX')) |
| 78 | +GEOSPATIAL_LOG_DATE_INDEX = int(parser.get('file_headers', 'GEOSPATIAL_LOG_DATE_INDEX')) |
| 79 | +GEOSPATIAL_OBSERVATION_INDEX = int(parser.get('file_headers', 'GEOSPATIAL_OBSERVATION_INDEX')) |
80 | 80 |
|
81 | 81 | # Thermostat file metadata file column names |
82 | | -THERMOSTAT_DEVICE_ID = parser.get('file_headers', 'THERMOSTAT_DEVICE_ID') |
83 | | -THERMOSTAT_LOCATION_ID = parser.get('file_headers', 'THERMOSTAT_LOCATION_ID') |
84 | | -THERMOSTAT_ZIP_CODE = parser.get('file_headers', 'THERMOSTAT_ZIP_CODE') |
| 82 | +SENSOR_DEVICE_ID = parser.get('file_headers', 'SENSOR_DEVICE_ID') |
| 83 | +SENSOR_LOCATION_ID = parser.get('file_headers', 'SENSOR_LOCATION_ID') |
| 84 | +SENSOR_ZIP_CODE = parser.get('file_headers', 'SENSOR_ZIP_CODE') |
85 | 85 |
|
86 | 86 | # Postal file containing zip codes and other geographic metadata |
87 | 87 | POSTAL_FILE_ZIP = parser.get('file_headers', 'POSTAL_FILE_ZIP') |
|
112 | 112 | TEST_DIR = parser.get('test_files', 'TEST_DIR') |
113 | 113 |
|
114 | 114 | # Ints |
115 | | -THERMO_ID1 = int(parser.get('test_ids_and_states', 'THERMO_ID1')) |
116 | | -THERMO_ID2 = int(parser.get('test_ids_and_states', 'THERMO_ID2')) |
117 | | -THERMO_IDS = [THERMO_ID1, THERMO_ID2] |
| 115 | +SENSOR_ID1 = int(parser.get('test_ids_and_states', 'SENSOR_ID1')) |
| 116 | +SENSOR_ID2 = int(parser.get('test_ids_and_states', 'SENSOR_ID2')) |
| 117 | +SENSOR_IDS = [SENSOR_ID1, SENSOR_ID2] |
118 | 118 | LOCATION_ID1 = int(parser.get('test_ids_and_states', 'LOCATION_ID1')) |
119 | 119 | LOCATION_ID2 = int(parser.get('test_ids_and_states', 'LOCATION_ID2')) |
120 | 120 | LOCATION_IDS = [LOCATION_ID1, LOCATION_ID2] |
|
140 | 140 | if '2.7' in sys.version: |
141 | 141 | test_pickle_section += '_py2' |
142 | 142 |
|
143 | | -options_vals = ['CYCLES_PICKLE_FILE_OUT', 'INSIDE_PICKLE_FILE_OUT', 'OUTSIDE_PICKLE_FILE_OUT', |
144 | | - 'CYCLES_PICKLE_FILE', 'INSIDE_PICKLE_FILE', 'OUTSIDE_PICKLE_FILE', |
| 143 | +options_vals = ['CYCLES_PICKLE_FILE_OUT', 'SENSOR_PICKLE_FILE_OUT', 'GEOSPATIAL_PICKLE_FILE_OUT', |
| 144 | + 'CYCLES_PICKLE_FILE', 'SENSOR_PICKLE_FILE', 'GEOSPATIAL_PICKLE_FILE', |
145 | 145 | 'ALL_STATES_CYCLES_PICKLED_OUT', 'ALL_STATES_INSIDE_PICKLED_OUT', 'ALL_STATES_OUTSIDE_PICKLED_OUT', |
146 | 146 | 'ALL_STATES_CYCLES_PICKLED', 'ALL_STATES_INSIDE_PICKLED', 'ALL_STATES_OUTSIDE_PICKLED'] |
147 | 147 |
|
148 | 148 | for option_val in options_vals: |
149 | 149 | vars()[option_val] = os.path.join(TEST_DIR, parser.get(test_pickle_section, option_val)) |
150 | 150 |
|
151 | 151 | CYCLES_PICKLE_FILE_OUT = vars()['CYCLES_PICKLE_FILE_OUT'] |
152 | | -INSIDE_PICKLE_FILE_OUT = vars()['INSIDE_PICKLE_FILE_OUT'] |
153 | | -OUTSIDE_PICKLE_FILE_OUT = vars()['OUTSIDE_PICKLE_FILE_OUT'] |
| 152 | +SENSOR_PICKLE_FILE_OUT = vars()['SENSOR_PICKLE_FILE_OUT'] |
| 153 | +GEOSPATIAL_PICKLE_FILE_OUT = vars()['GEOSPATIAL_PICKLE_FILE_OUT'] |
154 | 154 |
|
155 | 155 | CYCLES_PICKLE_FILE = vars()['CYCLES_PICKLE_FILE'] |
156 | | -INSIDE_PICKLE_FILE = vars()['INSIDE_PICKLE_FILE'] |
157 | | -OUTSIDE_PICKLE_FILE = vars()['OUTSIDE_PICKLE_FILE'] |
| 156 | +SENSOR_PICKLE_FILE = vars()['SENSOR_PICKLE_FILE'] |
| 157 | +GEOSPATIAL_PICKLE_FILE = vars()['GEOSPATIAL_PICKLE_FILE'] |
158 | 158 |
|
159 | 159 | ALL_STATES_CYCLES_PICKLED_OUT = vars()['ALL_STATES_CYCLES_PICKLED_OUT'] |
160 | 160 | ALL_STATES_INSIDE_PICKLED_OUT = vars()['ALL_STATES_INSIDE_PICKLED_OUT'] |
|
0 commit comments