-
Notifications
You must be signed in to change notification settings - Fork 151
Compute modules in SAM
Compute modules in SSC are a structure that contain complete functions calculating large sections of a model in SAM.
Please see SSC Compute Modules for background and instruction on how to create a new compute module in SSC.
After a new compute module is created and set up in SSC, getting the compute module to be accessible via the SAM GUI or PySAM requires further steps. In SAM, a compute module is run within a "Configuration", which are defined in the startup.lk script. The addconfig
function creates a new configuration, the name of which is called the "config name" in this document.
-
Setup the configuration in the startup.lk script: UI pages. Setup the defaults.
-
Add a Module description to builder_PySAM.cpp::module_doc
The compute module name needs to be reformatted by removing "cmod", removing underscores and capitalizing each letter that followed an underscore: "cmod_xx_yy" becomes "XxYy". The description should provide a high level way of distinguishing this compute module.
-
Identify the config name with the compute module in data_structures.h::config_to_cmod_name
The first entry is the config name, and the second entry is the reformatted compute module name from step one (e.g. XxYy).
-
Build sam_api with export_config. First refresh the CMake build if this is not automated. The
export_config
project needs to be run first, and will generate the SAM_api and PySAM files for the new configuration. You will notice new files in thesam/api/include
,sam/api/modules
and if you have provided Default files for the configuration,sam/api/api_autogen/library/defaults
. There will also be new files inpysam/docs
,pysam/modules
, andpysam/stubs
. -
Update table in PySAM's docs/Models.rst to add the new compute module into table of contents of models.
-
Update table in PySAM's docs/Configs.rst to describe the new SAM Configuration. For each configuration's financial model pairing, create a new row with the configuration type, a description, and a link to the documentation pages of the compute modules that comprise it.
-
Add an Example or a Test to PySAM