bankofcanada / ModelBaseEcon.jl

BSD 3-Clause "New" or "Revised" License
26 stars 5 forks source link

Fix issues with equation parentheses #72

Closed Nic2020 closed 2 months ago

Nic2020 commented 2 months ago

We had a parsing error when the entire equation was wrapped inside parentheses. ModelBaseEcon.jl was not recognizing it as an expression. We covered all four cases: with and without tags, with and without @lin.

For instance, the model below shows all 4 cases that failed before:

module A
    using ModelBaseEcon
    const model = Model()
    @variables model x
    @equations model begin
        :EQ_x1 => (x[t] = 0)
        (x[t] = 0)
        :EQ_x1 => (@lin x[t] = 0)
        (@lin x[t] = 0)
    end
    @initialize(model)
end
codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.56%. Comparing base (aab0a16) to head (e073151).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #72 +/- ## ========================================== - Coverage 95.57% 95.56% -0.01% ========================================== Files 14 14 Lines 2192 2189 -3 ========================================== - Hits 2095 2092 -3 Misses 97 97 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.