isar 1.16.14__py3-none-any.whl → 1.16.16__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.

Potentially problematic release.


This version of isar might be problematic. Click here for more details.

@@ -349,12 +349,26 @@ class StateMachine(object):
349
349
  self.stopped = True
350
350
 
351
351
  def _initiate_failed(self) -> None:
352
- self.current_step.status = StepStatus.Failed
353
- self.current_task.update_task_status()
354
- self.current_mission.status = MissionStatus.Failed
355
- self.publish_step_status(step=self.current_step)
356
- self.publish_task_status(task=self.current_task)
357
- self._finalize()
352
+ if self.stepwise_mission:
353
+ self.current_step.status = StepStatus.Failed
354
+ self.current_task.update_task_status()
355
+ self.current_mission.status = MissionStatus.Failed
356
+ self.publish_step_status(step=self.current_step)
357
+ self.publish_task_status(task=self.current_task)
358
+ self._finalize()
359
+
360
+ else:
361
+ self.current_task = None
362
+ step_status: StepStatus = StepStatus.Cancelled
363
+ task_status: TaskStatus = TaskStatus.Cancelled
364
+
365
+ for task in self.current_mission.tasks:
366
+ task.status = task_status
367
+ for step in task.steps:
368
+ step.status = step_status
369
+ self.publish_step_status(step=step)
370
+ self.publish_task_status(task=task)
371
+ self._finalize()
358
372
 
359
373
  def _initiate_infeasible(self) -> None:
360
374
  if self.stepwise_mission:
@@ -103,7 +103,7 @@ class Initiate(State):
103
103
  f"{str(self.state_machine.current_mission.id)[:8]} because: "
104
104
  f"{e.error_description}"
105
105
  )
106
- transition = self.state_machine.initiate_infeasible # type: ignore
106
+ transition = self.state_machine.initiate_failed # type: ignore
107
107
  break
108
108
 
109
109
  except RobotException as e:
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  from pathlib import Path
3
+ from typing import Union
3
4
 
4
5
  from azure.core.exceptions import ResourceExistsError
5
6
  from azure.storage.blob import BlobClient, BlobServiceClient, ContainerClient
@@ -7,10 +8,10 @@ from injector import inject
7
8
 
8
9
  from isar.config.keyvault.keyvault_service import Keyvault
9
10
  from isar.config.settings import settings
10
- from robot_interface.models.mission.mission import Mission
11
11
  from isar.storage.storage_interface import StorageException, StorageInterface
12
12
  from isar.storage.utilities import construct_metadata_file, construct_paths
13
13
  from robot_interface.models.inspection.inspection import Inspection
14
+ from robot_interface.models.mission.mission import Mission
14
15
 
15
16
 
16
17
  class BlobStorage(StorageInterface):
@@ -31,7 +32,7 @@ class BlobStorage(StorageInterface):
31
32
 
32
33
  self.logger = logging.getLogger("uploader")
33
34
 
34
- def store(self, inspection: Inspection, mission: Mission) -> str:
35
+ def store(self, inspection: Inspection, mission: Mission) -> Union[str, dict]:
35
36
  data_path, metadata_path = construct_paths(
36
37
  inspection=inspection, mission=mission
37
38
  )
@@ -43,7 +44,7 @@ class BlobStorage(StorageInterface):
43
44
  self._upload_file(path=metadata_path, data=metadata_bytes)
44
45
  return self._upload_file(path=data_path, data=inspection.data)
45
46
 
46
- def _upload_file(self, path: Path, data: bytes) -> str:
47
+ def _upload_file(self, path: Path, data: bytes) -> Union[str, dict]:
47
48
  blob_client = self._get_blob_client(path)
48
49
  try:
49
50
  blob_properties = blob_client.upload_blob(data=data)
@@ -55,7 +56,14 @@ class BlobStorage(StorageInterface):
55
56
  except Exception as e:
56
57
  self.logger.error("An unexpected error occurred while uploading blob")
57
58
  raise StorageException from e
58
- return blob_properties["etag"]
59
+
60
+ absolute_inspection_path = {
61
+ "source": "blob",
62
+ "blob_storage_account_url": settings.BLOB_STORAGE_ACCOUNT_URL,
63
+ "blob_container": settings.BLOB_CONTAINER,
64
+ "blob_name": blob_client.blob_name,
65
+ }
66
+ return absolute_inspection_path
59
67
 
60
68
  def _get_blob_service_client(self) -> BlobServiceClient:
61
69
  try:
@@ -1,12 +1,13 @@
1
1
  from abc import ABCMeta, abstractmethod
2
+ from typing import Union
2
3
 
3
- from robot_interface.models.mission.mission import Mission
4
4
  from robot_interface.models.inspection.inspection import Inspection
5
+ from robot_interface.models.mission.mission import Mission
5
6
 
6
7
 
7
8
  class StorageInterface(metaclass=ABCMeta):
8
9
  @abstractmethod
9
- def store(self, inspection: Inspection, mission: Mission) -> str:
10
+ def store(self, inspection: Inspection, mission: Mission) -> Union[str, dict]:
10
11
  """
11
12
  Parameters
12
13
  ----------
isar/storage/uploader.py CHANGED
@@ -3,7 +3,7 @@ import logging
3
3
  from dataclasses import dataclass
4
4
  from datetime import datetime, timedelta
5
5
  from queue import Empty, Queue
6
- from typing import List
6
+ from typing import List, Union
7
7
 
8
8
  from injector import inject
9
9
 
@@ -100,8 +100,8 @@ class Uploader:
100
100
  except Empty:
101
101
  continue
102
102
 
103
- def _upload(self, upload_item: UploaderQueueItem) -> str:
104
- inspection_path = ""
103
+ def _upload(self, upload_item: UploaderQueueItem) -> Union[str, dict]:
104
+ inspection_path: Union[str, dict] = ""
105
105
  try:
106
106
  inspection_path = upload_item.storage_handler.store(
107
107
  inspection=upload_item.inspection, mission=upload_item.mission
@@ -140,7 +140,7 @@ class Uploader:
140
140
  )
141
141
 
142
142
  def _publish_inspection_result(
143
- self, inspection: Inspection, inspection_path: str
143
+ self, inspection: Inspection, inspection_path: Union[str, dict]
144
144
  ) -> None:
145
145
  """Publishes the reference of the inspection result to the MQTT Broker
146
146
  along with the analysis type
isar/storage/utilities.py CHANGED
@@ -79,4 +79,5 @@ def get_filename(
79
79
 
80
80
 
81
81
  def get_foldername(mission: Mission) -> str:
82
- return f"{datetime.utcnow().date()}__{settings.PLANT_SHORT_NAME}__{mission.name}__{mission.id}"
82
+ mission_name: str = mission.name.replace(" ", "-")
83
+ return f"{datetime.utcnow().date()}__{settings.PLANT_SHORT_NAME}__{mission_name}__{mission.id}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isar
3
- Version: 1.16.14
3
+ Version: 1.16.16
4
4
  Summary: Integration and Supervisory control of Autonomous Robots
5
5
  Home-page: https://github.com/equinor/isar
6
6
  Author: Equinor ASA
@@ -67,23 +67,23 @@ isar/services/utilities/queue_utilities.py,sha256=Pw3hehSwkXJNeDv-bDVDfs58VOwtt3
67
67
  isar/services/utilities/scheduling_utilities.py,sha256=LFimEmacML3J9q-FNLfKPhcAr-R3f2rkYkbsoro0Gyo,8434
68
68
  isar/services/utilities/threaded_request.py,sha256=py4G-_RjnIdHljmKFAcQ6ddqMmp-ZYV39Ece-dqRqjs,1874
69
69
  isar/state_machine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
- isar/state_machine/state_machine.py,sha256=ZqFg7CE291_X8Ix5NDQ3RGBLJx-fU3E007C82xyHMuk,23161
70
+ isar/state_machine/state_machine.py,sha256=HXH9XuXRUfhKZQdp5IfwV-Do-QRRConpyiUBFl_p-mU,23707
71
71
  isar/state_machine/states_enum.py,sha256=ks1A8gO7DOpLbSe6Vzq4-BfTCU78IsQZyoEJwQ9Wg4M,254
72
72
  isar/state_machine/states/__init__.py,sha256=gUikQDu-O-lmunwzwcN9gN6VaEmlCFlqqgdNfFAfXBc,189
73
73
  isar/state_machine/states/idle.py,sha256=tfciqI7NPDVF8WMe5qbSO3c-xDzUTQYLmJinb9e0JS8,1231
74
74
  isar/state_machine/states/initialize.py,sha256=Vx7OxWZI_xEkRwHWFh9ymxK_7mDH0Wayt09dGGqBJWk,2359
75
- isar/state_machine/states/initiate.py,sha256=N2v1zsGJ3Zavs750LwBHMvLOtPW0RF57vCG8zUyRU5k,5656
75
+ isar/state_machine/states/initiate.py,sha256=b0Fq3tN6TZMg5j4192OsYdGbphTXWCkftBsFX57mhrw,5652
76
76
  isar/state_machine/states/monitor.py,sha256=2eYv2wUH0MLwxZCizBHIpigELPeou6KzCzW_JuEVlls,8612
77
77
  isar/state_machine/states/off.py,sha256=jjqN_oJMpBtWuY7hP-c9f0w3p2CYCfe-NpmYHHPnmyI,544
78
78
  isar/state_machine/states/paused.py,sha256=xVZM9WMt90FTiP5forSlA3eJ5Vt9LzZYCFDQDPIocKA,1004
79
79
  isar/state_machine/states/stop.py,sha256=Sxdo4FGhxc2Pj91jidYtVIjpSNklbEf1sJYJ6x51HgE,3348
80
80
  isar/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
- isar/storage/blob_storage.py,sha256=8i23s_4d3_REKYxH1DzXF_Lc04pofOlrtDYML_t7BDc,2922
81
+ isar/storage/blob_storage.py,sha256=oKdml1VVN8iTr-d_5H4Lz5E7zrhJRknCzOxHD-tO7m8,3230
82
82
  isar/storage/local_storage.py,sha256=fLzVuwvdEk9l8z7od1qX2p5MeWzcsx-vN4yWvelZeFM,1836
83
83
  isar/storage/slimm_storage.py,sha256=Hp7ZIgZgIR4KAFjzxDKfgMZjPZwP2kmdc1gG8zVcsMk,8966
84
- isar/storage/storage_interface.py,sha256=v7QiYGz79dqw9jbgNoLYD1QOvXFoMrqfVT1TJX7rCsw,790
85
- isar/storage/uploader.py,sha256=QyviG27Km6a2hBXE8Ka_qX2GInCjs3u84RiUloG3DJ0,6294
86
- isar/storage/utilities.py,sha256=dqh60eJ00rKNNmNLBkV-oNcNToxXLS7oAJpisJZZ90c,3053
84
+ isar/storage/storage_interface.py,sha256=DYDry4I7aZpDHJhsBF6s8zrgokFAc7fdKJKfA8AvL7o,828
85
+ isar/storage/uploader.py,sha256=Jpjml4fwPOeApHWfYWEO4gCfIxJKotujUTz2-5TTCt0,6345
86
+ isar/storage/utilities.py,sha256=xnJHT_lu985k0Jlq7_Seu_nWVlocOCVAR8yz2zLkv5Q,3108
87
87
  robot_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  robot_interface/robot_interface.py,sha256=i2qw1V9mLO-ljtS7LiRliQ7XNmmBJIwD4NG8mDfwMEI,8317
89
89
  robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
@@ -107,8 +107,8 @@ robot_interface/telemetry/payloads.py,sha256=9EshERifjD1u8CwjSiV3NGuj0KuXnwblQNB
107
107
  robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  robot_interface/utilities/json_service.py,sha256=nU2Q_3P9Fq9hs6F_wtUjWtHfl_g1Siy-yDhXXSKwHwg,1018
109
109
  robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
110
- isar-1.16.14.dist-info/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
111
- isar-1.16.14.dist-info/METADATA,sha256=RXNRtJQxYWt3uDRBAkhqGyAINUL7jVB1bsYwkNIrezA,14752
112
- isar-1.16.14.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
113
- isar-1.16.14.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
114
- isar-1.16.14.dist-info/RECORD,,
110
+ isar-1.16.16.dist-info/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
111
+ isar-1.16.16.dist-info/METADATA,sha256=fLeCxrQbsKkMJql1a7UVagNLjQvbU0HpphQI0v7FiFI,14752
112
+ isar-1.16.16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
113
+ isar-1.16.16.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
114
+ isar-1.16.16.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5