|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 21, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": {}, |
7 | 7 | "outputs": [], |
8 | 8 | "source": [ |
|
19 | 19 | }, |
20 | 20 | { |
21 | 21 | "cell_type": "code", |
22 | | - "execution_count": 22, |
| 22 | + "execution_count": 2, |
23 | 23 | "metadata": {}, |
24 | 24 | "outputs": [], |
25 | 25 | "source": [ |
26 | | - "files = [\"C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP.xlsx\", \"C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP_trans.xlsx\"]\n", |
| 26 | + "files = [\"../tests/test_files/ExpNOTs_GFP.xlsx\", \"../tests/test_files/ExpNOTs_GFP_trans.xlsx\"]\n", |
27 | 27 | "sheet_name = \"Table All Cycles\"\n", |
28 | 28 | "time_col_name = \"Time\"\n", |
29 | | - "data_cols_offset = 11\n", |
| 29 | + "data_cols_offset = 2\n", |
30 | 30 | "\n", |
31 | | - "XDC_file_name = \"C:/Users/smf12/SPUR/Tricahue/tests/test_files/xperimental_data_connector_template.xlsx\"" |
| 31 | + "XDC_file_name = \"../tests/test_files/xperimental_data_connector_template.xlsx\"" |
32 | 32 | ] |
33 | 33 | }, |
34 | 34 | { |
35 | 35 | "cell_type": "code", |
36 | | - "execution_count": 23, |
| 36 | + "execution_count": 3, |
37 | 37 | "metadata": {}, |
38 | 38 | "outputs": [], |
39 | 39 | "source": [ |
|
43 | 43 | }, |
44 | 44 | { |
45 | 45 | "cell_type": "code", |
46 | | - "execution_count": 24, |
| 46 | + "execution_count": 4, |
47 | 47 | "metadata": {}, |
48 | 48 | "outputs": [], |
49 | 49 | "source": [ |
| 50 | + "# get sample data from files\n", |
50 | 51 | "sample_list = xde.generateSampleData(files, sheet_name, time_col_name, data_cols_offset)\n", |
51 | | - "# sample_list" |
| 52 | + "# print(sample_list)" |
52 | 53 | ] |
53 | 54 | }, |
54 | 55 | { |
55 | 56 | "cell_type": "code", |
56 | | - "execution_count": 25, |
| 57 | + "execution_count": 5, |
57 | 58 | "metadata": {}, |
58 | 59 | "outputs": [ |
59 | 60 | { |
60 | 61 | "name": "stdout", |
61 | 62 | "output_type": "stream", |
62 | 63 | "text": [ |
63 | | - "['C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP.xlsx', 'C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP_trans.xlsx']\n" |
| 64 | + "['../tests/test_files/ExpNOTs_GFP.xlsx', '../tests/test_files/ExpNOTs_GFP_trans.xlsx']\n" |
64 | 65 | ] |
65 | 66 | } |
66 | 67 | ], |
67 | 68 | "source": [ |
| 69 | + "# build pandas DataFrame from the sample data\n", |
68 | 70 | "output_df = xde.buildFinalDF(files,\n", |
69 | 71 | " sample_list, \n", |
70 | 72 | " time_col_name, \n", |
71 | 73 | " data_cols_offset, \n", |
72 | 74 | " num_rows_btwn_data=0, \n", |
73 | 75 | " sheet_to_read_from=sheet_name)\n", |
74 | | - "# output_df.head()" |
| 76 | + "# print(output_df.head())" |
75 | 77 | ] |
76 | 78 | }, |
77 | 79 | { |
78 | 80 | "cell_type": "code", |
79 | | - "execution_count": 26, |
| 81 | + "execution_count": 6, |
80 | 82 | "metadata": {}, |
81 | 83 | "outputs": [], |
82 | 84 | "source": [ |
| 85 | + "# write the DataFrame to the XDC file in the 'Measurement' sheet\n", |
83 | 86 | "xde.writeToMeasurements(XDC_file_name, output_df)" |
84 | 87 | ] |
85 | 88 | }, |
86 | 89 | { |
87 | 90 | "cell_type": "code", |
88 | | - "execution_count": 27, |
| 91 | + "execution_count": 7, |
89 | 92 | "metadata": {}, |
90 | 93 | "outputs": [ |
91 | 94 | { |
|
123 | 126 | " <td>Sample1</td>\n", |
124 | 127 | " <td>Signal1</td>\n", |
125 | 128 | " <td>0 h</td>\n", |
126 | | - " <td>740</td>\n", |
| 129 | + " <td>30</td>\n", |
127 | 130 | " </tr>\n", |
128 | 131 | " <tr>\n", |
129 | 132 | " <th>1</th>\n", |
130 | 133 | " <td>Measurement1</td>\n", |
131 | 134 | " <td>Sample1</td>\n", |
132 | 135 | " <td>Signal1</td>\n", |
133 | 136 | " <td>0 h 4 min</td>\n", |
134 | | - " <td>754</td>\n", |
| 137 | + " <td>30</td>\n", |
135 | 138 | " </tr>\n", |
136 | 139 | " <tr>\n", |
137 | 140 | " <th>2</th>\n", |
138 | 141 | " <td>Measurement2</td>\n", |
139 | 142 | " <td>Sample1</td>\n", |
140 | 143 | " <td>Signal1</td>\n", |
141 | 144 | " <td>0 h 8 min</td>\n", |
142 | | - " <td>770</td>\n", |
| 145 | + " <td>28</td>\n", |
143 | 146 | " </tr>\n", |
144 | 147 | " <tr>\n", |
145 | 148 | " <th>3</th>\n", |
146 | 149 | " <td>Measurement3</td>\n", |
147 | 150 | " <td>Sample1</td>\n", |
148 | 151 | " <td>Signal1</td>\n", |
149 | 152 | " <td>0 h 12 min</td>\n", |
150 | | - " <td>773</td>\n", |
| 153 | + " <td>29</td>\n", |
151 | 154 | " </tr>\n", |
152 | 155 | " <tr>\n", |
153 | 156 | " <th>4</th>\n", |
154 | 157 | " <td>Measurement4</td>\n", |
155 | 158 | " <td>Sample1</td>\n", |
156 | 159 | " <td>Signal1</td>\n", |
157 | 160 | " <td>0 h 16 min</td>\n", |
158 | | - " <td>777</td>\n", |
| 161 | + " <td>30</td>\n", |
159 | 162 | " </tr>\n", |
160 | 163 | " </tbody>\n", |
161 | 164 | "</table>\n", |
162 | 165 | "</div>" |
163 | 166 | ], |
164 | 167 | "text/plain": [ |
165 | 168 | " Measurement ID Sample ID Signal ID Time Value\n", |
166 | | - "0 Measurement0 Sample1 Signal1 0 h 740\n", |
167 | | - "1 Measurement1 Sample1 Signal1 0 h 4 min 754\n", |
168 | | - "2 Measurement2 Sample1 Signal1 0 h 8 min 770\n", |
169 | | - "3 Measurement3 Sample1 Signal1 0 h 12 min 773\n", |
170 | | - "4 Measurement4 Sample1 Signal1 0 h 16 min 777" |
| 169 | + "0 Measurement0 Sample1 Signal1 0 h 30\n", |
| 170 | + "1 Measurement1 Sample1 Signal1 0 h 4 min 30\n", |
| 171 | + "2 Measurement2 Sample1 Signal1 0 h 8 min 28\n", |
| 172 | + "3 Measurement3 Sample1 Signal1 0 h 12 min 29\n", |
| 173 | + "4 Measurement4 Sample1 Signal1 0 h 16 min 30" |
171 | 174 | ] |
172 | 175 | }, |
173 | | - "execution_count": 27, |
| 176 | + "execution_count": 7, |
174 | 177 | "metadata": {}, |
175 | 178 | "output_type": "execute_result" |
176 | 179 | } |
177 | 180 | ], |
178 | 181 | "source": [ |
| 182 | + "# for testing; read the 'Measurement' sheet from the XDC excel file\n", |
179 | 183 | "xls = pd.ExcelFile(XDC_file_name)\n", |
180 | 184 | "measurement = pd.read_excel(xls, 'Measurement')\n", |
181 | 185 | "measurement.head()" |
|
0 commit comments