Skip to content
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

Not able to load defaults: <built-in function default> returned a result with an error set #16

Closed
mimxvi opened this issue Feb 5, 2020 · 2 comments

Comments

@mimxvi
Copy link

mimxvi commented Feb 5, 2020

Hello.
I'm experiencing this problem:

NREL-PySAM
Installed in: 5.4.15-2-MANJARO
With: conda version : 4.7.12
With: python version : 3.7.4
Problem: I'm not able to load the defaults values.
Code and results:

(py3_SAM) [xvi@leonardo programs]$ python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySAM.Pvwattsv5 as pv
>>> d = pv.default("PVWattsSingleOwner")
PySAM.error: Could not open defaults file.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: <built-in function default> returned a result with an error set

Thank you very much in advance for any help.

@dguittet
Copy link
Collaborator

dguittet commented Feb 5, 2020

Thanks for the question!

Since SAM switched to using PVwattsv7 (see PVWatts section in the release notes: https://nrel.github.io/SAM/doc/releasenotes.html), the defaults have also been moved to Pvwattsv7. So if you switch to import Pysam.Pvwattsv7, then the code should work.

If you're still interested in using Pvwattsv5 instead, you can store them yourself from here: https://github.com/NREL/SAM/blob/develop/api/api_autogen/library/defaults/Pvwattsv5_PVWattsNone.json

You'll note there're exactly the same as for v7, except v7 has a new term en_snowloss which corresponds to its new optional snow model.

@mimxvi
Copy link
Author

mimxvi commented Feb 5, 2020

Thank you very much for your clear and useful answer.

Now it works fine.

Therefore, I close the issue.

@mimxvi mimxvi closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants