Skip to content

Commit

Permalink
Name changes from feedback Ruben v3
Browse files Browse the repository at this point in the history
  • Loading branch information
sidekock committed Oct 22, 2024
1 parent e105a24 commit b6c47af
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pysteps/nowcasts/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(self, precip, velocity, timesteps, **kwargs):
self.phi = None
self.perturbation_generator = None
self.noise_std_coeffs = None
self.randgen_prec = None
self.randgen_motion = None
self.random_generator_precip = None
self.random_generator_motion = None
self.velocity_perturbations = None
self.precip_forecast = None
self.mask_precip = None
Expand Down Expand Up @@ -541,22 +541,22 @@ def _apply_noise_and_ar_model(self):

# Initialize random generators if noise_method is provided
if self.noise_method is not None:
self.randgen_prec = []
self.randgen_motion = []
self.random_generator_precip = []
self.random_generator_motion = []

for _ in range(self.n_ens_members):
# Create random state for precipitation noise generator
rs = np.random.RandomState(self.seed)
self.randgen_prec.append(rs)
self.random_generator_precip.append(rs)
self.seed = rs.randint(0, high=int(1e9)) # Update seed after generating

# Create random state for motion perturbations generator
rs = np.random.RandomState(self.seed)
self.randgen_motion.append(rs)
self.random_generator_motion.append(rs)
self.seed = rs.randint(0, high=int(1e9)) # Update seed after generating
else:
self.randgen_prec = None
self.randgen_motion = None
self.random_generator_precip = None
self.random_generator_motion = None

Check warning on line 559 in pysteps/nowcasts/steps.py

View check run for this annotation

Codecov / codecov/patch

pysteps/nowcasts/steps.py#L558-L559

Added lines #L558 - L559 were not covered by tests
print("AR model and noise applied to precipitation cascades.")

def _initialize_velocity_perturbations(self):
Expand All @@ -572,7 +572,7 @@ def _initialize_velocity_perturbations(self):
self.velocity_perturbations = []
for j in range(self.n_ens_members):
kwargs = {
"randstate": self.randgen_motion[j],
"randstate": self.random_generator_motion[j],
"p_par": self.velocity_perturbation_kwargs.get(
"p_par", self.velocity_perturbation_parallel
),
Expand Down Expand Up @@ -669,7 +669,7 @@ def _initialize_state(self):
"precip_decomp": self.precip_decomposed,
"precip_m": self.precip_mask,
"precip_m_d": self.precip_mask_decomposed,
"randgen_prec": self.randgen_prec,
"randgen_prec": self.random_generator_precip,
}

def _initialize_params(self, precip):
Expand Down

0 comments on commit b6c47af

Please sign in to comment.