pythagoras 0.21.2__py3-none-any.whl → 0.21.3__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.
@@ -41,18 +41,18 @@ def at_least_X_G_RAM_free_check(x:int)->bool|OKClass:
41
41
  else:
42
42
  return False
43
43
 
44
- def at_least_X_G_RAM_free(x:int):
45
- assert isinstance(x, int)
46
- assert x > 0
47
- return at_least_X_G_RAM_free_check.fix_kwargs(x=x)
44
+ def unused_ram(Gb:int):
45
+ assert isinstance(Gb, int)
46
+ assert Gb > 0
47
+ return at_least_X_G_RAM_free_check.fix_kwargs(x=Gb)
48
48
 
49
- at_least_1_G_RAM_free = at_least_X_G_RAM_free(x=1)
50
- at_least_2_G_RAM_free = at_least_X_G_RAM_free(x=2)
51
- at_least_4_G_RAM_free = at_least_X_G_RAM_free(x=4)
52
- at_least_8_G_RAM_free = at_least_X_G_RAM_free(x=8)
53
- at_least_16_G_RAM_free = at_least_X_G_RAM_free(x=16)
54
- at_least_32_G_RAM_free = at_least_X_G_RAM_free(x=32)
55
- at_least_64_G_RAM_free = at_least_X_G_RAM_free(x=64)
56
- at_least_128_G_RAM_free = at_least_X_G_RAM_free(x=128)
57
- at_least_256_G_RAM_free = at_least_X_G_RAM_free(x=256)
58
- at_least_512_G_RAM_free = at_least_X_G_RAM_free(x=512)
49
+ at_least_1_G_RAM_free = unused_ram(Gb=1)
50
+ at_least_2_G_RAM_free = unused_ram(Gb=2)
51
+ at_least_4_G_RAM_free = unused_ram(Gb=4)
52
+ at_least_8_G_RAM_free = unused_ram(Gb=8)
53
+ at_least_16_G_RAM_free = unused_ram(Gb=16)
54
+ at_least_32_G_RAM_free = unused_ram(Gb=32)
55
+ at_least_64_G_RAM_free = unused_ram(Gb=64)
56
+ at_least_128_G_RAM_free = unused_ram(Gb=128)
57
+ at_least_256_G_RAM_free = unused_ram(Gb=256)
58
+ at_least_512_G_RAM_free = unused_ram(Gb=512)
@@ -9,7 +9,8 @@ from parameterizable import sort_dict_by_keys
9
9
  from persidict import PersiDict, Joker, KEEP_CURRENT
10
10
 
11
11
  from .._010_basic_portals import get_all_known_portals
12
- from .._070_protected_code_portals.system_utils import *
12
+ from .._070_protected_code_portals.system_utils import get_unused_ram_mb, get_unused_cpu_cores, process_is_active, \
13
+ get_process_start_time, get_current_process_id, get_current_process_start_time
13
14
  from .._040_logging_code_portals.logging_portal_core_classes import build_execution_environment_summary
14
15
  from .._010_basic_portals.basic_portal_core_classes import _describe_runtime_characteristic
15
16
  from persidict import OverlappingMultiDict
@@ -130,9 +131,9 @@ class SwarmingPortal(PureCodePortal):
130
131
  n = self._get_config_setting("max_n_workers")
131
132
  if n in (None, KEEP_CURRENT):
132
133
  n = 10
133
- n = min(n, get_unused_cpu_cores())
134
+ n = min(n, get_unused_cpu_cores() + 2)
134
135
  n = min(n, get_unused_ram_mb() / 500)
135
- n = int(n)+1
136
+ n = int(n)
136
137
  self._max_n_workers_cache = n
137
138
 
138
139
  return self._max_n_workers_cache
@@ -2,4 +2,5 @@ from .._030_data_portals import ready, get
2
2
  from .._060_autonomous_code_portals import autonomous
3
3
  from .._080_pure_code_portals import pure
4
4
  from .._090_swarming_portals import SwarmingPortal
5
- from .._100_top_level_API import get_portal
5
+ from .._100_top_level_API import get_portal
6
+ from .._070_protected_code_portals import unused_ram
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pythagoras
3
- Version: 0.21.2
3
+ Version: 0.21.3
4
4
  Summary: Planet-scale distributed computing in Python.
5
5
  Keywords: cloud,ML,AI,serverless,distributed,parallel,machine-learning,deep-learning,pythagoras
6
6
  Author: Volodymyr (Vlad) Pavlov
@@ -33,7 +33,7 @@ pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py,sha256
33
33
  pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py,sha256=1e0e84854ac630b204878fecde48a16739fd2663709fcee2ec0a8844f4fd4f13,7470
34
34
  pythagoras/_070_protected_code_portals/GPU_pre_validators.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
35
35
  pythagoras/_070_protected_code_portals/OK_const.py,sha256=17ea314496f44b422f9936585c3bb3749c960bc779b4f74962ec04e3fa4d2494,186
36
- pythagoras/_070_protected_code_portals/RAM_pre_validators.py,sha256=2b485d96fa9a375d4ebf724ea206cb7e28712f36d3a76dae4f1124156ebf364f,1755
36
+ pythagoras/_070_protected_code_portals/RAM_pre_validators.py,sha256=f2475cc5ae76dcdfd5973d43e244cc452792cafb2a09c0780405ad749085f57a,1648
37
37
  pythagoras/_070_protected_code_portals/__init__.py,sha256=4bb7fc29f18fc5018388f6f0c0f4ec66c29185f9e1396f9d106cc8c14ad61fc4,247
38
38
  pythagoras/_070_protected_code_portals/fn_arg_names_checker.py,sha256=e858ce5099868030a39057177f93a893e13d7a210582e6ab636aaaccec898fb0,1230
39
39
  pythagoras/_070_protected_code_portals/list_flattener.py,sha256=9a54b512ad9dc201db348e7908f5ca5f36d171ae3da433511d38023a6ba8d4b5,331
@@ -48,7 +48,7 @@ pythagoras/_080_pure_code_portals/pure_core_classes.py,sha256=93867a68efa491b719
48
48
  pythagoras/_080_pure_code_portals/pure_decorator.py,sha256=fd7acf43f2735146a4195d2a29d22e545f57b922489cd3baea7d9e4b5b88b5ae,1373
49
49
  pythagoras/_090_swarming_portals/__init__.py,sha256=7041578f84ffa291f2752c7a2168007b9113f99482f0173f3729171b3bff551a,32
50
50
  pythagoras/_090_swarming_portals/output_suppressor.py,sha256=83e6cc9bcc62a226babb1165912ef5095ea948499ce5136a7516ac8b54522607,626
51
- pythagoras/_090_swarming_portals/swarming_portals.py,sha256=f3e62a23287861bcf08191025d42078f15889fad9127fc9bc548faf12565708a,11572
51
+ pythagoras/_090_swarming_portals/swarming_portals.py,sha256=e74c34a4ebb2751bb7aa037db0bd2f9c1feca35596d847c44052c5123fb60146,11717
52
52
  pythagoras/_100_top_level_API/__init__.py,sha256=b392edc2c918da7c2444f14accfd0fac2cd0d5cf6849c64ed2433dfdb58b8b75,64
53
53
  pythagoras/_100_top_level_API/default_local_portal.py,sha256=cfbe20499fed2f038b507b44fb58bb4cb6ea2fbe2fe93a3ab5ad7f3ac655005f,215
54
54
  pythagoras/_100_top_level_API/top_level_API.py,sha256=4b63575b86df2fdf28e93c67e8d33411e05bd67cf016d3d297ec9635ebc04081,906
@@ -61,7 +61,7 @@ pythagoras/_800_signatures_and_converters/random_signatures.py,sha256=c174f28c04
61
61
  pythagoras/_900_project_stats_collector/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
62
62
  pythagoras/_900_project_stats_collector/project_analyzer.py,sha256=d06e9d7b516cb7424ef777e70abe9d5220e09b0b19476326b8974b4dc3917f89,3506
63
63
  pythagoras/__init__.py,sha256=13b5aaf4128704dea052fc03a3a3488f1b14c3638dec45a9a29c74a4fbed7e24,1089
64
- pythagoras/core/__init__.py,sha256=a6c3ec6f7d3e69221be505fd344061b774b0eb5c2f18431f39abb9426cb5d0cc,233
65
- pythagoras-0.21.2.dist-info/WHEEL,sha256=607c46fee47e440c91332c738096ff0f5e54ca3b0818ee85462dd5172a38e793,79
66
- pythagoras-0.21.2.dist-info/METADATA,sha256=7cd63d9c49b121a010cedc180c7ba91cc83826d3f1d05b982ca09b8090f5eb34,4241
67
- pythagoras-0.21.2.dist-info/RECORD,,
64
+ pythagoras/core/__init__.py,sha256=6872efc506b375f46a9577e1a4a1b2e9751a71834c1acda923b6214b32ad7f6e,286
65
+ pythagoras-0.21.3.dist-info/WHEEL,sha256=607c46fee47e440c91332c738096ff0f5e54ca3b0818ee85462dd5172a38e793,79
66
+ pythagoras-0.21.3.dist-info/METADATA,sha256=787fed7b1c9e98a64692ee74ac2ac463b9485740a2d10560f3aa9fbe3bd89622,4241
67
+ pythagoras-0.21.3.dist-info/RECORD,,