Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed Feb 22, 2022
1 parent 4ffd1fd commit 219c695
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.6.11

- optimize saving_generator in julia export
- Implement `include ... type table`
- Implement export to CSV and other tabular formats

Expand Down
12 changes: 10 additions & 2 deletions cases/0-hello-world/master/mm_julia/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ end

### output function
function mm_saving_generator_(outputIds::Vector{Symbol})
# XXX: currently force amounts: s1_, s2_ are not supported
__actual_indexes__ = indexin(outputIds, [:default_comp,:S,:P,:r1,])
# check nothing in actual_indexes
wrongIndexes = findall(x -> x===nothing, __actual_indexes__)
if length(wrongIndexes) > 0
wrongIds = outputIds[wrongIndexes]
throw("Wrong identifiers: $(wrongIds)")
end

function saving_(u, t, integrator)
cons = integrator.p.constants
(default_comp,) = integrator.p.static
Expand All @@ -82,8 +91,7 @@ function mm_saving_generator_(outputIds::Vector{Symbol})

# force amount

d = Base.@locals
return [d[id] for id in outputIds]
return [default_comp,S,P,r1,][__actual_indexes__]
end
end

Expand Down

0 comments on commit 219c695

Please sign in to comment.