Hi all-
Like others on this list, I've struggled to get the python sscapi.py to work how I want it. My solution can now be found as an open source python module called SAMpy.
See
github.com/sborgeson/SAMpy for code, install, and usage instructions.
As I see it, the current official sscapi python integration suffers from a few issues:
(1) The shared library (dll, so, etc.) paths are hard coded and assume execution local to the SDK.
(2) The api is very low level and not very "pythonic". In particular, it's clumsy to set values and to retrieve results and does not work with my favored data structures, like dicts and pandas DataFrames.
(3) There is no support for templating inputs for parametric runs.
(4) The api is not compatible with Python 3, including incompatible print formats and string c handling.
All of these are addressed by the linked module. The upshot is that you can configure the path to the ssc shared library, you configure modules with dicts of named values that are mapped into ssc_data, and you can extract results into a pandas DataFrame.
As an aside, I was not aware of solarjoe's and sjschneider's efforts to provide python 3 support when I wrote the module, but I hope it is seen as providing a broader set of functionality rather than yet another python 3 fix!
I consider this a very early release, so please let me know any problems you encounter or ideas for applications you have via GitHub issues or further discussion here.
Sam (no relation to SAM!)