mimiframework / Mimi.jl

Integrated Assessment Modeling Framework
https://www.mimiframework.org
Other
66 stars 34 forks source link

Timestep Arrays View #963

Closed lrennels closed 1 year ago

lrennels commented 1 year ago

This PR adds two methods to call view on TimestepArray types, only two for now at the most general level. They should work for all instances, though I have not yet implemented matching view methods for all of the possible permutations of arguments, like for TimestepVector and TimestepArray, which may improve performance.

I do note that used with too many dimensions and : this view method can be type unstable, but getindex with the same arguments and indices is also type unstable. This is something I'd like to work on tackling in a next PR but I don't think this exacerbates the issue, it just sometimes adds a tradeoff between memory allocation and type stability which is admittedly not ideal.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.30 :warning:

Comparison is base (91a71f1) 85.12% compared to head (29296bf) 84.83%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #963 +/- ## ========================================== - Coverage 85.12% 84.83% -0.30% ========================================== Files 40 40 Lines 4041 4055 +14 ========================================== Hits 3440 3440 - Misses 601 615 +14 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `84.83% <0.00%> (-0.30%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/mimiframework/Mimi.jl/pull/963?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework) | Coverage Δ | | |---|---|---| | [src/core/time\_arrays.jl](https://app.codecov.io/gh/mimiframework/Mimi.jl/pull/963?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mimiframework#diff-c3JjL2NvcmUvdGltZV9hcnJheXMuamw=) | `88.10% <0.00%> (-3.64%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.