qmenta-client 1.1.dev1436__py3-none-any.whl → 1.1.dev1446__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.
qmenta/client/Project.py CHANGED
@@ -1693,6 +1693,44 @@ class Project:
1693
1693
 
1694
1694
  return True
1695
1695
 
1696
+ def restart_analysis(self, analysis_id):
1697
+ """
1698
+ Restart an analysis. Only worklows can be restarted, the finished
1699
+ tools within the workflow will be kept and the missing ones
1700
+ (which probably previously failed) will start. This process maintains
1701
+ the flow of the workflow.
1702
+
1703
+ Tools can not be restarted given that they are considered as single
1704
+ processing units. You can start execution of another analysis instead.
1705
+
1706
+ For the workflow to restart, all its failed child must be removed first.
1707
+ You can only restart your own analysis.
1708
+
1709
+ :param analysis_id: id of the analysis to be restarted
1710
+ :type analysis_id: Int
1711
+ """
1712
+ logger = logging.getLogger(logger_name)
1713
+
1714
+ analysis = self.list_analysis({"id": analysis_id})[0]
1715
+
1716
+ if analysis.get("super_analysis_type") != 1:
1717
+ raise ValueError("The analysis indicated is not a workflow and hence, it cannot be restarted.")
1718
+
1719
+ try:
1720
+ platform.parse_response(
1721
+ platform.post(
1722
+ auth=self._account.auth,
1723
+ endpoint="analysis_manager/restart_analysis",
1724
+ data={"analysis_id": analysis_id},
1725
+ timeout=1000,
1726
+ )
1727
+ )
1728
+ except errors.PlatformError as error:
1729
+ logger.error("Could not delete analysis: {}".format(error))
1730
+ return False
1731
+
1732
+ return True
1733
+
1696
1734
  def get_analysis_log(self, analysis_id, file_name=None):
1697
1735
  """
1698
1736
  Get the log of an analysis and save it in the provided file.
@@ -2003,6 +2041,10 @@ class Project:
2003
2041
  return False
2004
2042
 
2005
2043
  try:
2044
+ for rule in res["rules"]:
2045
+ del rule["_id"]
2046
+ del rule["order"]
2047
+ del rule["time_modified"]
2006
2048
  with open(rules_file_path, "w") as fr:
2007
2049
  json.dump(res["rules"], fr, indent=4)
2008
2050
  except FileNotFoundError:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: qmenta-client
3
- Version: 1.1.dev1436
3
+ Version: 1.1.dev1446
4
4
  Summary: Python client lib to interact with the QMENTA platform.
5
5
  Author: QMENTA
6
6
  Author-email: dev@qmenta.com
@@ -1,10 +1,10 @@
1
1
  qmenta/__init__.py,sha256=jv2YF__bseklT3OWEzlqJ5qE24c4aWd5F4r0TTjOrWQ,65
2
2
  qmenta/client/Account.py,sha256=S9D0-lmcBln2o3DwJfmLfu5G2wjE7gEJCIeJu89v0Is,9647
3
3
  qmenta/client/File.py,sha256=ZgvSqejIosUt4uoX7opUnPnp5XGEaJNMRwFC0mQVB8k,5344
4
- qmenta/client/Project.py,sha256=eM6eT6H4d98ExWy-RWLdBbVO_QdW-AyML_Z8wZV5t0U,81881
4
+ qmenta/client/Project.py,sha256=7MPUskUznuCSN7SOdNyIZckDcnBnJvlMnIoIbF3KvzE,83483
5
5
  qmenta/client/Subject.py,sha256=lhxxVdQ6d-GNoQC8mrJwa4L1f44nJc4PcJtDspmKN7I,8756
6
6
  qmenta/client/__init__.py,sha256=AjTojBhZeW5nl0i605KS8S1Gl5tPNc1hdzD47BGNfoI,147
7
7
  qmenta/client/utils.py,sha256=5DK2T_HQprrCwLS0Ycm2CjseaYmAUKaJkJvYoW-Rqzc,2479
8
- qmenta_client-1.1.dev1436.dist-info/METADATA,sha256=Jh3CC_0kIS-G0S3doF1Y4Y3ZO7ds9uGJyFE1KElCX6s,672
9
- qmenta_client-1.1.dev1436.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
10
- qmenta_client-1.1.dev1436.dist-info/RECORD,,
8
+ qmenta_client-1.1.dev1446.dist-info/METADATA,sha256=Itzicjy42tkFa1VpEvKNWSu4X7YpB6AFfeA63CFwZv8,672
9
+ qmenta_client-1.1.dev1446.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
10
+ qmenta_client-1.1.dev1446.dist-info/RECORD,,