Skip to content

Commit b1b75e6

Browse files
committed
disabled logging from ome_zarr
1 parent f55f89a commit b1b75e6

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

notebooks/developers_resources/storage_format/multiple_elements.ipynb

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,22 +124,28 @@
124124
},
125125
{
126126
"cell_type": "code",
127-
"execution_count": 4,
127+
"execution_count": 12,
128128
"id": "b2952c64-5502-4462-9be0-a32fdb61158c",
129129
"metadata": {},
130130
"outputs": [
131131
{
132-
"name": "stderr",
133-
"output_type": "stream",
134-
"text": [
135-
"no parent found for <ome_zarr.reader.Label object at 0x281846ec0>: None\n",
136-
"no parent found for <ome_zarr.reader.Label object at 0x2818661d0>: None\n",
137-
"no parent found for <ome_zarr.reader.Label object at 0x286e48df0>: None\n",
138-
"no parent found for <ome_zarr.reader.Label object at 0x286e4a560>: None\n"
132+
"ename": "AssertionError",
133+
"evalue": "",
134+
"output_type": "error",
135+
"traceback": [
136+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
137+
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
138+
"Cell \u001b[0;32mIn[12], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mlogging\u001b[39;00m\n\u001b[1;32m 2\u001b[0m logging\u001b[38;5;241m.\u001b[39mgetLogger(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mome_zarr\u001b[39m\u001b[38;5;124m'\u001b[39m)\u001b[38;5;241m.\u001b[39msetLevel(logging\u001b[38;5;241m.\u001b[39mERROR)\n\u001b[0;32m----> 3\u001b[0m \u001b[43mwrite_sdata_and_check_consistency\u001b[49m\u001b[43m(\u001b[49m\u001b[43msdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mNAME\u001b[49m\u001b[43m)\u001b[49m\n",
139+
"File \u001b[0;32m~/embl/projects/basel/spatialdata-notebooks/notebooks/developers_resources/storage_format/io_utils.py:84\u001b[0m, in \u001b[0;36mwrite_sdata_and_check_consistency\u001b[0;34m(sdata, name)\u001b[0m\n\u001b[1;32m 59\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 60\u001b[0m \u001b[38;5;124;03mWrite SpatialData instance to file, reload it, and check for consistency.\u001b[39;00m\n\u001b[1;32m 61\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[38;5;124;03m>>> write_sdata_and_check_consistency(sdata, 'testfile') # will create testfile.zarr\u001b[39;00m\n\u001b[1;32m 82\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 83\u001b[0m f1 \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mname\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.zarr\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m---> 84\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mexists(f1)\n\u001b[1;32m 85\u001b[0m sdata\u001b[38;5;241m.\u001b[39mwrite(f1)\n\u001b[1;32m 87\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m tempfile\u001b[38;5;241m.\u001b[39mTemporaryDirectory() \u001b[38;5;28;01mas\u001b[39;00m tmpdir:\n",
140+
"\u001b[0;31mAssertionError\u001b[0m: "
139141
]
140142
}
141143
],
142144
"source": [
145+
"import logging\n",
146+
"\n",
147+
"logging.getLogger(\"ome_zarr\").setLevel(logging.ERROR)\n",
148+
"\n",
143149
"write_sdata_and_check_consistency(sdata=sdata, name=NAME)"
144150
]
145151
},

0 commit comments

Comments
 (0)