Skip to content

Commit

Permalink
check with all std pyright rules except incompatible override
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Feb 2, 2024
1 parent 32bf66c commit 4f17970
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ reportMissingTypeStubs = true
stubPath = "typings/stubs"
# we would like to move this to at least standard
# eventually. From 1.1.339 onwards standard is the default
typeCheckingMode = "basic"
typeCheckingMode = "standard"
reportIncompatibleMethodOverride = false # we have a lot of these. We should eventually enable this


[tool.pytest.ini_options]
minversion = "7.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _acquire_time_trace(self) -> np.ndarray:
self.instrument.trigger.force()
data = self.instrument.fetch()

return data # pyright: ignore[reportUnboundVariable]
return data # pyright: ignore[reportPossiblyUnboundVariable]

def get_raw(self) -> np.ndarray: # pylint: disable=method-hidden

Expand Down
4 changes: 2 additions & 2 deletions src/qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, name: str, instance_id: Optional[str] = None,
**kwargs: Any):
self._check_hid_import()

devs = hid.HidDeviceFilter(
devs = hid.HidDeviceFilter( # pyright: ignore[reportPossiblyUnboundVariable]
product_id=self.product_id,
vendor_id=self.vendor_id,
instance_id=instance_id
Expand Down Expand Up @@ -144,7 +144,7 @@ def enumerate_devices(cls) -> list[str]:
"""
cls._check_hid_import()

devs = hid.HidDeviceFilter(
devs = hid.HidDeviceFilter( # pyright: ignore[reportPossiblyUnboundVariable]
porduct_id=cls.product_id,
vendor_id=cls.vendor_id
).get_devices()
Expand Down
8 changes: 5 additions & 3 deletions src/qcodes/instrument_drivers/tektronix/AWG70000A.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,17 @@ def __init__(
if add_channel_list:
# pyright does not seem to understand
# that this code can only run iff chanliss is created
chanlist.append(channel) # pyright: ignore[reportUnboundVariable]
chanlist.append( # pyright: ignore[reportPossiblyUnboundVariable]
channel
)

if add_channel_list:
self.add_submodule(
"channels",
chanlist.to_channel_tuple(), # pyright: ignore[reportUnboundVariable]
chanlist.to_channel_tuple(), # pyright: ignore[reportPossiblyUnboundVariable]
)

# Folder on the AWG where to files are uplaoded by default
# Folder on the AWG where to files are uploaded by default
self.wfmxFileFolder = "\\Users\\OEM\\Documents"
self.seqxFileFolder = "\\Users\\OEM\\Documents"

Expand Down
2 changes: 1 addition & 1 deletion src/qcodes/utils/spyder_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def add_to_spyder_UMR_excludelist(modulename: str) -> None:
if modulename not in excludednamelist:
_LOG.info(f"adding {modulename} to excluded modules")
excludednamelist.append(modulename)
sitecustomize.__umr__ = sitecustomize.UserModuleReloader( # pyright: ignore[reportUnboundVariable]
sitecustomize.__umr__ = sitecustomize.UserModuleReloader( # pyright: ignore[reportPossiblyUnboundVariable]
namelist=excludednamelist
)
os.environ["SPY_UMR_NAMELIST"] = ",".join(excludednamelist)

0 comments on commit 4f17970

Please sign in to comment.