Merge pull request #1413 from rockfool/deplete_si

fix a typo bug in SIIntegrator class
This commit is contained in:
Andrew Johnson 2019-11-19 16:16:09 -05:00 committed by GitHub
commit 50a271bfda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -815,11 +815,11 @@ class SIIntegrator(Integrator):
reset_particles = False
if step_index == 0 and hasattr(self.operator, "settings"):
reset_particles = True
self.operator.settings.particles *= self.n_stages
self.operator.settings.particles *= self.n_steps
inherited = super()._get_bos_data_from_operator(
step_index, step_power, bos_conc)
if reset_particles:
self.operator.settings.particles //= self.n_stages
self.operator.settings.particles //= self.n_steps
return inherited
def integrate(self):

View file

@ -1,4 +1,5 @@
from collections import namedtuple
from unittest.mock import Mock
import numpy as np
import scipy.sparse as sp
@ -133,6 +134,8 @@ class DummyOperator(TransportOperator):
self.prev_res = previous_results
self.chain = TestChain()
self.output_dir = "."
self.settings = Mock()
self.settings.particles = 10
def __call__(self, vec, power, print_out=False):
"""Evaluates F(y)