Many modules hitting access violation when run via Python API

7 posts / 0 new
Last post
dpinney
Many modules hitting access violation when run via Python API

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.

Paul Gilman

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.

sjanzou

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.

dpinney

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?

sjanzou

The updated sdk is at https://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.

sjanzou

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 https://sam.nrel.gov/content/sam-simulation-core-sdk

dpinney

Thanks! I'll give it another test soon.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer