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

Add option to specify equality predicate for compare_values and provide a more sensible default (PSY) #1159

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

GabrielKS
Copy link
Collaborator

Companion to NREL-Sienna/InfrastructureSystems.jl#387, see discussion (including of backwards compatibility) there.

@GabrielKS GabrielKS requested review from daniel-thom and jd-lara July 19, 2024 03:11
@GabrielKS GabrielKS changed the title Add option to specify equality predicate for compare_values and provide a more sensible default Add option to specify equality predicate for compare_values and provide a more sensible default (PSY) Jul 19, 2024
@GabrielKS
Copy link
Collaborator Author

Tests are failing in CI due to the dependency on the IS companion branch.

@GabrielKS GabrielKS self-assigned this Jul 19, 2024
src/base.jl Outdated Show resolved Hide resolved
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.

I think the better implementation for sophisticated users is to implement

IS.compare_values(
     match_fn::Function,
    x::T,
     y::T;
     compare_uuids = false,
     exclude = Set{Symbol}(),

and forward

IS.compare_values(
    x::T,
     y::T;
     compare_uuids = false,
     exclude = Set{Symbol}(),

to

IS.compare_values(
 IS.isequivalent,
    x::T,
     y::T;
     compare_uuids = false,
     exclude = Set{Symbol}(),

@GabrielKS GabrielKS force-pushed the gks/compare_values_match_fn branch from d3184b3 to e2a8039 Compare August 6, 2024 03:49
@GabrielKS GabrielKS requested a review from jd-lara August 6, 2024 03:53
src/base.jl Show resolved Hide resolved
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

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

Project coverage is 84.52%. Comparing base (9405461) to head (4b2c01b).
Report is 6 commits behind head on main.

Files Patch % Lines
src/base.jl 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1159   +/-   ##
=======================================
  Coverage   84.52%   84.52%           
=======================================
  Files         179      179           
  Lines        8167     8169    +2     
=======================================
+ Hits         6903     6905    +2     
  Misses       1264     1264           
Flag Coverage Δ
unittests 84.52% <75.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
src/base.jl 89.34% <75.00%> (+0.02%) ⬆️

@GabrielKS
Copy link
Collaborator Author

@jd-lara checks are passing now that the IS companion is merged

@jd-lara jd-lara merged commit 4b93af8 into main Aug 15, 2024
7 of 8 checks passed
@jd-lara jd-lara deleted the gks/compare_values_match_fn branch December 13, 2024 18:41
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.

2 participants