|
13 | 13 | # Things xchembku provides. |
14 | 14 | from xchembku_api.datafaces.context import Context as XchembkuDatafaceClientContext |
15 | 15 | from xchembku_api.datafaces.datafaces import xchembku_datafaces_get_default |
16 | | -from xchembku_api.models.crystal_plate_model import CrystalPlateModel |
17 | | -from xchembku_api.models.crystal_well_autolocation_model import ( |
18 | | - CrystalWellAutolocationModel, |
19 | | -) |
20 | | -from xchembku_api.models.crystal_well_droplocation_model import ( |
21 | | - CrystalWellDroplocationModel, |
22 | | -) |
23 | | -from xchembku_api.models.crystal_well_model import CrystalWellModel |
24 | 16 |
|
25 | 17 | # Client context creator. |
26 | 18 | from echolocator_api.guis.context import Context as GuiClientContext |
@@ -108,26 +100,15 @@ async def __run_part1(self, constants, output_directory): |
108 | 100 |
|
109 | 101 | await self.__request_initial() |
110 | 102 |
|
111 | | - # Make the plate on which the wells reside. |
112 | | - visit = "cm00001-1" |
113 | | - crystal_plate_model = CrystalPlateModel( |
114 | | - formulatrix__plate__id=10, |
115 | | - barcode="98ab", |
116 | | - visit=visit, |
117 | | - ) |
118 | | - |
119 | | - await xchembku.upsert_crystal_plates([crystal_plate_model]) |
120 | | - self.__crystal_plate_uuid = crystal_plate_model.uuid |
121 | | - |
122 | 103 | crystal_wells = [] |
123 | 104 |
|
124 | 105 | # Inject some wells. |
125 | | - crystal_wells.append(await self.__inject(xchembku, False, False)) |
126 | | - crystal_wells.append(await self.__inject(xchembku, True, True)) |
127 | | - crystal_wells.append(await self.__inject(xchembku, True, False)) |
128 | | - crystal_wells.append(await self.__inject(xchembku, True, True)) |
129 | | - crystal_wells.append(await self.__inject(xchembku, True, True)) |
130 | | - crystal_wells.append(await self.__inject(xchembku, True, False)) |
| 106 | + crystal_wells.append(await self.inject(xchembku, False, False)) |
| 107 | + crystal_wells.append(await self.inject(xchembku, True, True)) |
| 108 | + crystal_wells.append(await self.inject(xchembku, True, False)) |
| 109 | + crystal_wells.append(await self.inject(xchembku, True, True)) |
| 110 | + crystal_wells.append(await self.inject(xchembku, True, True)) |
| 111 | + crystal_wells.append(await self.inject(xchembku, True, False)) |
131 | 112 |
|
132 | 113 | await self.__request_all(crystal_wells) |
133 | 114 |
|
@@ -200,46 +181,3 @@ async def __request_all(self, crystal_wells): |
200 | 181 | columns = row.find_all(class_="T_filename") |
201 | 182 | assert len(columns) == 1 |
202 | 183 | assert columns[0].get_text() == Path(crystal_wells[5].filename).stem |
203 | | - |
204 | | - # ---------------------------------------------------------------------------------------- |
205 | | - |
206 | | - async def __inject(self, xchembku, autolocation: bool, droplocation: bool): |
207 | | - """ """ |
208 | | - if not hasattr(self, "injected_count"): |
209 | | - self.injected_count = 0 |
210 | | - |
211 | | - filename = "/tmp/aaaa_%03d_1.jpg" % (self.injected_count) |
212 | | - |
213 | | - # Write well record. |
214 | | - m = CrystalWellModel( |
215 | | - position="01A_1", |
216 | | - filename=filename, |
217 | | - crystal_plate_uuid=self.__crystal_plate_uuid, |
218 | | - ) |
219 | | - |
220 | | - await xchembku.upsert_crystal_wells([m]) |
221 | | - |
222 | | - if autolocation: |
223 | | - # Add a crystal well autolocation. |
224 | | - t = CrystalWellAutolocationModel( |
225 | | - crystal_well_uuid=m.uuid, |
226 | | - number_of_crystals=self.injected_count, |
227 | | - auto_target_x=self.injected_count * 10 + 1, |
228 | | - auto_target_y=self.injected_count * 10 + 2, |
229 | | - ) |
230 | | - |
231 | | - await xchembku.originate_crystal_well_autolocations([t]) |
232 | | - |
233 | | - if droplocation: |
234 | | - # Add a crystal well droplocation. |
235 | | - t = CrystalWellDroplocationModel( |
236 | | - crystal_well_uuid=m.uuid, |
237 | | - confirmed_target_x=self.injected_count * 10 + 3, |
238 | | - confirmed_target_y=self.injected_count * 10 + 4, |
239 | | - ) |
240 | | - |
241 | | - await xchembku.originate_crystal_well_droplocations([t]) |
242 | | - |
243 | | - self.injected_count += 1 |
244 | | - |
245 | | - return m |
0 commit comments