- Posts: 5
Many modules hitting access violation when run via Python API
- dpinney
- Topic Author
Less
More
13 Mar 2013 14:42 #1428
by dpinney
Many modules hitting access violation when run via Python API was created by dpinney
Hi forums, I'm trying to embed some SAM functionality in a Python app. However, with every module I've tried so far except for pvwattsv1, I get an access violation when I try to execute with the Python API. This is even when the input variables do run when used in LK scripts.
Is this a known issue with a workaround?
Attached are a few of my debugging attempts. simpleSam.py works fine with pvwattsv1. samSolarTimePpa.py (a port of pvsamv1_c3d_comppa.lk) hits the access violation with pvsamv1. samWindWatts.py hits what appears to be the same access violation with the windpower module.
I also noticed the tests in sscapi.py fail for the windwatts case. Probably because windwatts has been deprecated or renamed windpower?
Guessing there might be a problem with the more advanced data types--array, matrix--I tried adding these to a pvwattsv1. But that works fine, so those types aren't the issue. That's in simpleSamArray.py.
My python API version, according to the tests, is 27. Full SDK version is 0.9.
Is this a known issue with a workaround?
Attached are a few of my debugging attempts. simpleSam.py works fine with pvwattsv1. samSolarTimePpa.py (a port of pvsamv1_c3d_comppa.lk) hits the access violation with pvsamv1. samWindWatts.py hits what appears to be the same access violation with the windpower module.
I also noticed the tests in sscapi.py fail for the windwatts case. Probably because windwatts has been deprecated or renamed windpower?
Guessing there might be a problem with the more advanced data types--array, matrix--I tried adding these to a pvwattsv1. But that works fine, so those types aren't the issue. That's in simpleSamArray.py.
My python API version, according to the tests, is 27. Full SDK version is 0.9.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
13 Mar 2013 17:14 #1429
by pgilman
Replied by pgilman on topic Many modules hitting access violation when run via Python API
Hello,
We are not aware of this issue and will look into it. Thank you for bringing it to our attention. It may take us a week or two to get to this because a couple of our SDK people are on leave or vacation. I will get back to you when we have answers.
Best regards,
Paul.
We are not aware of this issue and will look into it. Thank you for bringing it to our attention. It may take us a week or two to get to this because a couple of our SDK people are on leave or vacation. I will get back to you when we have answers.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- sjanzou
Less
More
- Posts: 22
20 Mar 2013 03:13 #1430
by sjanzou
Replied by sjanzou on topic Many modules hitting access violation when run via Python API
The python wrapper is currently being restructured into classes like the matlab, csharp and java wrappers. We will post an update as soon as one is available.
In the meantime, I am attaching an updated sscapi.py that works with the latest SDK - API version 28 posted on March 13, 2013.
As you noted, windwatts has been depricated and replaced with windpower.
In the meantime, I am attaching an updated sscapi.py that works with the latest SDK - API version 28 posted on March 13, 2013.
As you noted, windwatts has been depricated and replaced with windpower.
Please Log in or Create an account to join the conversation.
- dpinney
- Topic Author
Less
More
- Posts: 5
20 Mar 2013 13:01 #1431
by dpinney
Replied by dpinney on topic Many modules hitting access violation when run via Python API
Great to hear that Python API enhancements are on the roadmap.
Regarding the attachment, did it replace the file attached previously? I see some windwatts tests commented out in what's currently attached compared to what's in the v0.9 API download, but I can't remember if I did that in my copy. Can you confirm where the updated API files are?
Regarding the attachment, did it replace the file attached previously? I see some windwatts tests commented out in what's currently attached compared to what's in the v0.9 API download, but I can't remember if I did that in my copy. Can you confirm where the updated API files are?
Please Log in or Create an account to join the conversation.
- sjanzou
Less
More
- Posts: 22
22 Mar 2013 04:06 #1432
by sjanzou
Replied by sjanzou on topic Many modules hitting access violation when run via Python API
The updated sdk is at
sam.nrel.gov/content/sam-simulation-core-sdk
and has a date 3/13/13.
The updated sscapi.py file that should be used is the first attachment to this thread. Please replace the sscapi.py in the downloaded sdk with the one attached to this thread.
I will update this thread when the updated Python API is available in an updated SDK.
The updated sscapi.py file that should be used is the first attachment to this thread. Please replace the sscapi.py in the downloaded sdk with the one attached to this thread.
I will update this thread when the updated Python API is available in an updated SDK.
Please Log in or Create an account to join the conversation.
- sjanzou
Less
More
- Posts: 22
10 Apr 2013 06:14 #1433
by sjanzou
Replied by sjanzou on topic Many modules hitting access violation when run via Python API
The Python wrapper has been updated on April 10, 2013 with a new class structure and several new examples - including the samSolarTimePpa.py script posted with the original message. Let us know if you have any questions.
The updated sdk is available for download at sam.nrel.gov/content/sam-simulation-core-sdk
The updated sdk is available for download at sam.nrel.gov/content/sam-simulation-core-sdk
Please Log in or Create an account to join the conversation.
Moderators: pgilman