Hello,
I am trying to get into using SAM in python and I am trying to repeat the
To import a case from the SAM GUI
example in the documentation.
in my example (see code attached) I try to read from a file pvwatts_default-inputs.json, which I have created from the SAM GUI (export -> json inputs and separating what I believe is part of the grid module).
The file looks like this:
{
[...],
"adjust:constant" : 0
}
When I try to execute with the "adjust:constant" variable included I get an "AttributeError", which I believe is because it does not recognize the variable name. And indeed in the
C++ source code
there is no variable with that name.
When I remove the variable, I get "Exception: pvwattsv7 execution error. precheck input: variable 'adjust:constant' (Constant loss adjustment) required but not assigned"
Attachments: code example and two .json input files (.json files not allowed as attachements, therefore as .txt)
Thank you in advance for any hints on the solution and please excuse the beginner level question!
Additional questions out of interest:
1) Why does the example exclude a variable with the name "number_inputs"?
2) The C++ source code mentions a lot more inputs (such as "bifaciality") than are being generated when exporting inputs to .json in SAM, why is that?
Attachment not found
Attachment not found
Attachment not found
3) When exporting the SAM inputs to a .json file the file also includes the following lines. What are they used for, they do not appear to be either PVWatts or Grid inputs.
"metric_0" : "annual_energy",
"metric_0_label" : "Annual energy (year 1)",
"metric_1" : "capacity_factor",
"metric_1_label" : "Capacity factor (year 1)",
"metric_2" : "kwh_per_kw",
"metric_2_label" : "Energy yield (year 1)",
"number_compute_modules" : 2,
"number_metrics" : 3