Skip to content

Commit

Permalink
Fix issue with missing constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron committed Mar 20, 2024
1 parent 13fbd77 commit fb89057
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions exponax/ic/_scaled.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@ def __call__(self, x: Float[Array, "D ... N"]) -> Float[Array, "1 ... N"]:


class ScaledICGenerator(BaseRandomICGenerator):
"""
Works best in combination with initial conditions that have `max_one=True`
or `std_one=True`.
"""

ic_gen: BaseRandomICGenerator
scale: float

def __init__(self, ic_gen: BaseRandomICGenerator, scale: float):
"""
A scaled initial condition generator.
Works best in combination with initial conditions that have
`max_one=True` or `std_one=True`.
**Arguments**:
- `ic_gen`: The initial condition generator.
- `scale`: The scaling factor.
"""
self.ic_gen = ic_gen
self.scale = scale

def gen_ic_fun(self, *, key: PRNGKeyArray) -> BaseIC:
return ScaledIC(self.ic_gen.gen_ic_fun(key=key), scale=self.scale)

Expand Down

0 comments on commit fb89057

Please sign in to comment.