diff --git a/doc/python_api_reference_vDev.md b/doc/python_api_reference_vDev.md index 87fabcd96..f4abc797a 100644 --- a/doc/python_api_reference_vDev.md +++ b/doc/python_api_reference_vDev.md @@ -1962,7 +1962,7 @@ def from_file( ... with open(path, 'w') as f: ... print('CNOT 4 5', file=f) ... with open(path) as f: - ... circuit = stim.Circuit.from_file(path) + ... circuit = stim.Circuit.from_file(f) >>> circuit stim.Circuit(''' CX 4 5 @@ -7292,7 +7292,7 @@ def from_file( ... with open(path, 'w') as f: ... print('error(0.25) D2 D3', file=f) ... with open(path) as f: - ... circuit = stim.DetectorErrorModel.from_file(path) + ... circuit = stim.DetectorErrorModel.from_file(f) >>> circuit stim.DetectorErrorModel(''' error(0.25) D2 D3 diff --git a/doc/stim.pyi b/doc/stim.pyi index abce4a1ab..610ddc01b 100644 --- a/doc/stim.pyi +++ b/doc/stim.pyi @@ -1350,7 +1350,7 @@ class Circuit: ... with open(path, 'w') as f: ... print('CNOT 4 5', file=f) ... with open(path) as f: - ... circuit = stim.Circuit.from_file(path) + ... circuit = stim.Circuit.from_file(f) >>> circuit stim.Circuit(''' CX 4 5 @@ -5714,7 +5714,7 @@ class DetectorErrorModel: ... with open(path, 'w') as f: ... print('error(0.25) D2 D3', file=f) ... with open(path) as f: - ... circuit = stim.DetectorErrorModel.from_file(path) + ... circuit = stim.DetectorErrorModel.from_file(f) >>> circuit stim.DetectorErrorModel(''' error(0.25) D2 D3 diff --git a/glue/python/src/stim/__init__.pyi b/glue/python/src/stim/__init__.pyi index abce4a1ab..610ddc01b 100644 --- a/glue/python/src/stim/__init__.pyi +++ b/glue/python/src/stim/__init__.pyi @@ -1350,7 +1350,7 @@ class Circuit: ... with open(path, 'w') as f: ... print('CNOT 4 5', file=f) ... with open(path) as f: - ... circuit = stim.Circuit.from_file(path) + ... circuit = stim.Circuit.from_file(f) >>> circuit stim.Circuit(''' CX 4 5 @@ -5714,7 +5714,7 @@ class DetectorErrorModel: ... with open(path, 'w') as f: ... print('error(0.25) D2 D3', file=f) ... with open(path) as f: - ... circuit = stim.DetectorErrorModel.from_file(path) + ... circuit = stim.DetectorErrorModel.from_file(f) >>> circuit stim.DetectorErrorModel(''' error(0.25) D2 D3 diff --git a/src/stim/circuit/circuit.pybind.cc b/src/stim/circuit/circuit.pybind.cc index 06cb84c04..fd7e4779c 100644 --- a/src/stim/circuit/circuit.pybind.cc +++ b/src/stim/circuit/circuit.pybind.cc @@ -1406,7 +1406,7 @@ void stim_pybind::pybind_circuit_methods(pybind11::module &, pybind11::class_>> circuit stim.Circuit(''' CX 4 5 diff --git a/src/stim/dem/detector_error_model.pybind.cc b/src/stim/dem/detector_error_model.pybind.cc index b2729c070..3ffbe6991 100644 --- a/src/stim/dem/detector_error_model.pybind.cc +++ b/src/stim/dem/detector_error_model.pybind.cc @@ -930,7 +930,7 @@ void stim_pybind::pybind_detector_error_model_methods( ... with open(path, 'w') as f: ... print('error(0.25) D2 D3', file=f) ... with open(path) as f: - ... circuit = stim.DetectorErrorModel.from_file(path) + ... circuit = stim.DetectorErrorModel.from_file(f) >>> circuit stim.DetectorErrorModel(''' error(0.25) D2 D3