Skip to content

Commit c9cb1d5

Browse files
Merge pull request #846 from fractal-analytics-platform/update_dependencies_py312
Update dependencies for python=312
2 parents 590b463 + ae7af18 commit c9cb1d5

File tree

11 files changed

+286
-304
lines changed

11 files changed

+286
-304
lines changed

.github/workflows/ci_pip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-22.04, macos-latest]
18-
python-version: ["3.9", "3.10", "3.11"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1919
exclude:
2020
- os: macos-latest
2121
python-version: '3.9'
@@ -50,7 +50,7 @@ jobs:
5050
strategy:
5151
matrix:
5252
os: [ubuntu-latest, macos-latest]
53-
python-version: ["3.9", "3.10", "3.11"]
53+
python-version: ["3.9", "3.10", "3.11", "3.12"]
5454
exclude:
5555
- os: macos-latest
5656
python-version: '3.9'

.github/workflows/ci_poetry.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
python-version: ["3.9", "3.10", "3.11"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -60,7 +60,7 @@ jobs:
6060

6161
strategy:
6262
matrix:
63-
python-version: ["3.9", "3.10", "3.11"]
63+
python-version: ["3.9", "3.10", "3.11", "3.12"]
6464

6565
steps:
6666
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
**Note**: Numbers like (\#123) point to closed Pull Requests on the fractal-tasks-core repository.
22

3+
* Dependencies:
4+
* Relax pandas constraint to `<2`.
5+
* Relax torch constraint to `<=3.0.0`.
6+
* Relax numpy constraint to `<2.1.0`.
7+
* Add python 3.12 to the CI matrix (\#770).
8+
* Chores:
9+
* fix future warning when using Series.__getitem__ with positional arguments.
10+
311
# 1.3.1
412

513
* Testing

fractal_tasks_core/cellvoyager/metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def read_mrf_file(mrf_path: str) -> tuple[pd.DataFrame, int]:
207207
meas_df = pd.read_xml(
208208
mrf_path, xpath="//bts:MeasurementDetail", namespaces=ns
209209
)
210-
row_count = int(meas_df["RowCount"])
211-
column_count = int(meas_df["ColumnCount"])
210+
row_count = int(meas_df["RowCount"].iloc[0])
211+
column_count = int(meas_df["ColumnCount"].iloc[0])
212212
plate_type = row_count * column_count
213213
return channel_df, plate_type
214214

@@ -471,7 +471,7 @@ def check_group_consistency(grouped_df: pd.DataFrame, message: str = ""):
471471
# Check consistency in grouped df for multi-index, multi-column dataframes
472472
# raises an exception if there is variability
473473
diff_df = grouped_df.max() - grouped_df.min()
474-
if not np.isclose(np.sum(np.sum(diff_df)), 0.0):
474+
if not np.isclose(diff_df.to_numpy().sum(), 0.0):
475475
raise ValueError(
476476
"During metadata parsing, a consistency check failed: \n"
477477
f"{message}\n"

fractal_tasks_core/masked_loading.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def _preprocess_input(
109109
'In _preprocess_input, "{column_name}" '
110110
f" missing in {ROI_table.obs.columns=}"
111111
)
112-
label_value = int(float(ROI_table.obs[column_name][ROI_positional_index]))
112+
label_value = int(
113+
float(ROI_table.obs[column_name].iloc[ROI_positional_index])
114+
)
113115

114116
# Load masking-label array (lazily)
115117
masking_label_path = str(

fractal_tasks_core/roi/v1_overlaps.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def get_overlapping_pair(
4545
num_lines = len(tmp_df.index)
4646
for pos_ind_1 in range(num_lines):
4747
for pos_ind_2 in range(pos_ind_1):
48-
if is_overlapping_2D(
49-
tmp_df.iloc[pos_ind_1], tmp_df.iloc[pos_ind_2], tol=tol
50-
):
48+
bbox_1 = tmp_df.iloc[pos_ind_1].to_numpy()
49+
bbox_2 = tmp_df.iloc[pos_ind_2].to_numpy()
50+
if is_overlapping_2D(bbox_1, bbox_2, tol=tol):
5151
return (pos_ind_1, pos_ind_2)
5252
return False
5353

@@ -96,9 +96,9 @@ def get_overlapping_pairs_3D(
9696
overlapping_list = []
9797
for pos_ind_1 in range(num_lines):
9898
for pos_ind_2 in range(pos_ind_1):
99-
overlap = is_overlapping_3D(
100-
new_tmp_df.iloc[pos_ind_1], new_tmp_df.iloc[pos_ind_2], tol=tol
101-
)
99+
bbox_1 = new_tmp_df.iloc[pos_ind_1].to_numpy()
100+
bbox_2 = new_tmp_df.iloc[pos_ind_2].to_numpy()
101+
overlap = is_overlapping_3D(bbox_1, bbox_2, tol=tol)
102102
if overlap:
103103
overlapping_list.append((pos_ind_1, pos_ind_2))
104104
return overlapping_list
@@ -177,7 +177,6 @@ def remove_FOV_overlaps(df: pd.DataFrame):
177177
# Loop over wells
178178
wells = sorted(list(set([ind[0] for ind in df.index])))
179179
for well in wells:
180-
181180
logger.info(f"removing FOV overlaps for {well=}")
182181
df_well = df.loc[well].copy()
183182

fractal_tasks_core/tasks/cellvoyager_to_ome_zarr_init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ def cellvoyager_to_ome_zarr_init(
278278
site_metadata.set_index(["well_id", "FieldIndex"], inplace=True)
279279

280280
# Extract pixel sizes and bit_depth
281-
pixel_size_z = site_metadata["pixel_size_z"][0]
282-
pixel_size_y = site_metadata["pixel_size_y"][0]
283-
pixel_size_x = site_metadata["pixel_size_x"][0]
284-
bit_depth = site_metadata["bit_depth"][0]
281+
pixel_size_z = site_metadata["pixel_size_z"].iloc[0]
282+
pixel_size_y = site_metadata["pixel_size_y"].iloc[0]
283+
pixel_size_x = site_metadata["pixel_size_x"].iloc[0]
284+
bit_depth = site_metadata["bit_depth"].iloc[0]
285285

286286
if min(pixel_size_z, pixel_size_y, pixel_size_x) < 1e-9:
287287
raise ValueError(pixel_size_z, pixel_size_y, pixel_size_x)

fractal_tasks_core/tasks/cellvoyager_to_ome_zarr_init_multiplex.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ def cellvoyager_to_ome_zarr_init_multiplex(
303303
site_metadata.set_index(["well_id", "FieldIndex"], inplace=True)
304304

305305
# Extract pixel sizes and bit_depth
306-
pixel_size_z = site_metadata["pixel_size_z"][0]
307-
pixel_size_y = site_metadata["pixel_size_y"][0]
308-
pixel_size_x = site_metadata["pixel_size_x"][0]
309-
bit_depth = site_metadata["bit_depth"][0]
306+
pixel_size_z = site_metadata["pixel_size_z"].iloc[0]
307+
pixel_size_y = site_metadata["pixel_size_y"].iloc[0]
308+
pixel_size_x = site_metadata["pixel_size_x"].iloc[0]
309+
bit_depth = site_metadata["bit_depth"].iloc[0]
310310

311311
if min(pixel_size_z, pixel_size_y, pixel_size_x) < 1e-9:
312312
raise ValueError(pixel_size_z, pixel_size_y, pixel_size_x)

0 commit comments

Comments
 (0)