While fumbling around, I stumbled upon a cycle. Now I know the codebase says "maybe remove this check because it is not possible", but it is:
@xs.process
class CycleStepOne:
a = xs.variable(intent="out",global_name = "a")
group = xs.group("b")
def initialize(self):
a = 5
def run_step(self):
self.a = np.sum(b for b in self.group)
@xs.process
class CycleStepTwo:
a = xs.global_ref("a")
b = xs.variable(intent="out",groups="b")
def initialize(self):
self.b = self.a
def run_step(self):
self.a = self.b
cyclic_model = xs.Model({
"one":CycleStepOne,
"two":CycleStepTwo
})
raises
RuntimeError: Cycle detected in process graph: one->two->one
I also have a model, that sort of needs this structure.:
Is there a way to refactor this (to allow for different ways of calculating leaf area, while not rewriting the entire model)?
Or is this now the smallest possible process, because of the biomass->leaf_aera->intercepted_light->biomass dependency?
While fumbling around, I stumbled upon a cycle. Now I know the codebase says "maybe remove this check because it is not possible", but it is:
raises
I also have a model, that sort of needs this structure.:
Is there a way to refactor this (to allow for different ways of calculating leaf area, while not rewriting the entire model)? Or is this now the smallest possible process, because of the
biomass->leaf_aera->intercepted_light->biomass
dependency?