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
39 stars 21 forks source link

Log warning instead throwing an exception to handle PowerSystems upgrade from 1.x to 2.x #308

Closed daniel-thom closed 1 year ago

daniel-thom commented 1 year ago

The code was throwing an exception if a struct field was not present in a validation descriptor. This failed if a PowerSystems 1.x system was deserialized with 2.x code because some structs have new fields that were not part of the validation descriptor.

Fixes https://github.com/NREL-SIIP/PowerSystems.jl/issues/974

We did validate that the patch fixes the original issue.

codecov[bot] commented 1 year ago

Codecov Report

Merging #308 (f0306a3) into master (7853431) will increase coverage by 0.21%. The diff coverage is 0.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/NREL-SIIP/InfrastructureSystems.jl/pull/308/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-SIIP)](https://codecov.io/gh/NREL-SIIP/InfrastructureSystems.jl/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-SIIP) ```diff @@ Coverage Diff @@ ## master #308 +/- ## ========================================== + Coverage 78.03% 78.24% +0.21% ========================================== Files 44 44 Lines 3719 3705 -14 ========================================== - Hits 2902 2899 -3 + Misses 817 806 -11 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `78.24% <0.00%> (+0.21%)` | :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-SIIP#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/NREL-SIIP/InfrastructureSystems.jl/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-SIIP) | Coverage Δ | | |---|---|---| | [src/validation.jl](https://codecov.io/gh/NREL-SIIP/InfrastructureSystems.jl/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-SIIP#diff-c3JjL3ZhbGlkYXRpb24uamw=) | `12.38% <0.00%> (-0.12%)` | :arrow_down: | ... and [4 files with indirect coverage changes](https://codecov.io/gh/NREL-SIIP/InfrastructureSystems.jl/pull/308/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL-SIIP)