qctrl-workflow-client 5.4.0__tar.gz → 5.5.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: qctrl-workflow-client
3
- Version: 5.4.0
3
+ Version: 5.5.1
4
4
  Summary: Q-CTRL Workflow Client
5
5
  License: https://q-ctrl.com/terms
6
6
  Keywords: black opal,boulder opal,fire opal,nisq,open controls,q control,q ctrl,q-control,q-ctrl,qcontrol,qctrl,quantum,quantum algorithms,quantum circuits,quantum coding,quantum coding software,quantum computing,quantum control,quantum control software,quantum control theory,quantum engineering,quantum error correction,quantum firmware,quantum fundamentals,quantum sensing,qubit,qudit
@@ -31,7 +31,7 @@ Requires-Dist: gql (>=3.4.0,<4.0.0)
31
31
  Requires-Dist: importlib-metadata (>=6.8.0,<7.0.0)
32
32
  Requires-Dist: packaging (>=23.1.0,<24.0.0)
33
33
  Requires-Dist: qctrl-client (>=10.1.0,<11.0.0)
34
- Requires-Dist: qctrl-commons (==23.3.0)
34
+ Requires-Dist: qctrl-commons (>=24.0.0,<25.0.0)
35
35
  Requires-Dist: requests (>=2.32.0,<3.0.0)
36
36
  Requires-Dist: tenacity (>=8.1.0,<9.0.0)
37
37
  Requires-Dist: tomli (>=2.2.1,<3.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "qctrl-workflow-client"
3
- version = "5.4.0"
3
+ version = "5.5.1"
4
4
  description = "Q-CTRL Workflow Client"
5
5
  license = "https://q-ctrl.com/terms"
6
6
  authors = ["Q-CTRL <support@q-ctrl.com>"]
@@ -81,7 +81,7 @@ gql = "^3.4.0"
81
81
  tenacity = "^8.1.0"
82
82
  requests = "^2.32.0"
83
83
  packaging = "^23.1.0"
84
- qctrl-commons = { version = "23.3.0", source = "PyPI" }
84
+ qctrl-commons = { version = "^24.0.0", source = "PyPI" }
85
85
  qctrl-client = { version = "^10.1.0", source = "PyPI" }
86
86
 
87
87
  [tool.poetry.group.dev.dependencies]
@@ -11,7 +11,7 @@
11
11
  # distributed under the License is distributed on an "AS IS" BASIS. See the
12
12
  # License for the specific language.
13
13
 
14
- __version__ = "5.4.0"
14
+ __version__ = "5.5.1"
15
15
 
16
16
  from .defaults import get_authenticated_client_for_product
17
17
  from .functions import (
@@ -688,6 +688,35 @@ class ApiRouter(BaseRouter):
688
688
  )
689
689
  return response["tenant"]["tenant"]["currentInstances"]
690
690
 
691
+ def get_usage_time(self) -> float:
692
+ """
693
+ Return the total usage time of the machines in the user's cloud environment.
694
+ """
695
+ _query = gql.gql(
696
+ """
697
+ query UsageSummary($organizationId: ID!) {
698
+ tenant(organizationId: $organizationId) {
699
+ tenant {
700
+ usageSummary {
701
+ allocatedComputeSeconds
702
+ usedComputeSeconds
703
+ availableComputeSeconds
704
+ }
705
+ }
706
+ errors {
707
+ message
708
+ }
709
+ }
710
+ }
711
+ """
712
+ )
713
+
714
+ response = self._client.execute(
715
+ _query,
716
+ {"organizationId": self._get_configured_organization().organization_id},
717
+ )
718
+ return response["tenant"]["tenant"]["usageSummary"]
719
+
691
720
  def shut_down_machines(self) -> dict[str, Any]:
692
721
  """
693
722
  Shut down all the machines in the user's cloud environment.