NREL / ssc

SAM Simulation Core (SSC) contains the underlying performance and financial models for SAM
BSD 3-Clause "New" or "Revised" License
78 stars 83 forks source link

Address SAM issue #1733 while keeping functionality of SAM issue #1184 #1176

Closed sjanzou closed 1 week ago

sjanzou commented 2 weeks ago

To test:

  1. pull SAM_1733 branch of ssc and patch branches of other repos and build
  2. create PVWatts/Commercial case
  3. Financial parameters page - set straight line depreciation years to 0
  4. select straight line depreciation and run - error as expected
  5. select different depreciation method and run - no error as expected.

See https://github.com/NREL/SAM/issues/1733 for simulation error in current release.

sjanzou commented 2 weeks ago

I'm still seeing the error after cleaning and rebuilding. This is for the default PVWatts / Commercial case switching to 5-yr MACRS after setting straight line depreciation years to zero:

image

@cpaulgilman , could you please clean (and delete SAM-private\build_windows folder if testing from the SAM-private build) and make sure the ssc.dll used is the latest image

I am not able to replicate the error unless "Straight line" depreciation is selected - tested Federal and State switching between all Depreciation mode selections runs without error. image

sjanzou commented 1 week ago

Worked for me when testing. Where else should SKIP_CONSTRAINT_CHECK be applied (question for a different issue/PR)?

I can't replicate the Windows test failure on my build.

SKIP_CONSTRAINT_CHECK should be used anywhere for an optional ssc variable that is required only if some other variable is set to a specific value. The example of SAM issue https://github.com/NREL/SAM/issues/1733 is a perfect example in which the optional "years" value for straight line depreciation is required only if the depreciation selection is 2. Then the "years" input for the user should be checked to be positive (the CONSTRAINT field in the vartable).