Skip to content

Commit

Permalink
Initial groundwork for calling a model within a model
Browse files Browse the repository at this point in the history
  • Loading branch information
jzuhone committed Sep 5, 2022
1 parent 063a764 commit 8290f07
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions xija/component/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,24 @@ def plot_resid__data(self, fig, ax):
lines[0].set_ydata(resids)


class ModeledData(ModelComponent):
def __init__(self, model, name, modeled_msid, model_spec):
from xija.model import XijaModel
super().__init__(model)
self.modeled_msid = modeled_msid
self.model2 = XijaModel(name, start=self.model.datestart,
stop=self.model.datestop,
model_spec=model_spec)
self.model2.make()
self.model2.calc()

def get_dvals_tlm(self):
return self.model2.comp[self.modeled_msid].mvals

def __str__(self):
return self.modeled_msid


class Coupling(ModelComponent):
"""\
First-order coupling between Nodes `node1` and `node2`
Expand Down

0 comments on commit 8290f07

Please sign in to comment.