Skip to content

Commit

Permalink
just comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mamueller committed Aug 1, 2021
1 parent 3b288e1 commit 1dd4209
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/CompartmentalSystems/smooth_model_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3921,7 +3921,10 @@ def _density_plot_plotly(self, field, ages, age_stride=1, time_stride=1):

## plot helper methods ##

#fixme: unit treatment disabled
# fixme: unit treatment disabled
# fixme mm 7-28-2021 units do not have a place in SmothModelRun since
# we do not have them for all the instances. If units are required they should life in a different class

def _add_time_unit(self, label):
#if self.model.time_unit:
# label += r"$\quad(\mathrm{" + latex(self.model.time_unit) + "})$"
Expand Down
27 changes: 14 additions & 13 deletions tests/Test_DiscreteReservoirModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"""
Disclaimer:
not a real test yet, no real assertions just an end to end
example probably full of bugs
example probably full of bugs
the parts have to be tested to trust the result
"""


class TimeStep:
"""
Just a collection of values per time step which are necessarry
to compute the next one.
Just a collection of values per time step which are necessarry
to compute the next one.
"""
def __init__(
self,
Expand Down Expand Up @@ -56,12 +57,12 @@ def __next__(self):
if self.i == self.number_of_steps:
raise StopIteration
ts = copy(self.ts)
# fixme mm 7-20-2021
# fixme mm 7-20-2021
# possibly B and u one index lower than x ...
B =ts.B
u =ts.u
u =ts.u
x =ts.x

it = self.i
B_func = self.B_func
u_func = self.u_func
Expand All @@ -76,7 +77,7 @@ def __next__(self):

class TestDiscreteReservoirModel(InDirTest):
def test_iterator(self):
B_0=np.array([
B_0=np.array([
[ -1, 0.5],
[0.5, -1]
])
Expand All @@ -95,9 +96,9 @@ def test_iterator(self):
steps=[ts for ts in tsit]
#print(steps)
# we could also choose to remember only the xs
xs = [ts.x for ts in tsit]
xs = [ts.x for ts in tsit]
print(xs)




Expand Down Expand Up @@ -164,8 +165,8 @@ def test_symbolic(self):
print('u')
print(u)
#rhs = u(it,x)+B(it,x)*x
# num_rhs

# num_rhs
par_dict = {
k_leaf_out: 1,
k_wood_out: 1,
Expand All @@ -185,7 +186,7 @@ def my_func(ind):
func_dict = {
I_leaf(it): my_func
}
num_B, num_u = map(
num_B, num_u = map(
lambda expr: hr.numerical_array_func(
state_variable_tuple,
it,
Expand All @@ -211,5 +212,5 @@ def my_func(ind):
#steps=[ts for ts in tsit]
#print(steps)
# we could also choose to remember only the xs
xs = [ts.x for ts in tsit]
xs = [ts.x for ts in tsit]
print(xs)

0 comments on commit 1dd4209

Please sign in to comment.