Skip to content

Commit 560205e

Browse files
authored
Migrate skimage.io calls to imageio (#143)
* migrate skimage.io calls to imageio * update notebook; coverage post merge update * linting
1 parent 08250fc commit 560205e

File tree

9 files changed

+65
-93
lines changed

9 files changed

+65
-93
lines changed

docs/src/examples/cytodataframe_at_a_glance.ipynb

Lines changed: 43 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,12 @@
2424
},
2525
"outputs": [],
2626
"source": [
27-
"import logging\n",
2827
"import pathlib\n",
29-
"import warnings\n",
3028
"\n",
3129
"import pandas as pd\n",
3230
"\n",
3331
"from cytodataframe.frame import CytoDataFrame\n",
3432
"\n",
35-
"logging.basicConfig(level=logging.INFO) # or logging.DEBUG, WARNING, etc.\n",
36-
"logging.getLogger().setLevel(logging.INFO) # Ensures root logger is set\n",
37-
"\n",
38-
"\n",
39-
"# filter warnings from skimage about imageio\n",
40-
"warnings.filterwarnings(\n",
41-
" \"ignore\",\n",
42-
" message=r\"The plugin infrastructure.*\",\n",
43-
" category=FutureWarning,\n",
44-
")\n",
45-
"\n",
4633
"# create paths for use with CytoDataFrames below\n",
4734
"jump_data_path = \"../../../tests/data/cytotable/JUMP_plate_BR00117006\"\n",
4835
"nf1_cellpainting_path = \"../../../tests/data/cytotable/NF1_cellpainting_data_shrunken/\"\n",
@@ -62,14 +49,14 @@
6249
"name": "stdout",
6350
"output_type": "stream",
6451
"text": [
65-
"CPU times: user 959 ms, sys: 631 ms, total: 1.59 s\n",
66-
"Wall time: 791 ms\n"
52+
"CPU times: user 941 ms, sys: 713 ms, total: 1.65 s\n",
53+
"Wall time: 525 ms\n"
6754
]
6855
},
6956
{
7057
"data": {
7158
"application/vnd.jupyter.widget-view+json": {
72-
"model_id": "03687f56dc5d45eeb046747ae2bed0ff",
59+
"model_id": "2b016f7850e74f50a576f54ccd297830",
7360
"version_major": 2,
7461
"version_minor": 0
7562
},
@@ -188,14 +175,14 @@
188175
"name": "stdout",
189176
"output_type": "stream",
190177
"text": [
191-
"CPU times: user 993 ms, sys: 716 ms, total: 1.71 s\n",
192-
"Wall time: 509 ms\n"
178+
"CPU times: user 944 ms, sys: 723 ms, total: 1.67 s\n",
179+
"Wall time: 505 ms\n"
193180
]
194181
},
195182
{
196183
"data": {
197184
"application/vnd.jupyter.widget-view+json": {
198-
"model_id": "ff776f0537f24a9291b0f18c2a26a2b4",
185+
"model_id": "6add24880e464fd799e123d3524df407",
199186
"version_major": 2,
200187
"version_minor": 0
201188
},
@@ -312,14 +299,14 @@
312299
"name": "stdout",
313300
"output_type": "stream",
314301
"text": [
315-
"CPU times: user 978 ms, sys: 705 ms, total: 1.68 s\n",
316-
"Wall time: 508 ms\n"
302+
"CPU times: user 916 ms, sys: 696 ms, total: 1.61 s\n",
303+
"Wall time: 491 ms\n"
317304
]
318305
},
319306
{
320307
"data": {
321308
"application/vnd.jupyter.widget-view+json": {
322-
"model_id": "852219d6f8d2469d80cea9e4118f1897",
309+
"model_id": "9cc9cdc816c248ef9674bf17ecbf425f",
323310
"version_major": 2,
324311
"version_minor": 0
325312
},
@@ -438,14 +425,14 @@
438425
"name": "stdout",
439426
"output_type": "stream",
440427
"text": [
441-
"CPU times: user 983 ms, sys: 709 ms, total: 1.69 s\n",
442-
"Wall time: 512 ms\n"
428+
"CPU times: user 892 ms, sys: 648 ms, total: 1.54 s\n",
429+
"Wall time: 489 ms\n"
443430
]
444431
},
445432
{
446433
"data": {
447434
"application/vnd.jupyter.widget-view+json": {
448-
"model_id": "fd7cf9633a454cec839a426b39d24ab9",
435+
"model_id": "68c66e5966784cf986fae4d4115c2541",
449436
"version_major": 2,
450437
"version_minor": 0
451438
},
@@ -573,14 +560,14 @@
573560
"name": "stdout",
574561
"output_type": "stream",
575562
"text": [
576-
"CPU times: user 972 ms, sys: 686 ms, total: 1.66 s\n",
577-
"Wall time: 494 ms\n"
563+
"CPU times: user 951 ms, sys: 706 ms, total: 1.66 s\n",
564+
"Wall time: 515 ms\n"
578565
]
579566
},
580567
{
581568
"data": {
582569
"application/vnd.jupyter.widget-view+json": {
583-
"model_id": "c8110e3b5aa2487787b787675c2240a3",
570+
"model_id": "0ad5469211d34833a1e9423d55fb0d16",
584571
"version_major": 2,
585572
"version_minor": 0
586573
},
@@ -697,14 +684,14 @@
697684
"name": "stdout",
698685
"output_type": "stream",
699686
"text": [
700-
"CPU times: user 952 ms, sys: 657 ms, total: 1.61 s\n",
701-
"Wall time: 501 ms\n"
687+
"CPU times: user 938 ms, sys: 676 ms, total: 1.61 s\n",
688+
"Wall time: 497 ms\n"
702689
]
703690
},
704691
{
705692
"data": {
706693
"application/vnd.jupyter.widget-view+json": {
707-
"model_id": "892699793f5744768db8c4b714410896",
694+
"model_id": "7f888032d36647b8a4f3288feda73dcb",
708695
"version_major": 2,
709696
"version_minor": 0
710697
},
@@ -823,14 +810,14 @@
823810
"name": "stdout",
824811
"output_type": "stream",
825812
"text": [
826-
"CPU times: user 1e+03 ms, sys: 715 ms, total: 1.71 s\n",
827-
"Wall time: 522 ms\n"
813+
"CPU times: user 905 ms, sys: 635 ms, total: 1.54 s\n",
814+
"Wall time: 509 ms\n"
828815
]
829816
},
830817
{
831818
"data": {
832819
"application/vnd.jupyter.widget-view+json": {
833-
"model_id": "cc5eed6584f145ee93a9cd0eb774c192",
820+
"model_id": "79b365d8a5714d20af75dc1a3738a3b1",
834821
"version_major": 2,
835822
"version_minor": 0
836823
},
@@ -948,14 +935,14 @@
948935
"name": "stdout",
949936
"output_type": "stream",
950937
"text": [
951-
"CPU times: user 891 ms, sys: 569 ms, total: 1.46 s\n",
952-
"Wall time: 491 ms\n"
938+
"CPU times: user 889 ms, sys: 650 ms, total: 1.54 s\n",
939+
"Wall time: 485 ms\n"
953940
]
954941
},
955942
{
956943
"data": {
957944
"application/vnd.jupyter.widget-view+json": {
958-
"model_id": "dbd47ac95760490db5504afbc27c431f",
945+
"model_id": "0b9c28b02db44ce187f6830422c5cda5",
959946
"version_major": 2,
960947
"version_minor": 0
961948
},
@@ -1090,14 +1077,14 @@
10901077
"name": "stdout",
10911078
"output_type": "stream",
10921079
"text": [
1093-
"CPU times: user 965 ms, sys: 678 ms, total: 1.64 s\n",
1094-
"Wall time: 499 ms\n"
1080+
"CPU times: user 890 ms, sys: 653 ms, total: 1.54 s\n",
1081+
"Wall time: 491 ms\n"
10951082
]
10961083
},
10971084
{
10981085
"data": {
10991086
"application/vnd.jupyter.widget-view+json": {
1100-
"model_id": "0c6f0024a7c44d7c9fe68128f1b0606d",
1087+
"model_id": "d957d909601243d5932444525ed46482",
11011088
"version_major": 2,
11021089
"version_minor": 0
11031090
},
@@ -1239,14 +1226,14 @@
12391226
"name": "stdout",
12401227
"output_type": "stream",
12411228
"text": [
1242-
"CPU times: user 303 ms, sys: 193 ms, total: 497 ms\n",
1243-
"Wall time: 179 ms\n"
1229+
"CPU times: user 293 ms, sys: 198 ms, total: 492 ms\n",
1230+
"Wall time: 173 ms\n"
12441231
]
12451232
},
12461233
{
12471234
"data": {
12481235
"application/vnd.jupyter.widget-view+json": {
1249-
"model_id": "104456efdfd44add97e1c5db1bd330d5",
1236+
"model_id": "fd1e6fc031f340b8ad18b159877c3c04",
12501237
"version_major": 2,
12511238
"version_minor": 0
12521239
},
@@ -1362,14 +1349,14 @@
13621349
"name": "stdout",
13631350
"output_type": "stream",
13641351
"text": [
1365-
"CPU times: user 259 ms, sys: 159 ms, total: 417 ms\n",
1352+
"CPU times: user 273 ms, sys: 208 ms, total: 481 ms\n",
13661353
"Wall time: 149 ms\n"
13671354
]
13681355
},
13691356
{
13701357
"data": {
13711358
"application/vnd.jupyter.widget-view+json": {
1372-
"model_id": "fe3b518e130740c8aa8431f27109f4a8",
1359+
"model_id": "afd7879a0aa74dccabb9b62d27bec28a",
13731360
"version_major": 2,
13741361
"version_minor": 0
13751362
},
@@ -1486,14 +1473,14 @@
14861473
"name": "stdout",
14871474
"output_type": "stream",
14881475
"text": [
1489-
"CPU times: user 263 ms, sys: 135 ms, total: 399 ms\n",
1490-
"Wall time: 169 ms\n"
1476+
"CPU times: user 287 ms, sys: 186 ms, total: 473 ms\n",
1477+
"Wall time: 174 ms\n"
14911478
]
14921479
},
14931480
{
14941481
"data": {
14951482
"application/vnd.jupyter.widget-view+json": {
1496-
"model_id": "9fb385b177bb4b7b80c5b1d8973bd554",
1483+
"model_id": "fd8e2909d785471aab81cdb5aed68102",
14971484
"version_major": 2,
14981485
"version_minor": 0
14991486
},
@@ -1621,14 +1608,14 @@
16211608
"name": "stdout",
16221609
"output_type": "stream",
16231610
"text": [
1624-
"CPU times: user 128 ms, sys: 83.2 ms, total: 211 ms\n",
1625-
"Wall time: 73.3 ms\n"
1611+
"CPU times: user 81.2 ms, sys: 15 ms, total: 96.2 ms\n",
1612+
"Wall time: 67.1 ms\n"
16261613
]
16271614
},
16281615
{
16291616
"data": {
16301617
"application/vnd.jupyter.widget-view+json": {
1631-
"model_id": "0260081dbd9347bbafb362ed753080fc",
1618+
"model_id": "1752ba58b84b4a33b87072ea7602a3fd",
16321619
"version_major": 2,
16331620
"version_minor": 0
16341621
},
@@ -1745,14 +1732,14 @@
17451732
"name": "stdout",
17461733
"output_type": "stream",
17471734
"text": [
1748-
"CPU times: user 388 ms, sys: 258 ms, total: 646 ms\n",
1749-
"Wall time: 219 ms\n"
1735+
"CPU times: user 406 ms, sys: 292 ms, total: 698 ms\n",
1736+
"Wall time: 225 ms\n"
17501737
]
17511738
},
17521739
{
17531740
"data": {
17541741
"application/vnd.jupyter.widget-view+json": {
1755-
"model_id": "1a87f897a59b4c8094d6079d2123ac40",
1742+
"model_id": "ba7ca0341d964e1da003b00f05ae59e1",
17561743
"version_major": 2,
17571744
"version_minor": 0
17581745
},
@@ -1883,8 +1870,8 @@
18831870
"name": "stdout",
18841871
"output_type": "stream",
18851872
"text": [
1886-
"CPU times: user 1e+03 ns, sys: 0 ns, total: 1e+03 ns\n",
1887-
"Wall time: 2.86 µs\n"
1873+
"CPU times: user 1 µs, sys: 1 µs, total: 2 µs\n",
1874+
"Wall time: 1.91 µs\n"
18881875
]
18891876
},
18901877
{

docs/src/examples/cytodataframe_at_a_glance.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,12 @@
2222
# visual information which can be viewed directly in a Jupyter notebook.
2323

2424
# +
25-
import logging
2625
import pathlib
27-
import warnings
2826

2927
import pandas as pd
3028

3129
from cytodataframe.frame import CytoDataFrame
3230

33-
logging.basicConfig(level=logging.INFO) # or logging.DEBUG, WARNING, etc.
34-
logging.getLogger().setLevel(logging.INFO) # Ensures root logger is set
35-
36-
37-
# filter warnings from skimage about imageio
38-
warnings.filterwarnings(
39-
"ignore",
40-
message=r"The plugin infrastructure.*",
41-
category=FutureWarning,
42-
)
43-
4431
# create paths for use with CytoDataFrames below
4532
jump_data_path = "../../../tests/data/cytotable/JUMP_plate_BR00117006"
4633
nf1_cellpainting_path = "../../../tests/data/cytotable/NF1_cellpainting_data_shrunken/"

media/coverage-badge.svg

Lines changed: 1 addition & 1 deletion
Loading

poetry.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ opencv-python = "^4.10.0.84"
4040
imagecodecs = "^2024.9.22"
4141
matplotlib = "^3.9.3"
4242
ipywidgets = "^8.1.7"
43+
imageio = "^2.37.0"
4344

4445
[tool.poetry.group.dev.dependencies]
4546
# provides testing capabilities for project

0 commit comments

Comments
 (0)