sciveo 0.1.12__tar.gz → 0.1.13__tar.gz

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.
Files changed (43) hide show
  1. {sciveo-0.1.12 → sciveo-0.1.13}/PKG-INFO +1 -1
  2. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/configuration.py +28 -12
  3. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/logger.py +4 -1
  4. sciveo-0.1.13/sciveo/version.py +2 -0
  5. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo.egg-info/PKG-INFO +1 -1
  6. sciveo-0.1.12/sciveo/version.py +0 -2
  7. {sciveo-0.1.12 → sciveo-0.1.13}/README.md +0 -0
  8. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/__init__.py +0 -0
  9. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/api/__init__.py +0 -0
  10. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/api/base.py +0 -0
  11. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/api/upload.py +0 -0
  12. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/cli.py +0 -0
  13. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/__init__.py +0 -0
  14. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/configuration.py +0 -0
  15. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/model.py +0 -0
  16. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/optimizers.py +0 -0
  17. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/sampling.py +0 -0
  18. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/__init__.py +0 -0
  19. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/daemon.py +0 -0
  20. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/formating.py +0 -0
  21. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/hardware.py +0 -0
  22. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/synchronized.py +0 -0
  23. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/common/tools/timers.py +0 -0
  24. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/content/__init__.py +0 -0
  25. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/content/dataset.py +0 -0
  26. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/content/experiment.py +0 -0
  27. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/content/project.py +0 -0
  28. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/content/runner.py +0 -0
  29. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/monitoring/__init__.py +0 -0
  30. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/monitoring/monitor.py +0 -0
  31. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/monitoring/network.py +0 -0
  32. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo/monitoring/start.py +0 -0
  33. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo.egg-info/SOURCES.txt +0 -0
  34. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo.egg-info/dependency_links.txt +0 -0
  35. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo.egg-info/entry_points.txt +0 -0
  36. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo.egg-info/requires.txt +0 -0
  37. {sciveo-0.1.12 → sciveo-0.1.13}/sciveo.egg-info/top_level.txt +0 -0
  38. {sciveo-0.1.12 → sciveo-0.1.13}/setup.cfg +0 -0
  39. {sciveo-0.1.12 → sciveo-0.1.13}/setup.py +0 -0
  40. {sciveo-0.1.12 → sciveo-0.1.13}/test/test_configuration.py +0 -0
  41. {sciveo-0.1.12 → sciveo-0.1.13}/test/test_monitoring.py +0 -0
  42. {sciveo-0.1.12 → sciveo-0.1.13}/test/test_runner.py +0 -0
  43. {sciveo-0.1.12 → sciveo-0.1.13}/test/test_sampling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -10,6 +10,7 @@
10
10
  #
11
11
 
12
12
  import os
13
+ import json
13
14
  import threading
14
15
 
15
16
 
@@ -44,22 +45,37 @@ class GlobalConfiguration:
44
45
  key = key.lower()
45
46
  return self.data.get(key, self.default.get(key, ""))
46
47
 
48
+ def save_kv(self, key, value):
49
+ key = key.strip().lower().replace("sciveo_", "")
50
+ value = value.strip()
51
+ self.data[key] = value
52
+
47
53
  def read_environment(self):
48
54
  for k, v in os.environ.items():
49
- k = k.lower()
50
- if k.startswith("sciveo_"):
51
- k = k.replace("sciveo_", "")
52
- self.data[k] = v
55
+ self.save_kv(k, v)
56
+
57
+ def read_file(self, path):
58
+ with open(path, 'r') as fp:
59
+ lines = fp.readlines()
60
+ for line in lines:
61
+ parts = line.strip().split('=')
62
+ if len(parts) == 2:
63
+ self.save_kv(parts[0], parts[1])
64
+
65
+ def read_json(self, path):
66
+ data_json = {}
67
+ with open(path, 'r') as fp:
68
+ data_json = json.load(fp)
69
+ for key, value in data_json.items():
70
+ self.save_kv(key, value)
53
71
 
54
72
  def read_local_files(self):
55
73
  if os.path.exists(self.base_path):
56
74
  for path, _, files in os.walk(self.base_path):
57
75
  for file_name in files:
58
- with open(os.path.join(path, file_name), 'r') as fp:
59
- lines = fp.readlines()
60
- for line in lines:
61
- parts = line.strip().split('=')
62
- if len(parts) == 2:
63
- key = parts[0].strip().lower().replace("sciveo_", "")
64
- value = parts[1].strip()
65
- self.data[key] = value
76
+ file_path = os.path.join(path, file_name)
77
+ _, file_extension = os.path.splitext(file_name)
78
+ if file_extension == ".json":
79
+ self.read_json(file_path)
80
+ else:
81
+ self.read_file(file_path)
@@ -44,4 +44,7 @@ def warning(*args):
44
44
  def error(*args):
45
45
  _sciveo_get_logger(SCIVEO_LOGGER_NAME).error(args)
46
46
  def critical(*args):
47
- _sciveo_get_logger(SCIVEO_LOGGER_NAME).critical(args)
47
+ _sciveo_get_logger(SCIVEO_LOGGER_NAME).critical(args)
48
+ def exception(e, *args):
49
+ e_str = ''.join(traceback.format_tb(e.__traceback__))
50
+ _sciveo_get_logger(SCIVEO_LOGGER_NAME).error(e_str, args)
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.1.13'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.1.12'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes