Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug 407 #408

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Fix bug 407 #408

merged 2 commits into from
Oct 29, 2024

Conversation

GabrielKS
Copy link
Contributor

See bug #407 for a detailed description of the issue. This implements the proposed fix from that bug report, i.e., adds a special case for AbstractArray. I couldn't resist a bit more cleanup of now-redundant code as well.

@GabrielKS GabrielKS changed the title Fix https://github.com/NREL-Sienna/InfrastructureSystems.jl/issues/407 Fix bug 407 Oct 28, 2024
@GabrielKS GabrielKS linked an issue Oct 28, 2024 that may be closed by this pull request
@GabrielKS GabrielKS self-assigned this Oct 28, 2024
@jd-lara jd-lara self-requested a review October 28, 2024 23:41
@GabrielKS GabrielKS requested a review from daniel-thom October 28, 2024 23:41
Copy link
Member

@jd-lara jd-lara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense. Now array objects have ref and size as fields.

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.65%. Comparing base (627c8dd) to head (83da575).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/utils.jl 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
+ Coverage   77.63%   77.65%   +0.02%     
==========================================
  Files          69       69              
  Lines        5481     5474       -7     
==========================================
- Hits         4255     4251       -4     
+ Misses       1226     1223       -3     
Flag Coverage Δ
unittests 77.65% <85.71%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
src/utils/utils.jl 62.45% <85.71%> (+0.12%) ⬆️

@jd-lara
Copy link
Member

jd-lara commented Oct 29, 2024

@GabrielKS is it expected that this breaks PSY?

@GabrielKS
Copy link
Contributor Author

@GabrielKS is it expected that this breaks PSY?

No, that was not expected (though strictly speaking it is only breaking the PSY tests…). I'll get into it.

@GabrielKS
Copy link
Contributor Author

GabrielKS commented Oct 29, 2024

Okay, yesterday evening's implementation was fundamentally wrongheaded. We do need a special case for AbstractArray to avoid testing the fields, but we don't want it to go directly to the match function, we want it to iterate over the items and recurse — like we already had for Vector. Here I've adapted that existing Vector method so it works with arrays of arbitrary dimensionality. Should not break PowerSystems now.

@jd-lara jd-lara merged commit 8c4d57d into main Oct 29, 2024
10 checks passed
@jd-lara jd-lara deleted the gks/fix_407 branch January 19, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compare_values incorrectly reports failures on Arrays
3 participants