Skip to content

Commit

Permalink
Merge branch 'daredevil' of github.com:arafune/arpes into daredevil
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Mar 19, 2024
2 parents 3cb3c71 + e8159fc commit 2dbaa86
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ lint.ignore = [
"G004", # logging-f-string
#
"NPY201", # Numpy 2.0,
"ISC001", # single-line-implicit-string-concatenation
]
lint.select = ["ALL"]
target-version = "py311"
Expand Down
13 changes: 13 additions & 0 deletions src/arpes/analysis/band_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import functools
import itertools
from itertools import pairwise
from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger
from typing import TYPE_CHECKING, Any, Literal

import numpy as np
Expand Down Expand Up @@ -36,6 +37,18 @@
"fit_for_effective_mass",
)

LOGLEVELS = (DEBUG, INFO)
LOGLEVEL = LOGLEVELS[1]
logger = getLogger(__name__)
fmt = "%(asctime)s %(levelname)s %(name)s :%(message)s"
formatter = Formatter(fmt)
handler = StreamHandler()
handler.setLevel(LOGLEVEL)
logger.setLevel(LOGLEVEL)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.propagate = False


def fit_for_effective_mass(
data: xr.DataArray,
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/plotting/fit_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def configure_image_widgets(self) -> None:
layout=self.content_layout,
)

def generate_fit_marginal_for(
def generate_fit_marginal_for( # noqa: PLR0913
self,
dimensions: tuple[int, ...],
column_row: tuple[int, int],
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/plotting/qt_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def set_data(self, data: xr.DataArray) -> None:
def _qt_tool(data: XrTypes, **kwargs: Incomplete) -> None:
"""Starts the qt_tool using an input spectrum."""
with contextlib.suppress(TypeError):
data = dill.loads(data)
data = dill.loads(data) # noqa: S301

tool = QtTool()
tool.set_data(data)
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/plotting/stack_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@


@save_plot_provenance
def offset_scatter_plot(
def offset_scatter_plot( # noqa: PLR0913
data: xr.Dataset,
name_to_plot: str = "",
stack_axis: str = "",
Expand Down Expand Up @@ -133,7 +133,7 @@ def offset_scatter_plot(
skip_colorbar = True
if cbarmap is None:
skip_colorbar = False
cbar: colorbar.Colorbar | Callable[..., colorbar.Colorbar]
cbar: Callable[..., colorbar.Colorbar]
cmap: Callable[..., ColorType] | Callable[..., Callable[..., ColorType]]
try:
cbar, cmap = colorbarmaps_for_axis[stack_axis]
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/utilities/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(self, *args: QWidget | None) -> None:
self.toggled.connect(lambda: self.subject.on_next(self.isChecked()))
self.subject.subscribe(self.update_ui)

def update_ui(self, value: bool) -> None:
def update_ui(self, *, value: bool) -> None:
"""Forwards value change to the UI."""
self.setChecked(value)

Expand Down

0 comments on commit 2dbaa86

Please sign in to comment.