Skip to content

Commit 7c27d63

Browse files
committed
Revert non-image changes
1 parent b0a8b26 commit 7c27d63

1 file changed

Lines changed: 33 additions & 54 deletions

File tree

posts/calculate-differences-of-ifc-files-with-hashing.ipynb

Lines changed: 33 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,18 @@
125125
},
126126
{
127127
"cell_type": "code",
128-
"execution_count": 5,
128+
"execution_count": 1,
129129
"metadata": {},
130130
"outputs": [
131131
{
132-
"ename": "KeyboardInterrupt",
133-
"evalue": "",
134-
"output_type": "error",
135-
"traceback": [
136-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
137-
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
138-
"Cell \u001b[0;32mIn[5], line 4\u001b[0m\n\u001b[1;32m 2\u001b[0m url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mhttps://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-36-v0.6.0-0d93633-linux64.zip\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 3\u001b[0m filename \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mifcopenshell.zip\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m----> 4\u001b[0m \u001b[43murllib\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m)\u001b[49m\n",
139-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/urllib/request.py:268\u001b[0m, in \u001b[0;36murlretrieve\u001b[0;34m(url, filename, reporthook, data)\u001b[0m\n\u001b[1;32m 265\u001b[0m reporthook(blocknum, bs, size)\n\u001b[1;32m 267\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m--> 268\u001b[0m block \u001b[38;5;241m=\u001b[39m \u001b[43mfp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 269\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m block:\n\u001b[1;32m 270\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n",
140-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py:459\u001b[0m, in \u001b[0;36mHTTPResponse.read\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 456\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m amt \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 457\u001b[0m \u001b[38;5;66;03m# Amount is given, implement using readinto\u001b[39;00m\n\u001b[1;32m 458\u001b[0m b \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mbytearray\u001b[39m(amt)\n\u001b[0;32m--> 459\u001b[0m n \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreadinto\u001b[49m\u001b[43m(\u001b[49m\u001b[43mb\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 460\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mmemoryview\u001b[39m(b)[:n]\u001b[38;5;241m.\u001b[39mtobytes()\n\u001b[1;32m 461\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 462\u001b[0m \u001b[38;5;66;03m# Amount is not given (unbounded read) so we must check self.length\u001b[39;00m\n\u001b[1;32m 463\u001b[0m \u001b[38;5;66;03m# and self.chunked\u001b[39;00m\n",
141-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py:503\u001b[0m, in \u001b[0;36mHTTPResponse.readinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 498\u001b[0m b \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmemoryview\u001b[39m(b)[\u001b[38;5;241m0\u001b[39m:\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlength]\n\u001b[1;32m 500\u001b[0m \u001b[38;5;66;03m# we do not use _safe_read() here because this may be a .will_close\u001b[39;00m\n\u001b[1;32m 501\u001b[0m \u001b[38;5;66;03m# connection, and the user is reading more bytes than will be provided\u001b[39;00m\n\u001b[1;32m 502\u001b[0m \u001b[38;5;66;03m# (for example, reading in 1k chunks)\u001b[39;00m\n\u001b[0;32m--> 503\u001b[0m n \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreadinto\u001b[49m\u001b[43m(\u001b[49m\u001b[43mb\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 504\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m n \u001b[38;5;129;01mand\u001b[39;00m b:\n\u001b[1;32m 505\u001b[0m \u001b[38;5;66;03m# Ideally, we would raise IncompleteRead if the content-length\u001b[39;00m\n\u001b[1;32m 506\u001b[0m \u001b[38;5;66;03m# wasn't satisfied, but it might break compatibility.\u001b[39;00m\n\u001b[1;32m 507\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_close_conn()\n",
142-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/socket.py:704\u001b[0m, in \u001b[0;36mSocketIO.readinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m 703\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 704\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrecv_into\u001b[49m\u001b[43m(\u001b[49m\u001b[43mb\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 705\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m timeout:\n\u001b[1;32m 706\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_timeout_occurred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
143-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py:1241\u001b[0m, in \u001b[0;36mSSLSocket.recv_into\u001b[0;34m(self, buffer, nbytes, flags)\u001b[0m\n\u001b[1;32m 1237\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m flags \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 1238\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 1239\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnon-zero flags not allowed in calls to recv_into() on \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m\n\u001b[1;32m 1240\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m)\n\u001b[0;32m-> 1241\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnbytes\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1242\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1243\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39mrecv_into(buffer, nbytes, flags)\n",
144-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py:1099\u001b[0m, in \u001b[0;36mSSLSocket.read\u001b[0;34m(self, len, buffer)\u001b[0m\n\u001b[1;32m 1097\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 1098\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m buffer \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m-> 1099\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sslobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1100\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1101\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sslobj\u001b[38;5;241m.\u001b[39mread(\u001b[38;5;28mlen\u001b[39m)\n",
145-
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
146-
]
132+
"data": {
133+
"text/plain": [
134+
"('ifcopenshell.zip', <http.client.HTTPMessage at 0x1b4b63e6b48>)"
135+
]
136+
},
137+
"execution_count": 1,
138+
"metadata": {},
139+
"output_type": "execute_result"
147140
}
148141
],
149142
"source": [
@@ -155,7 +148,7 @@
155148
},
156149
{
157150
"cell_type": "code",
158-
"execution_count": null,
151+
"execution_count": 2,
159152
"metadata": {},
160153
"outputs": [],
161154
"source": [
@@ -173,13 +166,13 @@
173166
},
174167
{
175168
"cell_type": "code",
176-
"execution_count": null,
169+
"execution_count": 3,
177170
"metadata": {},
178171
"outputs": [
179172
{
180173
"data": {
181174
"text/plain": [
182-
"('Duplex_files.zip', <http.client.HTTPMessage at 0x104dea6a0>)"
175+
"('Duplex_files.zip', <http.client.HTTPMessage at 0x1b4b6432f48>)"
183176
]
184177
},
185178
"execution_count": 3,
@@ -196,23 +189,9 @@
196189
},
197190
{
198191
"cell_type": "code",
199-
"execution_count": null,
192+
"execution_count": 4,
200193
"metadata": {},
201-
"outputs": [
202-
{
203-
"ename": "BadZipFile",
204-
"evalue": "File is not a zip file",
205-
"output_type": "error",
206-
"traceback": [
207-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
208-
"\u001b[0;31mBadZipFile\u001b[0m Traceback (most recent call last)",
209-
"Cell \u001b[0;32mIn[4], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mzipfile\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[43mzipfile\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mZipFile\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mDuplex_files.zip\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mr\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m zip_ref:\n\u001b[1;32m 3\u001b[0m zip_ref\u001b[38;5;241m.\u001b[39mextractall(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDuplex\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
210-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/zipfile.py:1257\u001b[0m, in \u001b[0;36mZipFile.__init__\u001b[0;34m(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)\u001b[0m\n\u001b[1;32m 1255\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 1256\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m mode \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[0;32m-> 1257\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_RealGetContents\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1258\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m mode \u001b[38;5;129;01min\u001b[39;00m (\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mw\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mx\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 1259\u001b[0m \u001b[38;5;66;03m# set the modified flag so central directory gets written\u001b[39;00m\n\u001b[1;32m 1260\u001b[0m \u001b[38;5;66;03m# even if no files are added to the archive\u001b[39;00m\n\u001b[1;32m 1261\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_didModify \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
211-
"File \u001b[0;32m/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/zipfile.py:1324\u001b[0m, in \u001b[0;36mZipFile._RealGetContents\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1322\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m BadZipFile(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFile is not a zip file\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1323\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m endrec:\n\u001b[0;32m-> 1324\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m BadZipFile(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFile is not a zip file\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1325\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdebug \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m 1326\u001b[0m \u001b[38;5;28mprint\u001b[39m(endrec)\n",
212-
"\u001b[0;31mBadZipFile\u001b[0m: File is not a zip file"
213-
]
214-
}
215-
],
194+
"outputs": [],
216195
"source": [
217196
"import zipfile\n",
218197
"with zipfile.ZipFile('Duplex_files.zip', 'r') as zip_ref:\n",
@@ -235,7 +214,7 @@
235214
},
236215
{
237216
"cell_type": "code",
238-
"execution_count": null,
217+
"execution_count": 6,
239218
"metadata": {},
240219
"outputs": [],
241220
"source": [
@@ -247,7 +226,7 @@
247226
},
248227
{
249228
"cell_type": "code",
250-
"execution_count": null,
229+
"execution_count": 7,
251230
"metadata": {},
252231
"outputs": [],
253232
"source": [
@@ -267,7 +246,7 @@
267246
},
268247
{
269248
"cell_type": "code",
270-
"execution_count": null,
249+
"execution_count": 8,
271250
"metadata": {},
272251
"outputs": [],
273252
"source": [
@@ -283,7 +262,7 @@
283262
},
284263
{
285264
"cell_type": "code",
286-
"execution_count": null,
265+
"execution_count": 9,
287266
"metadata": {},
288267
"outputs": [],
289268
"source": [
@@ -299,7 +278,7 @@
299278
},
300279
{
301280
"cell_type": "code",
302-
"execution_count": null,
281+
"execution_count": 10,
303282
"metadata": {},
304283
"outputs": [],
305284
"source": [
@@ -316,7 +295,7 @@
316295
},
317296
{
318297
"cell_type": "code",
319-
"execution_count": null,
298+
"execution_count": 11,
320299
"metadata": {},
321300
"outputs": [],
322301
"source": [
@@ -335,7 +314,7 @@
335314
},
336315
{
337316
"cell_type": "code",
338-
"execution_count": null,
317+
"execution_count": 19,
339318
"metadata": {},
340319
"outputs": [
341320
{
@@ -473,7 +452,7 @@
473452
},
474453
{
475454
"cell_type": "code",
476-
"execution_count": null,
455+
"execution_count": 59,
477456
"metadata": {},
478457
"outputs": [
479458
{
@@ -508,7 +487,7 @@
508487
},
509488
{
510489
"cell_type": "code",
511-
"execution_count": null,
490+
"execution_count": 60,
512491
"metadata": {},
513492
"outputs": [
514493
{
@@ -552,7 +531,7 @@
552531
},
553532
{
554533
"cell_type": "code",
555-
"execution_count": null,
534+
"execution_count": 61,
556535
"metadata": {},
557536
"outputs": [],
558537
"source": [
@@ -569,7 +548,7 @@
569548
},
570549
{
571550
"cell_type": "code",
572-
"execution_count": null,
551+
"execution_count": 62,
573552
"metadata": {},
574553
"outputs": [
575554
{
@@ -673,7 +652,7 @@
673652
},
674653
{
675654
"cell_type": "code",
676-
"execution_count": null,
655+
"execution_count": 63,
677656
"metadata": {},
678657
"outputs": [],
679658
"source": [
@@ -700,7 +679,7 @@
700679
},
701680
{
702681
"cell_type": "code",
703-
"execution_count": null,
682+
"execution_count": 64,
704683
"metadata": {},
705684
"outputs": [],
706685
"source": [
@@ -803,7 +782,7 @@
803782
},
804783
{
805784
"cell_type": "code",
806-
"execution_count": null,
785+
"execution_count": 65,
807786
"metadata": {},
808787
"outputs": [
809788
{
@@ -849,7 +828,7 @@
849828
},
850829
{
851830
"cell_type": "code",
852-
"execution_count": null,
831+
"execution_count": 66,
853832
"metadata": {},
854833
"outputs": [],
855834
"source": [
@@ -915,7 +894,7 @@
915894
},
916895
{
917896
"cell_type": "code",
918-
"execution_count": null,
897+
"execution_count": 67,
919898
"metadata": {},
920899
"outputs": [
921900
{
@@ -1117,18 +1096,18 @@
11171096
"name": "python",
11181097
"nbconvert_exporter": "python",
11191098
"pygments_lexer": "ipython3",
1120-
"version": "3.9.6"
1099+
"version": "3.7.6"
11211100
},
11221101
"nikola": {
1123-
"author": "Johan Luttun",
11241102
"category": "",
11251103
"date": "2020-09-28 14:56:00 UTC+02:00",
11261104
"description": "",
11271105
"link": "",
11281106
"slug": "calculate-differences-of-ifc-files-with-hashing",
11291107
"tags": "",
11301108
"title": "Calculate Differences of IFC files with Hashing",
1131-
"type": "text"
1109+
"type": "text",
1110+
"author": "Johan Luttun"
11321111
}
11331112
},
11341113
"nbformat": 4,

0 commit comments

Comments
 (0)