Skip to content

Copy values to a new vector that should solve snow model re-initaliza…#1377

Open
brtietz wants to merge 1 commit intodevelopfrom
ssc_1372_user_array_memory_fix
Open

Copy values to a new vector that should solve snow model re-initaliza…#1377
brtietz wants to merge 1 commit intodevelopfrom
ssc_1372_user_array_memory_fix

Conversation

@brtietz
Copy link
Copy Markdown
Collaborator

@brtietz brtietz commented Mar 23, 2026

…tion errors

Pull Request Template

Description

Attempt at solving #1372

Hypothesis is that keeping a pointer for the snow data array and passing that to multiple tests caused the memory to be corrupted and the results to change. Copy these values into a vector so the underlying data doesn't change run to run.

Credit to Claude Sonnet for spotting the memory re-use. Blame to Claude Sonnet for some of the annoying tab/spacing changes on the close braces.

Fixes #1372

Corresponding branches and PRs:

Develop on all other branches

Unit Test Impact:

Expect tests to pass consistently across OSes

Checklist

  • requires help revision and I added that label
  • adds, removes, modifies, or deletes variables in existing compute modules
  • adds a new compute module
  • changes defaults
  • I've tagged this PR to a milestone

Reminders- this section can be deleted

[Checking for PySAM Incompatible API Changes]
(https://github.com/NREL/SAM/wiki/PySAM-Incompatible-API-Changes-&-Regenerating-PySAM-Files).

[When do the PySAM files need to be regenerated?]
(https://github.com/NREL/SAM/wiki/PySAM-Incompatible-API-Changes-&-Regenerating-PySAM-Files#when-do-the-pysam-files-need-to-be-regenerated-via-export_config)

@brtietz brtietz added this to the SAM 2026 Release milestone Mar 23, 2026
@brtietz brtietz requested a review from sjanzou March 23, 2026 18:44
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23454101362

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 58.306%

Totals Coverage Status
Change from base Build 23365037156: 0.004%
Covered Lines: 74476
Relevant Lines: 127733

💛 - Coveralls

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.

Intermittent test failure on Windows for CMPvsamv1PowerIntegration_cmod_pvsamv1.UserArraySnowModel

2 participants