Skip to content

Commit

Permalink
get rid of protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
wd60622 committed Jul 3, 2024
1 parent b9bcf92 commit e30f6d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pymc/model_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from dataclasses import dataclass
from enum import Enum
from os import path
from typing import Any, Protocol, cast
from typing import Any, cast

from pytensor import function
from pytensor.graph import Apply
Expand Down Expand Up @@ -215,8 +215,7 @@ def update_node_formatters(node_formatters: NodeTypeFormatterMapping) -> NodeTyp
return node_formatters


class AddNode(Protocol):
def __call__(self, arg1: str, **kwargs: Any) -> None: ...
AddNode = Callable[[str, GraphvizNodeKwargs], None]


def _make_node(
Expand All @@ -235,7 +234,7 @@ def _make_node(
kwargs["cluster"] = cluster

Check warning on line 234 in pymc/model_graph.py

View check run for this annotation

Codecov / codecov/patch

pymc/model_graph.py#L234

Added line #L234 was not covered by tests

var_name: str = cast(str, node.var.name)
add_node(var_name.replace(":", "&"), **kwargs)
add_node(var_name.replace(":", "&"), **kwargs) # type: ignore


class ModelGraph:
Expand Down

0 comments on commit e30f6d9

Please sign in to comment.