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

Second Cost Refactor: Companion PR (+add serialization for `@scoped_enum`, add `NotImplementedError`) #344

Closed GabrielKS closed 2 months ago

GabrielKS commented 3 months ago

Draft for now, this is the companion to https://github.com/NREL-Sienna/PowerSystems.jl/pull/1071.

GabrielKS commented 3 months ago

@daniel-thom thoughts on automatic @scoped_enum serialization support along these lines?

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 96.29630% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 75.52%. Comparing base (e87f7b8) to head (4d72144).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344/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/344?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 #344 +/- ## ========================================== - Coverage 75.61% 75.52% -0.09% ========================================== Files 68 68 Lines 4876 4834 -42 ========================================== - Hits 3687 3651 -36 + Misses 1189 1183 -6 ``` | [Flag](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344/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/344/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna) | `75.52% <96.29%> (-0.09%)` | :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=NREL-Sienna#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?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/344?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=) | `98.92% <100.00%> (+0.01%)` | :arrow_up: | | [src/hdf5\_time\_series\_storage.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?src=pr&el=tree&filepath=src%2Fhdf5_time_series_storage.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL2hkZjVfdGltZV9zZXJpZXNfc3RvcmFnZS5qbA==) | `96.70% <100.00%> (+0.38%)` | :arrow_up: | | [src/in\_memory\_time\_series\_storage.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?src=pr&el=tree&filepath=src%2Fin_memory_time_series_storage.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL2luX21lbW9yeV90aW1lX3Nlcmllc19zdG9yYWdlLmps) | `70.00% <100.00%> (+0.33%)` | :arrow_up: | | [src/utils/utils.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?src=pr&el=tree&filepath=src%2Futils%2Futils.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL3V0aWxzL3V0aWxzLmps) | `58.80% <100.00%> (+1.86%)` | :arrow_up: | | [src/deterministic.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?src=pr&el=tree&filepath=src%2Fdeterministic.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL2RldGVybWluaXN0aWMuamw=) | `67.64% <66.66%> (-1.48%)` | :arrow_down: | | [src/common.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?src=pr&el=tree&filepath=src%2Fcommon.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL2NvbW1vbi5qbA==) | `50.00% <0.00%> (-50.00%)` | :arrow_down: | | [src/internal.jl](https://app.codecov.io/gh/NREL-Sienna/InfrastructureSystems.jl/pull/344?src=pr&el=tree&filepath=src%2Finternal.jl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-Sienna#diff-c3JjL2ludGVybmFsLmps) | `83.63% <0.00%> (+2.93%)` | :arrow_up: |
daniel-thom commented 3 months ago

@daniel-thom thoughts on automatic @scoped_enum serialization support along these lines?

NIce. We can remove some similar code from PSY.

GabrielKS commented 2 months ago

Is this PR still in draft or is it ready for review?

I think it's ready for review, assuming we don't end up needing to make any more changes here related to the market bid cost.

jd-lara commented 2 months ago

@GabrielKS please merge as soon as a tracking issue with the remaining TODO's is open please. Same for https://github.com/NREL-Sienna/PowerSystems.jl/pull/1071.

GabrielKS commented 2 months ago

Tracking issue is https://github.com/NREL-Sienna/InfrastructureSystems.jl/issues/352, I'll merge this as soon as I've verified tests pass.