hestia-earth-utils 0.16.16__tar.gz → 0.16.18__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.
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/PKG-INFO +1 -1
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pipeline.py +27 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/pivot_json.py +10 -3
- hestia_earth_utils-0.16.18/hestia_earth/utils/version.py +1 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/PKG-INFO +1 -1
- hestia_earth_utils-0.16.16/hestia_earth/utils/version.py +0 -1
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/MANIFEST.in +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/README.md +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/bin/hestia-format-upload +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/bin/hestia-pivot-csv +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/__init__.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/api.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/blank_node.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/calculation_status.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/cycle.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/date.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/descriptive_stats.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/emission.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/lookup.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/lookup_utils.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/model.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/__init__.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/_shared.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/pivot_csv.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/request.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/stats.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/__init__.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/_azure_client.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/_local_client.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/_s3_client.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/_sns_client.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/table.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/term.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/tools.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/SOURCES.txt +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/dependency_links.txt +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/requires.txt +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/top_level.txt +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/setup.cfg +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/setup.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_api.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_blank_node.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_calculation_status.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_cycle.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_date.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_descriptive_stats.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_emission.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_lookup.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_lookup_utils.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_model.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_pipeline.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_request.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_stats.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_table.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_term.py +0 -0
- {hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/tests/test_tools.py +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from os.path import join
|
|
2
3
|
import json
|
|
3
4
|
import numpy as np
|
|
@@ -375,3 +376,29 @@ def get_related_nodes_data(
|
|
|
375
376
|
}
|
|
376
377
|
for node in related_nodes
|
|
377
378
|
]
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def start_instances(multiple_instances: bool = False):
|
|
382
|
+
import boto3
|
|
383
|
+
|
|
384
|
+
client = boto3.client("ec2")
|
|
385
|
+
instance_ids = os.getenv("START_INSTANCE_ID").split(",")
|
|
386
|
+
ids = instance_ids if multiple_instances else [instance_ids[0]]
|
|
387
|
+
try:
|
|
388
|
+
for instance_id in ids:
|
|
389
|
+
response = client.describe_instances(InstanceIds=[instance_id])
|
|
390
|
+
state = response["Reservations"][0]["Instances"][0]["State"]["Name"]
|
|
391
|
+
print(f"Checking {instance_id}: Current state is '{state}'")
|
|
392
|
+
|
|
393
|
+
if state in ["pending", "running"]:
|
|
394
|
+
print(f" -> Instance {instance_id} is already active. Skipping.")
|
|
395
|
+
continue
|
|
396
|
+
|
|
397
|
+
elif state == "stopped":
|
|
398
|
+
print(f" -> Instance {instance_id} is stopped. Starting it now...")
|
|
399
|
+
client.start_instances(InstanceIds=[instance_id])
|
|
400
|
+
break
|
|
401
|
+
except client.exceptions.ClientError as e:
|
|
402
|
+
print(f"Error starting instances: {str(e)}")
|
|
403
|
+
|
|
404
|
+
print("Could not start any instance")
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/pivot_json.py
RENAMED
|
@@ -51,6 +51,13 @@ def _combine_node_ids(nodes: list):
|
|
|
51
51
|
return {"@id": ";".join([node.get("@id", node.get("id")) for node in nodes])}
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
_COMPACT_JSON_KEYS = ["boundary", "distribution", "covarianceMatrix"]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _combine_json_compact(key: str, value: dict):
|
|
58
|
+
return json.dumps(value).replace(" ", "") if key in _COMPACT_JSON_KEYS else value
|
|
59
|
+
|
|
60
|
+
|
|
54
61
|
def _base_pivoted_value(key: str, value, is_top_level: bool):
|
|
55
62
|
# handle list of Nodes
|
|
56
63
|
return (
|
|
@@ -58,13 +65,13 @@ def _base_pivoted_value(key: str, value, is_top_level: bool):
|
|
|
58
65
|
_combine_node_ids(value)
|
|
59
66
|
if isinstance(value[0], dict) and value[0].get("@type") in NODE_TYPES
|
|
60
67
|
else (
|
|
61
|
-
|
|
62
|
-
if any([is_top_level, key in
|
|
68
|
+
_combine_json_compact(key, value)
|
|
69
|
+
if any([is_top_level, key in _COMPACT_JSON_KEYS])
|
|
63
70
|
else value
|
|
64
71
|
)
|
|
65
72
|
)
|
|
66
73
|
if isinstance(value, list)
|
|
67
|
-
else value
|
|
74
|
+
else _combine_json_compact(key, value)
|
|
68
75
|
)
|
|
69
76
|
|
|
70
77
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "0.16.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "0.16.16"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/calculation_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/descriptive_stats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/lookup_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/__init__.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/_shared.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/pivot/pivot_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/_s3_client.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth/utils/storage/_sns_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{hestia_earth_utils-0.16.16 → hestia_earth_utils-0.16.18}/hestia_earth_utils.egg-info/top_level.txt
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|