Skip to content

Commit 993e942

Browse files
committed
2 spaces, not private, no redundant doc
1 parent 0181739 commit 993e942

File tree

2 files changed

+104
-106
lines changed

2 files changed

+104
-106
lines changed

Diff for: pylabrobot/resources/celltreat/plates.py

+81-81
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
11
from typing import Optional
2-
from pylabrobot.resources.height_functions import _compute_height_from_volume_cylinder, _compute_volume_from_height_cylinder
2+
from pylabrobot.resources.height_functions import (
3+
compute_height_from_volume_cylinder, compute_volume_from_height_cylinder)
34

45
from pylabrobot.resources.plate import Lid, Plate
56
from pylabrobot.resources.utils import create_equally_spaced_2d
67
from pylabrobot.resources.well import Well, WellBottomType
78

89

910
def CellTreat_96_WP_U(name: str, lid: Optional[Lid] = None) -> Plate:
10-
"""
11-
CellTreat cat. no.: 229590
12-
- Material: Polystyrene
13-
- Tissue culture treated: No
14-
"""
15-
WELL_UBOTTOM_HEIGHT = 2.81 # absolute height of cylindrical segment, measured
16-
WELL_DIAMETER = 6.69 # measured
11+
"""
12+
CellTreat cat. no.: 229590
13+
- Material: Polystyrene
14+
- Tissue culture treated: No
15+
"""
16+
WELL_UBOTTOM_HEIGHT = 2.81 # absolute height of cylindrical segment, measured
17+
WELL_DIAMETER = 6.69 # measured
1718

18-
return Plate(
19-
name=name,
20-
size_x=127.76,
21-
size_y=85.11,
22-
size_z=14.30, # without lid
23-
lid=lid,
24-
model=CellTreat_96_WP_U.__name__,
25-
items=create_equally_spaced_2d(
26-
Well,
27-
num_items_x=12,
28-
num_items_y=8,
29-
dx=11.05, # measured
30-
dy=7.75, # measured
31-
dz=1.92, # calibrated manually
32-
item_dx=8.99,
33-
item_dy=8.99,
34-
size_x=6.35,
35-
size_y=6.35,
36-
size_z=10.04,
37-
bottom_type=WellBottomType.U,
38-
),
39-
)
19+
return Plate(
20+
name=name,
21+
size_x=127.76,
22+
size_y=85.11,
23+
size_z=14.30, # without lid
24+
lid=lid,
25+
model=CellTreat_96_WP_U.__name__,
26+
items=create_equally_spaced_2d(
27+
Well,
28+
num_items_x=12,
29+
num_items_y=8,
30+
dx=11.05, # measured
31+
dy=7.75, # measured
32+
dz=1.92, # calibrated manually
33+
item_dx=8.99,
34+
item_dy=8.99,
35+
size_x=6.35,
36+
size_y=6.35,
37+
size_z=10.04,
38+
bottom_type=WellBottomType.U,
39+
),
40+
)
4041

4142

4243
def CellTreat_96_WP_U_Lid(name: str) -> Lid:
43-
"""
44-
CellTreat cat. no.: 229590
45-
- Material: Polystyrene
46-
- Tissue culture treated: No
47-
"""
48-
return Lid(
49-
name=name,
50-
size_x=127.762,
51-
size_y=85.471,
52-
size_z=10.71, # measured
53-
nesting_z_height=8.30, # measured as height of plate "plateau"
54-
model=CellTreat_96_WP_U_Lid.__name__,
55-
)
44+
"""
45+
CellTreat cat. no.: 229590
46+
- Material: Polystyrene
47+
- Tissue culture treated: No
48+
"""
49+
return Lid(
50+
name=name,
51+
size_x=127.762,
52+
size_y=85.471,
53+
size_z=10.71, # measured
54+
nesting_z_height=8.30, # measured as height of plate "plateau"
55+
model=CellTreat_96_WP_U_Lid.__name__,
56+
)
5657

5758

5859
def CellTreat_6_WP_Flat(name: str, lid: Optional[Lid] = None) -> Plate:
59-
WELL_RADIUS = 17.5
60+
WELL_RADIUS = 17.5
6061

61-
return Plate(
62-
name=name,
63-
size_x=127.0,
64-
size_y=86.0,
65-
size_z=20.5,
66-
lid=lid,
67-
model=CellTreat_6_WP_Flat.__name__,
68-
items=create_equally_spaced_2d(
69-
Well,
70-
num_items_x=3,
71-
num_items_y=2,
72-
dx=6,
73-
dy=5,
74-
dz=3,
75-
item_dx=38.5,
76-
item_dy=38.5,
77-
size_x=38.5,
78-
size_y=38.5,
79-
size_z=18.5,
80-
bottom_type=WellBottomType.FLAT,
81-
compute_volume_from_height=lambda liquid_height: _compute_volume_from_height_cylinder(
82-
liquid_height, WELL_RADIUS
83-
),
84-
compute_height_from_volume=lambda liquid_volume: _compute_height_from_volume_cylinder(
85-
liquid_volume, WELL_RADIUS
86-
),
87-
),
88-
)
62+
return Plate(
63+
name=name,
64+
size_x=127.0,
65+
size_y=86.0,
66+
size_z=20.5,
67+
lid=lid,
68+
model=CellTreat_6_WP_Flat.__name__,
69+
items=create_equally_spaced_2d(
70+
Well,
71+
num_items_x=3,
72+
num_items_y=2,
73+
dx=6,
74+
dy=5,
75+
dz=3,
76+
item_dx=38.5,
77+
item_dy=38.5,
78+
size_x=38.5,
79+
size_y=38.5,
80+
size_z=18.5,
81+
bottom_type=WellBottomType.FLAT,
82+
compute_volume_from_height=lambda liquid_height: compute_volume_from_height_cylinder(
83+
liquid_height, WELL_RADIUS
84+
),
85+
compute_height_from_volume=lambda liquid_volume: compute_height_from_volume_cylinder(
86+
liquid_volume, WELL_RADIUS
87+
),
88+
),
89+
)
8990

9091

9192
def CellTreat_6_WP_Flat_Lid(name: str) -> Lid:
92-
return Lid(
93-
name=name,
94-
size_x=127.0,
95-
size_y=86.0,
96-
size_z=9,
97-
nesting_z_height=7.9,
98-
model="CellTreat_6_WP_Rd_Lid",
99-
)
100-
93+
return Lid(
94+
name=name,
95+
size_x=127.0,
96+
size_y=86.0,
97+
size_z=9,
98+
nesting_z_height=7.9,
99+
model="CellTreat_6_WP_Rd_Lid",
100+
)

Diff for: pylabrobot/resources/height_functions.py

+23-25
Original file line numberDiff line numberDiff line change
@@ -274,47 +274,45 @@ def calculate_liquid_height_container_1segment_round_fbottom(
274274
# items=create_equally_spaced_2d(
275275
# Well,
276276
# ...
277-
# compute_height_from_volume=lambda liquid_volume: _compute_height_from_volume_rectangle(
277+
# compute_height_from_volume=lambda liquid_volume: compute_height_from_volume_rectangle(
278278
# liquid_volume, WELL_LENGTH, WELL_WIDTH
279279
# ),
280280
# ),
281281
# )
282282

283-
def _compute_volume_from_height_cylinder(liquid_height: float, well_radius: float) -> float:
284-
"""Compute volume (uL) from height (mm) for a cylinder."""
285-
return math.pi * (well_radius**2) * liquid_height
283+
def compute_volume_from_height_cylinder(liquid_height: float, well_radius: float) -> float:
284+
return math.pi * (well_radius**2) * liquid_height
286285

287286

288-
def _compute_height_from_volume_cylinder(liquid_volume: float, well_radius: float) -> float:
289-
"""Compute height (mm) from volume (uL) for a cylinder."""
290-
return liquid_volume / (math.pi * (well_radius**2))
287+
def compute_height_from_volume_cylinder(liquid_volume: float, well_radius: float) -> float:
288+
return liquid_volume / (math.pi * (well_radius**2))
291289

292290

293-
def _compute_volume_from_height_conicalfrustum(liquid_height: float, bottom_radius: float, top_radius: float) -> float:
294-
"""Compute volume (uL) from height (mm) for a conical frustum."""
295-
return (1 / 3) * math.pi * liquid_height * (bottom_radius**2 + bottom_radius * top_radius + top_radius**2)
291+
def compute_volume_from_height_conical_frustum(liquid_height: float, bottom_radius: float,
292+
top_radius: float) -> float:
293+
return (1 / 3) * math.pi * liquid_height * (bottom_radius**2 + bottom_radius * top_radius +
294+
top_radius**2)
296295

297296

298-
def _compute_height_from_volume_conicalfrustum(liquid_volume: float, bottom_radius: float, top_radius: float) -> float:
299-
"""Compute height (mm) from volume (uL) for a conical frustum."""
300-
return (3 * liquid_volume) / (math.pi * (bottom_radius**2 + bottom_radius * top_radius + top_radius**2))
297+
def compute_height_from_volume_conical_frustum(liquid_volume: float, bottom_radius: float,
298+
top_radius: float) -> float:
299+
return (3 * liquid_volume) / (math.pi * (bottom_radius**2 + bottom_radius * top_radius +
300+
top_radius**2))
301301

302302

303-
def _compute_volume_from_height_square(liquid_height: float, well_side_length: float) -> float:
304-
"""Compute volume (uL) from height (mm) for a square well."""
305-
return liquid_height * (well_side_length**2)
303+
def compute_volume_from_height_square(liquid_height: float, well_side_length: float) -> float:
304+
return liquid_height * (well_side_length**2)
306305

307306

308-
def _compute_height_from_volume_square(liquid_volume: float, well_side_length: float) -> float:
309-
"""Compute height (mm) from volume (uL) for a square well."""
310-
return liquid_volume / (well_side_length**2)
307+
def compute_height_from_volume_square(liquid_volume: float, well_side_length: float) -> float:
308+
return liquid_volume / (well_side_length**2)
311309

312310

313-
def _compute_volume_from_height_rectangle(liquid_height: float, well_length: float, well_width: float) -> float:
314-
"""Compute volume (uL) from height (mm) for a rectangular well."""
315-
return liquid_height * (well_length * well_width)
311+
def compute_volume_from_height_rectangle(liquid_height: float, well_length: float,
312+
well_width: float) -> float:
313+
return liquid_height * (well_length * well_width)
316314

317315

318-
def _compute_height_from_volume_rectangle(liquid_volume: float, well_length: float, well_width: float) -> float:
319-
"""Compute height (mm) from volume (uL) for a rectangular well."""
320-
return liquid_volume / (well_length * well_width)
316+
def compute_height_from_volume_rectangle(liquid_volume: float, well_length: float,
317+
well_width: float) -> float:
318+
return liquid_volume / (well_length * well_width)

0 commit comments

Comments
 (0)