@@ -89,11 +89,11 @@ def __init__(
8989 self ._res = res
9090 self ._sets = {} if sets is None else sets # Name: Set(Function())
9191
92- def __call__ (self , x : float ) -> dict [str , float ]:
92+ def __call__ (self , x : float ) -> dict [Set , float ]:
9393 """Pass a value to all sets of the domain and return a dict with results."""
9494 if not (self ._low <= x <= self ._high ):
9595 raise FuzzyWarning (f"{ x } is outside of domain!" )
96- return {name : s .func (x ) for name , s in self ._sets .items ()}
96+ return {self . _sets [ name ] : s .func (x ) for name , s in self ._sets .items ()}
9797
9898 def __len__ (self ) -> int :
9999 """Return the size of the domain, as the actual number of possible values, calculated internally."""
@@ -423,19 +423,18 @@ def __repr__(self) -> str:
423423 """
424424
425425 # experimental
426- # x = f"{self.func.__qualname__.split('.')[0]}({self.func.__closure__[0].
427- # cell_contents.__code__.co_nlocals}))"
426+ # x = f"{self.func.__qualname__.split('.')[0]}({self.func.__closure__[0].cell_contents.__code__.co_nlocals}))" # noqa: E501
428427 # print(x)
429428
430429 if self .domain is not None :
431430 return f"{ self .domain ._name } .{ self .name } " # type: ignore
432- return f"Set({ __name__ } ({ self .func .__qualname__ } )"
431+ return f"Set(({ self .func .__qualname__ } )"
433432
434433 def __str__ (self ) -> str :
435434 """Return a string for print()."""
436435 if self .domain is not None :
437436 return f"{ self .domain ._name } .{ self .name } " # type: ignore
438- return f"dangling Set({ self .func .__name__ } "
437+ return f"Set({ self .func .__name__ } ) "
439438
440439 def normalized (self ) -> Set :
441440 """Return a set that is normalized *for this domain* with 1 as max."""
0 commit comments