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 20 forks source link

Fix bug in code generator #224

Closed daniel-thom closed 3 years ago

daniel-thom commented 3 years ago

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

The code generated duplicate methods if a struct had defaults for all values. I tested the fix on PowerSystems.

codecov[bot] commented 3 years ago

Codecov Report

Merging #224 (d7f61bb) into master (51fdbd0) will decrease coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
- Coverage   75.00%   74.97%   -0.03%     
==========================================
  Files          43       43              
  Lines        3052     3053       +1     
==========================================
  Hits         2289     2289              
- Misses        763      764       +1     
Flag Coverage Δ
unittests 74.97% <100.00%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/utils/generate_structs.jl 84.40% <100.00%> (+0.29%) :arrow_up:
src/utils/utils.jl 60.33% <0.00%> (-0.43%) :arrow_down:
src/utils/lazy_dict_from_iterator.jl 96.15% <0.00%> (-0.15%) :arrow_down:
daniel-thom commented 3 years ago

The cross-package testing failed because IS did not generate the duplicate method. Expected failure.