Skip to content

Commit 00a5309

Browse files
committed
Fix: entropy was not based on variable
1 parent 49ab8a7 commit 00a5309

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

kaleidoscope/operators/randomizeop.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def run(self, source: Dataset) -> Dataset: # noqa: D102
104104
np.single,
105105
x.ndim,
106106
dist=a["distribution"],
107-
entropy=self.entropy,
107+
entropy=self.entropy(v),
108108
)
109109
if "uncertainty" in a:
110110
u = (
@@ -174,7 +174,15 @@ def config(self) -> dict[str : dict[str:Any]]:
174174
config = json.load(r)
175175
return config
176176

177-
@property
178-
def entropy(self) -> list[int]:
179-
"""Returns the entropy of the seed sequence."""
180-
return [self._args.selector, _hash(self._args.source_file.stem)]
177+
def entropy(self, v: str) -> list[int]:
178+
"""
179+
Returns the entropy of the seed sequence used for a given variable.
180+
181+
:param v: The name of the variable.
182+
:return: The entropy.
183+
"""
184+
return [
185+
self._args.selector,
186+
_hash(v),
187+
_hash(self._args.source_file.stem),
188+
]

0 commit comments

Comments
 (0)