Skip to content

Commit 6da480d

Browse files
build(deps): bump mypy from 1.11.0 to 1.15.0 in /requirements (#20759)
* build(deps): bump mypy from 1.11.0 to 1.15.0 in /requirements Bumps [mypy](https://github.com/python/mypy) from 1.11.0 to 1.15.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.11...v1.15.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fixing * ignore --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jirka B <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
1 parent 749dc90 commit 6da480d

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

requirements/typing.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy==1.11.0
1+
mypy==1.15.0
22
torch==2.7.0
33

44
types-Markdown

src/lightning/fabric/fabric.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,7 @@ def setup_dataloaders(
367367
)
368368
for dataloader in dataloaders
369369
]
370-
dataloaders = dataloaders[0] if len(dataloaders) == 1 else dataloaders
371-
return dataloaders # type: ignore[return-value]
370+
return dataloaders[0] if len(dataloaders) == 1 else dataloaders
372371

373372
def _setup_dataloader(
374373
self, dataloader: DataLoader, use_distributed_sampler: bool = True, move_to_device: bool = True

src/lightning/pytorch/callbacks/lr_monitor.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ def _remap_keys(self, names: list[list[str]], token: str = "/pg1") -> None:
251251
elif new_name not in self.lrs:
252252
self.lrs[new_name] = []
253253

254-
def _extract_momentum(self, param_group: dict[str, list], name: str, use_betas: bool) -> dict[str, float]:
254+
def _extract_momentum(self, param_group: dict[str, list[float]], name: str, use_betas: bool) -> dict[str, float]:
255255
if not self.log_momentum:
256256
return {}
257257

258258
momentum = param_group["betas"][0] if use_betas else param_group.get("momentum", 0)
259-
self.last_momentum_values[name] = momentum
260-
return {name: momentum}
259+
self.last_momentum_values[name] = momentum # type: ignore[assignment]
260+
return {name: momentum} # type: ignore[dict-item]
261261

262262
def _extract_weight_decay(self, param_group: dict[str, Any], name: str) -> dict[str, Any]:
263263
"""Extracts the weight decay statistics from a parameter group."""

src/lightning/pytorch/core/saving.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def _load_state(
184184
obj.on_load_checkpoint(checkpoint)
185185

186186
# load the state_dict on the model automatically
187-
keys = obj.load_state_dict(checkpoint["state_dict"], strict=strict)
187+
keys = obj.load_state_dict(checkpoint["state_dict"], strict=strict) # type: ignore[arg-type]
188188

189189
if not strict:
190190
if keys.missing_keys:

src/lightning/pytorch/trainer/connectors/logger_connector/result.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _generate_sync_fn(self) -> None:
9292
fn = self.no_op if self.fn is None or not self.should or self.rank_zero_only else self.fn
9393
# save the function as `_fn` as the meta are being re-created and the object references need to match.
9494
# ignore typing, bad support for `partial`: mypy/issues/1484
95-
self._fn: Callable = partial(fn, reduce_op=self.op, group=self.group) # type: ignore[arg-type,operator,misc]
95+
self._fn: Callable = partial(fn, reduce_op=self.op, group=self.group) # type: ignore[unused-ignore]
9696

9797
@property
9898
def __call__(self) -> Any:

0 commit comments

Comments
 (0)