zhmiscellany 6.3.3__py3-none-any.whl → 6.3.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zhmiscellany/fileio.py +4 -4
- {zhmiscellany-6.3.3.dist-info → zhmiscellany-6.3.5.dist-info}/METADATA +1 -1
- {zhmiscellany-6.3.3.dist-info → zhmiscellany-6.3.5.dist-info}/RECORD +5 -5
- {zhmiscellany-6.3.3.dist-info → zhmiscellany-6.3.5.dist-info}/WHEEL +0 -0
- {zhmiscellany-6.3.3.dist-info → zhmiscellany-6.3.5.dist-info}/top_level.txt +0 -0
zhmiscellany/fileio.py
CHANGED
|
@@ -218,7 +218,7 @@ def chdir_to_script_dir():
|
|
|
218
218
|
os.chdir(os.path.dirname(get_script_path()))
|
|
219
219
|
|
|
220
220
|
|
|
221
|
-
def cache(function, *args,
|
|
221
|
+
def cache(function, *args, _cache_compressed=False, **kwargs):
|
|
222
222
|
"""
|
|
223
223
|
Caches the result of a function call to disk.
|
|
224
224
|
"""
|
|
@@ -300,7 +300,7 @@ def cache(function, *args, compressed=False, **kwargs):
|
|
|
300
300
|
'function': function,
|
|
301
301
|
'args': args,
|
|
302
302
|
'kwargs': kwargs,
|
|
303
|
-
'compressed':
|
|
303
|
+
'compressed': _cache_compressed
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
seed_hash = get_hash_orjson(seed)
|
|
@@ -308,11 +308,11 @@ def cache(function, *args, compressed=False, **kwargs):
|
|
|
308
308
|
cache_file = f'{cache_folder}/cache_{function.__name__}_{seed_hash}.pkl'
|
|
309
309
|
|
|
310
310
|
if os.path.exists(cache_file):
|
|
311
|
-
return load_object_from_file(cache_file, compressed=
|
|
311
|
+
return load_object_from_file(cache_file, compressed=_cache_compressed)
|
|
312
312
|
else:
|
|
313
313
|
result = function(*args, **kwargs)
|
|
314
314
|
zhmiscellany.fileio.create_folder(cache_folder)
|
|
315
|
-
save_object_to_file(result, cache_file, compressed=
|
|
315
|
+
save_object_to_file(result, cache_file, compressed=_cache_compressed)
|
|
316
316
|
return result
|
|
317
317
|
|
|
318
318
|
|
|
@@ -8,7 +8,7 @@ zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWH
|
|
|
8
8
|
zhmiscellany/cpp.py,sha256=XEUEoIKCDCdY5VgwNWE5oXrGjtsmGdz_MnaVwQmi2dk,179
|
|
9
9
|
zhmiscellany/dict.py,sha256=dNu3G9qiJeLgE7JY3QD31GJU7EfLsYPqxf8AOhBsYag,81
|
|
10
10
|
zhmiscellany/discord.py,sha256=yKoigWI3tONfYSoMEynGGEWW1VsXSRdkg8vPbIKwBNI,20312
|
|
11
|
-
zhmiscellany/fileio.py,sha256=
|
|
11
|
+
zhmiscellany/fileio.py,sha256=9OjWRMqbpLSaCh83axrLjWIIv8RsDOIKeL4rKnRyKqY,22179
|
|
12
12
|
zhmiscellany/gui.py,sha256=OVwuZ_kWHJlgKPeYR7fAAyomNmU-OnxOgXZelVNPm1w,10409
|
|
13
13
|
zhmiscellany/image.py,sha256=6Hz5sfym_o7FHokGUKeXRsjl89VY_ZMSLnvuSam1icI,8265
|
|
14
14
|
zhmiscellany/list.py,sha256=BnbYG-lpHmi0C4v8jLfaeXqQdc3opmNgkvY6yz4pasg,1475
|
|
@@ -21,7 +21,7 @@ zhmiscellany/pipes.py,sha256=RlHxsW_M_R6UJUIDgYVS_zfqUwO8kXG8j-0YG5qByjo,4637
|
|
|
21
21
|
zhmiscellany/processing.py,sha256=ZhNAJ5OfCUHuaXj0z6XZ94ZGSK86-EdCyqW-9ILayLg,11524
|
|
22
22
|
zhmiscellany/rust.py,sha256=cHkSpdtq7QQW3yzBEAYL9lZxLW0h4wal2tsxIOnyTrA,494
|
|
23
23
|
zhmiscellany/string.py,sha256=A4ilBWSYlrJ0AJ0axvepSSjYCYwYk5X-vRrHNphi_ow,4809
|
|
24
|
-
zhmiscellany-6.3.
|
|
25
|
-
zhmiscellany-6.3.
|
|
26
|
-
zhmiscellany-6.3.
|
|
27
|
-
zhmiscellany-6.3.
|
|
24
|
+
zhmiscellany-6.3.5.dist-info/METADATA,sha256=9qnaczarUJXs-eWVHwNvrSlPpDpgAXkcT-18L2bUUuY,43872
|
|
25
|
+
zhmiscellany-6.3.5.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
|
|
26
|
+
zhmiscellany-6.3.5.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
|
|
27
|
+
zhmiscellany-6.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|