pythagoras 0.20.8__py3-none-any.whl → 0.20.9__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.
@@ -1,2 +1,2 @@
1
1
  from .top_level_API import *
2
- from .default_local_portal import instantiate_default_local_portal
2
+ from .default_local_portal import *
@@ -0,0 +1,30 @@
1
+ import os
2
+ from urllib.parse import urlparse
3
+
4
+ from .._090_swarming_portals import SwarmingPortal
5
+
6
+
7
+ def _is_valid_url(url: str) -> bool:
8
+ try:
9
+ result = urlparse(url)
10
+ return all([result.scheme, result.netloc])
11
+ except ValueError:
12
+ return False
13
+
14
+ def _is_valid_folder_name(path_str):
15
+ if os.path.isdir(path_str):
16
+ return True
17
+ try:
18
+ os.makedirs(path_str, exist_ok=True)
19
+ return True
20
+ except OSError:
21
+ return False
22
+
23
+ def get_portal(url_or_foldername:str) -> SwarmingPortal:
24
+ """Create a return a portal object based on a URL or a directory. """
25
+ if _is_valid_folder_name(url_or_foldername):
26
+ return SwarmingPortal(url_or_foldername)
27
+ elif _is_valid_url(url_or_foldername):
28
+ raise NotImplementedError("URLы not supported yet ... stay turned")
29
+ else:
30
+ raise ValueError(f"Invalid folder name: {url_or_foldername}")
@@ -1,4 +1,5 @@
1
1
  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
- from .._090_swarming_portals import SwarmingPortal
4
+ from .._090_swarming_portals import SwarmingPortal
5
+ from .._100_top_level_API import get_portal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pythagoras
3
- Version: 0.20.8
3
+ Version: 0.20.9
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
@@ -61,7 +61,7 @@ data science, machine learning, and AI workflows.
61
61
  Pythagoras offers:
62
62
 
63
63
  * seamless parallel execution of Python code, locally or
64
- in diverse distributed environments of any scale;
64
+ in diverse distributed environments of virtually any scale;
65
65
  * ubiquitous caching for intermediate program states,
66
66
  with intelligent data and code change tracking;
67
67
  * simple and budget-friendly orchestration backend.
@@ -48,9 +48,9 @@ pythagoras/_090_swarming_portals/__init__.py,sha256=7041578f84ffa291f2752c7a2168
48
48
  pythagoras/_090_swarming_portals/output_suppressor.py,sha256=83e6cc9bcc62a226babb1165912ef5095ea948499ce5136a7516ac8b54522607,626
49
49
  pythagoras/_090_swarming_portals/swarming_portals.py,sha256=cb5240d0a070571a1b58d66fe3013c5d3123886ce4b266aeb35e95cc28d033fa,11633
50
50
  pythagoras/_090_swarming_portals/system_utils.py,sha256=d125a0b705b9f8477712179c49441daaf2cd2b0b0d4494b6ac977b2df87b50b5,1370
51
- pythagoras/_100_top_level_API/__init__.py,sha256=edac726311978503953fe4c37c475c7d616708236880f393b63894b9ab6251e5,95
51
+ pythagoras/_100_top_level_API/__init__.py,sha256=b392edc2c918da7c2444f14accfd0fac2cd0d5cf6849c64ed2433dfdb58b8b75,64
52
52
  pythagoras/_100_top_level_API/default_local_portal.py,sha256=cfbe20499fed2f038b507b44fb58bb4cb6ea2fbe2fe93a3ab5ad7f3ac655005f,215
53
- pythagoras/_100_top_level_API/top_level_API.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
53
+ pythagoras/_100_top_level_API/top_level_API.py,sha256=4b63575b86df2fdf28e93c67e8d33411e05bd67cf016d3d297ec9635ebc04081,906
54
54
  pythagoras/_800_signatures_and_converters/__init__.py,sha256=d9420254db0c62903fe5419612cef536f219ec319e81b7efc3e783a113aac93b,167
55
55
  pythagoras/_800_signatures_and_converters/base_16_32_convertors.py,sha256=66356d2a38e33203201d484cfb543da8b6160832a1965aaaf73e1880a2f4a828,1236
56
56
  pythagoras/_800_signatures_and_converters/current_date_gmt_str.py,sha256=2beac61f2ad112cc8175832aeef5abbf715d01a71ea56429bce7d3fe6ad9a8d3,268
@@ -60,7 +60,7 @@ pythagoras/_800_signatures_and_converters/random_signatures.py,sha256=c174f28c04
60
60
  pythagoras/_900_project_stats_collector/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
61
61
  pythagoras/_900_project_stats_collector/project_analyzer.py,sha256=d06e9d7b516cb7424ef777e70abe9d5220e09b0b19476326b8974b4dc3917f89,3506
62
62
  pythagoras/__init__.py,sha256=94303c01a7bde4078fdbd90c0b142807a023fa352c473c3a544a2180b7254ae9,1062
63
- pythagoras/core/__init__.py,sha256=26640880921763e8801b74da28fccf1cd47ac0ba0d40ee8fcaf7d748410406bf,189
64
- pythagoras-0.20.8.dist-info/WHEEL,sha256=1f21b63a61110964f543b6041e8b7da078f20c09d500a32cb79eee5c3d655f54,79
65
- pythagoras-0.20.8.dist-info/METADATA,sha256=da94d8c4b1a7c7173f25b935fb1f941baf58b6c9cbbc500add1e91854fba1b24,4177
66
- pythagoras-0.20.8.dist-info/RECORD,,
63
+ pythagoras/core/__init__.py,sha256=a6c3ec6f7d3e69221be505fd344061b774b0eb5c2f18431f39abb9426cb5d0cc,233
64
+ pythagoras-0.20.9.dist-info/WHEEL,sha256=1f21b63a61110964f543b6041e8b7da078f20c09d500a32cb79eee5c3d655f54,79
65
+ pythagoras-0.20.9.dist-info/METADATA,sha256=f3c36283f7d4eb1f8ab74c2314f1dd80ff883d831c3ea977662284c95f88fbf6,4187
66
+ pythagoras-0.20.9.dist-info/RECORD,,