Skip to content

Commit 311dbd4

Browse files
thomaspinderThomas Pinder
andauthored
Change noise field to default_factory (#26)
Co-authored-by: Thomas Pinder <[email protected]>
1 parent 8cfdcfa commit 311dbd4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
matrix:
1414
# Select the Python versions to test against
1515
os: ["ubuntu-latest", "macos-latest"]
16-
python-version: ["3.10", "3.11"]
16+
python-version: ["3.10", "3.11", "3.12"]
1717
fail-fast: true
1818
steps:
1919
- name: Check out the code

src/causal_validation/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "0.0.8"
1+
__version__ = "0.0.9"
22

33
__all__ = ["__version__"]

src/causal_validation/transforms/noise.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from dataclasses import dataclass
1+
from dataclasses import dataclass, field
22
from typing import Tuple
33

44
from jaxtyping import Float
@@ -18,7 +18,9 @@ class Noise(AdditiveTransform):
1818
Normal with 0 loc and 0.1 scale.
1919
"""
2020

21-
noise_dist: TimeVaryingParameter = TimeVaryingParameter(sampling_dist=norm(0, 0.1))
21+
noise_dist: TimeVaryingParameter = field(
22+
default_factory=lambda: TimeVaryingParameter(sampling_dist=norm(0, 0.1))
23+
)
2224
_slots: Tuple[str] = ("noise_dist",)
2325

2426
def get_values(self, data: Dataset) -> Float[np.ndarray, "N D"]:

0 commit comments

Comments
 (0)