Skip to content

Commit 9976b09

Browse files
committed
refactor: move randomization implementations to qpu/experimental
1 parent 276ea18 commit 9976b09

File tree

17 files changed

+33
-22
lines changed

17 files changed

+33
-22
lines changed

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
crates/lib/src/qpu/experimental @erichulburd
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod random;
2+
pub mod randomized_measurements;

crates/lib/src/qpu/randomized_measurements.rs renamed to crates/lib/src/qpu/experimental/randomized_measurements.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use quil_rs::{
1515

1616
use crate::executable::Parameters;
1717

18-
use super::extern_call::{ExternedCall, PrngSeedValue};
18+
use super::random::{ExternedCall, PrngSeedValue};
1919

2020
#[derive(Debug, Clone, thiserror::Error)]
2121
pub enum Error {

crates/lib/src/qpu/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ use tokio::time::error::Elapsed;
1616

1717
pub mod api;
1818
mod execution;
19-
pub mod extern_call;
20-
pub mod randomized_measurements;
19+
pub mod experimental;
2120
pub mod result_data;
2221
pub mod translation;
2322

crates/python/qcs_sdk/_tracing_subscriber/common/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = common.__doc__
1717
__all__ = getattr(common, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212

1313
from typing import Dict, Optional, final
1414

15+
1516
@final
1617
class InstrumentationLibrary:
1718
"""
1819
Information about a library or crate providing instrumentation.
19-
20+
2021
An instrumentation library should be named to follow any naming conventions
2122
of the instrumented library (e.g. 'middleware' for a web framework).
22-
23+
2324
See the `instrumentation libraries <https://github.com/open-telemetry/opentelemetry-specification/blob/v1.9.0/specification/overview.md#instrumentation-libraries>`_
2425
spec for more information.
2526
"""
@@ -41,3 +42,4 @@ class InstrumentationLibrary:
4142
:param attributes: The attributes of the instrumentation library.
4243
"""
4344
...
45+

crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = layers.__doc__
1717
__all__ = getattr(layers, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.pyi

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
from __future__ import annotations
1414
from typing import TYPE_CHECKING
1515

16-
from . import file as file
16+
from . import file as file
1717
from . import otel_otlp_file as otel_otlp_file
1818
from . import otel_otlp as otel_otlp
1919

2020
if TYPE_CHECKING:
21-
from typing import Union
21+
from typing import Union
2222

23-
Config = Union[
24-
file.Config,
25-
otel_otlp_file.Config,
26-
otel_otlp.Config,
27-
]
28-
"""
23+
Config = Union[
24+
file.Config,
25+
otel_otlp_file.Config,
26+
otel_otlp.Config,
27+
]
28+
"""
2929
One of the supported layer configurations that may be set on the subscriber configuration.
3030
"""

crates/python/qcs_sdk/_tracing_subscriber/layers/file/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515

1616
__doc__ = file.__doc__
1717
__all__ = getattr(file, "__all__", [])
18+
19+

crates/python/qcs_sdk/_tracing_subscriber/layers/file/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ class Config:
3939
:param json: Whether or not to format the output as JSON. Defaults to `True`.
4040
"""
4141
...
42+

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = otel_otlp.__doc__
1717
__all__ = getattr(otel_otlp, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class Resource:
4848
schema_url: Optional[str] = None,
4949
) -> "Resource": ...
5050

51+
52+
5153
@final
5254
class Config:
5355
"""
@@ -99,14 +101,14 @@ class Config:
99101
...
100102

101103
if TYPE_CHECKING:
102-
from typing import List, Union
104+
from typing import List, Union
103105

104106
ResourceValueArray = Union[List[bool], List[int], List[float], List[str]]
105107
"""
106108
An array of `ResourceValue`s. This array is homogenous, so all values must be of the same type.
107109
"""
108110

109-
ResourceValue = Union[bool, int, float, str, ResourceValueArray]
111+
ResourceValue= Union[bool, int, float, str, ResourceValueArray]
110112
"""
111113
A value that can be added to a `Resource`.
112114
"""

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = otel_otlp_file.__doc__
1717
__all__ = getattr(otel_otlp_file, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,15 @@
1313
from typing import Optional, final
1414
from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary
1515

16+
1617
@final
1718
class Config:
1819
"""
1920
A configuration for `opentelemetry-stdout <https://docs.rs/opentelemetry-stdout/latest/opentelemetry_stdout/>`_
2021
layer.
2122
"""
2223

23-
def __new__(
24-
cls,
25-
*,
26-
file_path: Optional[str] = None,
27-
filter: Optional[str] = None,
28-
instrumentation_library: Optional[InstrumentationLibrary] = None,
29-
) -> "Config":
24+
def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None, instrumentation_library: Optional[InstrumentationLibrary] = None) -> "Config":
3025
"""
3126
:param file_path: The path to the file to write to. If not specified, defaults to stdout.
3227
:param filter: A filter string to use for this layer. This uses the same format as the
@@ -40,3 +35,4 @@ class Config:
4035
:param instrumentation_library: Information about the library providing the tracing instrumentation.
4136
"""
4237
...
38+

crates/python/qcs_sdk/_tracing_subscriber/subscriber/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = subscriber.__doc__
1717
__all__ = getattr(subscriber, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/subscriber/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ class Config:
2222
"""
2323

2424
def __new__(cls, *, layer: layers.Config) -> "Config": ...
25+

0 commit comments

Comments
 (0)