-
Notifications
You must be signed in to change notification settings - Fork 186
Create .sam file from PySAM JSON #2065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @softwareengineerprogrammer! This would be a useful feature. It is not currently possible to create a .sam file from Python, but it is possible to import data from JSON to a .sam file using SAM's Ctrl-F6 and Ctrl-F8 keyboard shortcuts described here: https://samrepo.nrelcloud.org/help/function_keys.html. This requires starting SAM, creating the appropriate case, and pressing the keys. We haven't made those features obvious because they are still in the proof-of-concept phase, but it would be helpful for us to know how well they work with your JSON files. Aside from the question of how to generate a .sam file in the correct format from Python, there's also the question of how to handle SAM inputs that are not SSC inputs. The inputs in the SAM user interface for a given configuration are not identical to the SSC inputs that PySAM accesses. For example, for the Detailed PV model, the Estimate subarray 1 configuration, Desired array size, and Desired DC to AC Ratio user interface inputs on SAM's System Design page are not SSC inputs. A script in the user interface calculates the value of the SSC |
Thanks for the info and context @cpaulgilman, I appreciate it!
I get the following error for attempting to load a JSON file (Ctrl+F6): Attempting to load as an SSC JSON file (Ctrl+F8) instead doesn't appear to work/have any effect. It doesn't give any explicit error, but prompts for a new case: ![]() If I proceed with creating a new case e.g. Custom Generation Profile, it doesn't appear that the values are populated from the JSON. The JSON in question I tried to provide is https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/69/files#diff-90a1adb4b1824c8a6dc4c72a70239ef8e0fc40465ef465220124644ed6d680d9 Let me know if there's any other info I can provide to help. |
Is your feature request related to a problem? Please describe.
Yes. I want to be able to export
.sam
files based on PySAM JSON inputs I have constructed programmatically, so that users can import the programmatically generated cases into the SAM GUI on their own.Describe the solution you'd like
A Python function that takes a set of PySAM JSON files and returns a corresponding
.sam
file.Describe alternatives you've considered
I've already written code which displays the SAM data in my own program. However I would like users to be able to independently run the SAM case themselves to verify results or make their own modifications in SAM.
I have searched documentation/the Internet to see if this is already possible, and have not been able to find any answers.
I have considered reverse-engineering the
.sam
file format to see if it's feasible to generate it myself but it being a binary file means this is likely a much greater task than I can take on with available resourcing.Additional context
See my profile for relevant work (GEOPHIRES) and links to contact info - happy to chat offline.
The text was updated successfully, but these errors were encountered: