minian 1.3.0__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.
minian/__init__.py ADDED
@@ -0,0 +1,34 @@
1
+ import os
2
+ from importlib.metadata import version
3
+
4
+ import dask as da
5
+
6
+ from .utilities import custom_delay_optimize
7
+
8
+ try:
9
+ __version__ = version("minian")
10
+ except: # noqa: E722
11
+ __version__ = "0.0.0"
12
+
13
+ da.config.set(delayed_optimize=custom_delay_optimize)
14
+ # setting fuse width ref: https://github.com/dask/dask/issues/5105
15
+ da.config.set(
16
+ **{
17
+ "distributed.worker.memory.target": 0.8,
18
+ "distributed.worker.memory.spill": 0.85,
19
+ "distributed.worker.memory.pause": 0.9,
20
+ "distributed.worker.memory.terminate": 0.95,
21
+ "distributed.admin.log-length": 100,
22
+ "distributed.scheduler.transition-log-length": 100,
23
+ "optimization.fuse.ave-width": 3,
24
+ # "optimization.fuse.subgraphs": False,
25
+ # "distributed.scheduler.allowed-failures": 1,
26
+ "array.slicing.split_large_chunks": False,
27
+ }
28
+ )
29
+ # ref: https://github.com/dask/dask/issues/3530
30
+ # on linux, after conda installing jemalloc, one can use the following line to
31
+ # get around threaded scheduler memory leak issue.
32
+ # os.environ["LD_PRELOAD"] = "~/.conda/envs/minian-dev/lib/libjemalloc.so"
33
+ # alternatively one can limit the malloc pool, which is the default for minian
34
+ os.environ["MALLOC_MMAP_THRESHOLD_"] = "16384"