Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Jul 6, 2023
1 parent 2105991 commit c943a8f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions popmon/analysis/hist_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import annotations

import warnings
from typing import List

import histogrammar
import numpy as np
Expand Down Expand Up @@ -187,7 +187,7 @@ def get_consistent_numpy_ndgrids(
)
assert_similar_hists(hist_list)

keys: List[set] = [set() for _ in range(dim)]
keys: list[set] = [set() for _ in range(dim)]
for hist in hist_list:
hist_keys = prepare_ndgrid(hist, n_dim=dim)
for i, h_keys in enumerate(hist_keys):
Expand Down
12 changes: 6 additions & 6 deletions popmon/base/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
from __future__ import annotations

from collections import defaultdict
from typing import Any, Callable, DefaultDict, Dict, List, Optional, Tuple, Union
from typing import Any, Callable


class Registry:
_properties = ("dim", "htype")

def __init__(self) -> None:
self._keys: List[str] = []
self._descriptions: Dict[str, str] = {}
self._properties_to_func: DefaultDict[
str, DefaultDict[str, Dict[Any, Any]]
self._keys: list[str] = []
self._descriptions: dict[str, str] = {}
self._properties_to_func: defaultdict[
str, defaultdict[str, dict[Any, Any]]
] = defaultdict(lambda: defaultdict(dict))
self._func_name_to_properties: Dict[Any, Any] = {}
self._func_name_to_properties: dict[Any, Any] = {}

def register(
self,
Expand Down
Empty file removed popmon/extensions/utils.py
Empty file.
3 changes: 1 addition & 2 deletions popmon/pipeline/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from __future__ import annotations

import logging
from typing import Optional

from histogrammar.dfinterface.make_histograms import get_bin_specs, make_histograms

Expand Down Expand Up @@ -75,7 +74,7 @@ def stability_metrics(

def df_stability_metrics(
df,
settings: Optional[Settings] = None,
settings: Settings | None = None,
time_width=None,
time_offset: int = 0,
var_dtype=None,
Expand Down
4 changes: 2 additions & 2 deletions popmon/pipeline/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def stability_report(

def df_stability_report(
df,
settings: Optional[Settings] = None,
settings: Settings | None | None = None,
time_width=None,
time_offset: int = 0,
var_dtype=None,
Expand Down Expand Up @@ -280,7 +280,7 @@ def regenerate(
self,
store_key: str = "html_report",
sections_key: str = "report_sections",
settings: Optional[Settings] = None,
settings: Settings | None = None,
):
"""Regenerate HTML report with different plot settings
:param str sections_key: key to store sections data in the datastore. default is 'report_sections'.
Expand Down
5 changes: 2 additions & 3 deletions popmon/visualization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import math
import warnings
from collections import defaultdict
from typing import DefaultDict, Dict, List, Union

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -325,7 +324,7 @@ def plot_bars(


def plot_traffic_lights_overview(feature, data, metrics: list[str], labels: list[str]):
colors: DefaultDict[str, Dict[str, List[str]]] = defaultdict(dict)
colors: defaultdict[str, dict[str, list[str]]] = defaultdict(dict)
color_map = ["g", "y", "r"]
for c1, metric in enumerate(metrics):
for c2, label in enumerate(labels):
Expand Down Expand Up @@ -366,7 +365,7 @@ def plot_traffic_lights_alerts_aggregate(
yellow = hex_to_rgb(tl_colors["yellow"])
red = hex_to_rgb(tl_colors["red"])

colors: DefaultDict[str, Dict[str, List[str]]] = defaultdict(dict)
colors: defaultdict[str, dict[str, list[str]]] = defaultdict(dict)
for c1, metric in enumerate(metrics):
row_max = np.max(data[c1])
for c2, label in enumerate(labels):
Expand Down

0 comments on commit c943a8f

Please sign in to comment.