NREL-Sienna / InfrastructureSystems.jl

Utility package for Sienna's simulation infrastructure
https://nrel-sienna.github.io/InfrastructureSystems.jl/
BSD 3-Clause "New" or "Revised" License
35 stars 20 forks source link

Add `FunctionData` Printing #377

Closed GabrielKS closed 3 weeks ago

GabrielKS commented 3 weeks ago

I implemented some more human-friendly printing of the various FunctionData:

Screenshot 2024-06-11 at 4 04 51 PM

These could be useful when I do the same thing for the PSY cost structs (https://github.com/NREL-Sienna/PowerSystems.jl/issues/1048).

Also fixed a typo in existing printing test code.

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 77.53%. Comparing base (7fe2da2) to head (5c19680).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377/graphs/tree.svg?width=650&height=150&src=pr&token=I73yjxYxgn&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna)](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna) ```diff @@ Coverage Diff @@ ## main #377 +/- ## ========================================== + Coverage 77.16% 77.53% +0.36% ========================================== Files 66 66 Lines 5072 5092 +20 ========================================== + Hits 3914 3948 +34 + Misses 1158 1144 -14 ``` | [Flag](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna) | `77.53% <100.00%> (+0.36%)` | :arrow_up: | 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=NREL-Sienna#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna) | Coverage Δ | | |---|---|---| | [src/function\_data.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377?src=pr&el=tree&filepath=src%2Ffunction_data.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL2Z1bmN0aW9uX2RhdGEuamw=) | `99.40% <100.00%> (+0.08%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/377/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna)
GabrielKS commented 3 weeks ago

Above formats are unchanged, added a third format that is human-readable but less verbose, for use where FunctionData are nested within other types that will convey that information (see e.g. https://github.com/NREL-Sienna/PowerSystems.jl/pull/1125):

Screenshot 2024-06-12 at 2 24 53 PM
GabrielKS commented 3 weeks ago

Re-requesting review for this ^ compact addition