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

Initial Conditions Reconciliation #1: Detect Mismatches #1069

Merged
merged 11 commits into from
Mar 18, 2024

Conversation

GabrielKS
Copy link
Contributor

@GabrielKS GabrielKS commented Mar 2, 2024

Here we implement the logic to automatically detect mismatches between initial conditions that requires_reconciliation. Some notes about the implementation:

  • How requires_reconciliation figures in: first we make the set of all ICKeys to check, then as we are looping over them to check them we skip those whose T::InitialConditionType has requires_reconciliation(T) == false, so keys that don't require reconciliation never get compared across models even if other keys do require reconciliation. At one point we discussed comparing all the keys if at least one requires_reconciliation; this is not that. This behavior (coupled with erring on the side of requires_reconciliation(T) == true) makes the most sense to me — if a key is at all relevant during this process we should just mark it as requiring reconciliation — but that should be reviewed.
  • We still need to finalize our list of requires_reconciliation methods before this draft PR becomes ready for review, I'd love to get @lpstreitmatter and José David's input on that.
  • Mismatches are reported as @info for each mismatch, then if there are nonzero mismatches we report a @warn noting that there is not yet logic to resolve the mismatch.

jd-lara and others added 7 commits February 7, 2024 16:34
* add place holders

* add requires_reconciliation trait

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* add place holders

* add requires_reconciliation trait

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* add place holders

* add requires_reconciliation trait

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* add place holders

* afc/created test for ic

* afc/added functions on PSI for ic reconciliation

* afc/fixed rounding, tested

Still getting the same error as before on T=7

* formatter

---------

Co-authored-by: alefcastelli <[email protected]>
src/core/initial_conditions.jl Outdated Show resolved Hide resolved
@jd-lara jd-lara changed the base branch from main to psy4 March 6, 2024 04:39
@jd-lara
Copy link
Member

jd-lara commented Mar 6, 2024

@GabrielKS I changed the base to go to PSY4

@GabrielKS
Copy link
Contributor Author

@jd-lara marking this as ready for review now — how does the current set of requires_reconciliation traits look to you?

@GabrielKS GabrielKS marked this pull request as ready for review March 12, 2024 19:58
@GabrielKS GabrielKS requested a review from jd-lara March 12, 2024 19:58
@jd-lara
Copy link
Member

jd-lara commented Mar 14, 2024

@GabrielKS can you fix the conflicts please

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.

Overall looks good but there are some situations that require attention.

@GabrielKS
Copy link
Contributor Author

Fixed the merge conflicts, made the tests pass in psy4 (depends on NREL-Sienna/StorageSystemsSimulations.jl#35)

@GabrielKS GabrielKS requested a review from jd-lara March 18, 2024 20:41
@jd-lara jd-lara merged commit 1ce5b4b into psy4 Mar 18, 2024
1 of 6 checks passed
@jd-lara jd-lara deleted the jdls/ic_reconciliation branch March 18, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants