Skip to content

Commit 12dc208

Browse files
authored
Merge pull request #8050 from microsoft/dependabot/npm_and_yarn/dot-github/pyright-1.1.409
Bump pyright from 1.1.408 to 1.1.409 in /.github
2 parents d402e30 + 660e926 commit 12dc208

10 files changed

Lines changed: 21 additions & 18 deletions

File tree

.github/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"devDependencies": {"pyright": "1.1.408"}}
1+
{"devDependencies": {"pyright": "1.1.409"}}

src/qcodes/dataset/dond/do_nd_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import logging
4-
from collections.abc import Callable, Iterator, Sequence
4+
from collections.abc import Callable, Generator, Sequence
55
from contextlib import contextmanager
66
from typing import TYPE_CHECKING
77

@@ -120,7 +120,7 @@ def _register_actions(
120120

121121

122122
@contextmanager
123-
def catch_interrupts() -> Iterator[Callable[[], MeasInterruptT | None]]:
123+
def catch_interrupts() -> Generator[Callable[[], MeasInterruptT | None], None, None]:
124124
interrupt_exception: MeasInterruptT | None = None
125125
interrupt_raised = False
126126

src/qcodes/dataset/sqlite/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from qcodes.utils import DelayedKeyboardInterrupt
1515

1616
if TYPE_CHECKING:
17-
from collections.abc import Iterator
17+
from collections.abc import Generator
1818

1919
log = logging.getLogger(__name__)
2020

@@ -46,7 +46,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
4646

4747

4848
@contextmanager
49-
def atomic(conn: AtomicConnection) -> Iterator[AtomicConnection]:
49+
def atomic(conn: AtomicConnection) -> Generator[AtomicConnection, None, None]:
5050
"""
5151
Guard a series of transactions as atomic.
5252

src/qcodes/dataset/sqlite/database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from qcodes.utils.types import complex_types, numpy_floats, numpy_ints
3030

3131
if TYPE_CHECKING:
32-
from collections.abc import Iterator
32+
from collections.abc import Generator
3333
from pathlib import Path
3434

3535
JournalMode = Literal["DELETE", "TRUNCATE", "PERSIST", "MEMORY", "WAL", "OFF"]
@@ -273,7 +273,7 @@ def initialise_or_create_database_at(
273273
@contextmanager
274274
def initialised_database_at(
275275
db_file_with_abs_path: str | Path, *, journal_mode: JournalMode | None = "WAL"
276-
) -> Iterator[None]:
276+
) -> Generator[None, None, None]:
277277
"""
278278
Initialises or creates a database at the specified location, configures QCoDeS to use this as the
279279
default database for the duration of the context, and restores the 'db_location' afterwards.

src/qcodes/instrument_drivers/AlazarTech/ATS.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .utils import TraceParameter
2020

2121
if TYPE_CHECKING:
22-
from collections.abc import Iterator, Sequence
22+
from collections.abc import Generator, Sequence
2323

2424
from typing_extensions import Unpack
2525

@@ -208,7 +208,7 @@ def get_idn(self) -> dict[str, str | int | None]: # type: ignore[override]
208208
}
209209

210210
@contextmanager
211-
def syncing(self) -> Iterator[None]:
211+
def syncing(self) -> Generator[None, None, None]:
212212
"""
213213
Context manager for syncing settings to Alazar card. It will
214214
automatically call sync_settings_to_card at the end of the

src/qcodes/logger/instrument_logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .logger import LevelType, get_console_handler, handler_level
1717

1818
if TYPE_CHECKING:
19-
from collections.abc import Iterator, Mapping, MutableMapping, Sequence
19+
from collections.abc import Generator, Mapping, MutableMapping, Sequence
2020

2121
from qcodes.instrument import InstrumentBase
2222

@@ -157,7 +157,7 @@ def filter_instrument(
157157
instrument: InstrumentBase | Sequence[InstrumentBase],
158158
handler: logging.Handler | Sequence[logging.Handler] | None = None,
159159
level: LevelType | None = None,
160-
) -> Iterator[None]:
160+
) -> Generator[None, None, None]:
161161
"""
162162
Context manager that adds a filter that only enables the log messages of
163163
the supplied instruments to pass.

src/qcodes/logger/log_analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from typing import TYPE_CHECKING
1414

1515
if TYPE_CHECKING:
16-
from collections.abc import Callable, Iterator, Sequence
16+
from collections.abc import Callable, Generator, Sequence
1717

1818
import numpy as np
1919
import numpy.typing as npt
@@ -156,7 +156,7 @@ def time_difference(
156156
@contextmanager
157157
def capture_dataframe(
158158
level: LevelType = logging.DEBUG, logger: logging.Logger | None = None
159-
) -> Iterator[tuple[logging.StreamHandler, Callable[[], pd.DataFrame]]]:
159+
) -> Generator[tuple[logging.StreamHandler, Callable[[], pd.DataFrame]], None, None]:
160160
"""
161161
Context manager to capture the logs in a :class:`pd.DataFrame`
162162

src/qcodes/logger/logger.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from typing import TYPE_CHECKING, Any, Self
1919

2020
if TYPE_CHECKING:
21-
from collections.abc import Iterator, Sequence
21+
from collections.abc import Generator, Sequence
2222
from types import TracebackType
2323

2424
import qcodes as qc
@@ -352,7 +352,7 @@ def running_in_test_or_tool() -> bool:
352352
@contextmanager
353353
def handler_level(
354354
level: LevelType, handler: "logging.Handler | Sequence[logging.Handler]"
355-
) -> "Iterator[None]":
355+
) -> "Generator[None, None, None]":
356356
"""
357357
Context manager to temporarily change the level of handlers.
358358
@@ -378,7 +378,7 @@ def handler_level(
378378

379379

380380
@contextmanager
381-
def console_level(level: LevelType) -> "Iterator[None]":
381+
def console_level(level: LevelType) -> "Generator[None, None, None]":
382382
"""
383383
Context manager to temporarily change the level of the qcodes console
384384
handler.

src/qcodes/utils/attribute_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import TYPE_CHECKING, Any, ClassVar
33

44
if TYPE_CHECKING:
5-
from collections.abc import Iterator, Sequence
5+
from collections.abc import Generator, Sequence
66

77

88
class DelegateAttributes:
@@ -165,7 +165,7 @@ def checked_getattr_indexed(
165165
@contextmanager
166166
def attribute_set_to(
167167
object_: object, attribute_name: str, new_value: Any
168-
) -> "Iterator[None]":
168+
) -> "Generator[None, None, None]":
169169
"""
170170
This context manager allows to change a given attribute of a given object
171171
to a new value, and the original value is reverted upon exit of the context

tests/parameter/test_group_parameter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ def test_update_group_parameter_reflected_in_cache_of_all_params() -> None:
221221
assert before <= dummy.a.cache.timestamp
222222
assert after >= dummy.a.cache.timestamp
223223

224+
assert dummy.b.cache.timestamp is not None
224225
assert before <= dummy.b.cache.timestamp
225226
assert after >= dummy.b.cache.timestamp
226227

@@ -244,6 +245,7 @@ def test_get_group_param_updates_cache_of_other_param() -> None:
244245
assert before <= dummy.a.cache.timestamp
245246
assert after >= dummy.a.cache.timestamp
246247

248+
assert dummy.b.cache.timestamp is not None
247249
assert before <= dummy.b.cache.timestamp
248250
assert after >= dummy.b.cache.timestamp
249251

@@ -267,6 +269,7 @@ def test_set_group_param_updates_cache_of_other_param() -> None:
267269
assert before <= dummy.a.cache.timestamp
268270
assert after >= dummy.a.cache.timestamp
269271

272+
assert dummy.b.cache.timestamp is not None
270273
assert before <= dummy.b.cache.timestamp
271274
assert after >= dummy.b.cache.timestamp
272275

0 commit comments

Comments
 (0)