Skip to content

Commit

Permalink
💬 Update type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Apr 23, 2024
1 parent 47e7c12 commit c44ed88
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/arpes/analysis/band_analysis.py
Original file line number Diff line number Diff line change
@@ -205,10 +205,7 @@ def dataarray_for_value(param_name: str, i: int = i, *, is_value: bool) -> xr.Da
while not it.finished:
prefix = identified_band_results.values[it.multi_index][i]
param = band_results.values[it.multi_index].params[prefix + param_name]
if is_value:
it[0] = param.value
else:
it[0] = param.stderr
it[0] = param.value if is_value else param.stderr
it.iternext()

return xr.DataArray(
8 changes: 5 additions & 3 deletions src/arpes/utilities/jupyter.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger
from os import SEEK_END
from pathlib import Path
from typing import TYPE_CHECKING, TypedDict
from typing import TYPE_CHECKING, TypedDict, TypeVar

from tqdm.notebook import tqdm
from traitlets.config import MultipleInstanceError
@@ -40,13 +40,15 @@
logger.addHandler(handler)
logger.propagate = False

T = TypeVar("T")


def wrap_tqdm(
x: Iterable[int],
x: Iterable[T],
*args: Incomplete,
interactive: bool = True,
**kwargs: Incomplete,
) -> Iterable[int]:
) -> Iterable[T]:
"""Wraps with tqdm but supports disabling with a flag."""
if not interactive:
return x

0 comments on commit c44ed88

Please sign in to comment.