embedding docs - expose all available API #410
Comments
|
Here's a list of whats currently publicly exposed but with no xml docs.
|
|
The easier approach might to write a few more example based on the unittests and limit those examples to use only |
|
@denfromufa I'm not going very far in pythonnet. currently, I have used these methods,
In the future, I will dig deep, such as using threading and asynchronous callback, and share my experience here. Before writing the docs, I think we need to do some work on the embedding API design. For the embedding API design, I hold the same view as @filmor,
According to this principle, some functions and properties can be removed from the current API list, such as the Handle property of PyObject, the BeginAllowThreads method, the EndAllowThreads. In order to remove these APIs related to the IntPtr, some new APIs need to be designed and provided. Use the PythonEngine.AcquireLock and PythonEngine.ReleaseLock as example, these two methods should be removed according to this principle. Their problems include, programe will crash if the ReleaseLock is called redundantly, and CPython will be blocked if forge to call the ReleaseLock method. The Py.GIL class can be extended to cover their usage, such as the PyScope.GIL class in the PyScope proposal. Following are my other proposals for the embedding API design,
For the docs of embedding CPython, @vmuriart said the easier approach is writing a few more example based on the unittests, supplementary approach is providing a doc according to topics. Topics come from the list of issues users encontered. For example, following is what I have currently,
|
|
here is a library for embedding python with pythonnet and using numpy, matplotlib: |
|
@denfromufa Line 96 and 97 fail with the latest Python.Runtime.dll (compile from git clone)
using example
previously, I thought was due to regression of Numpy. With the latest compile python.Runtime, the regression issue is gone, yet, there is a problem of converting double[] array to python.net Appreciate |
|
PyPlot for matplotlib |
|
@JimSEOW please don't hijack this issue with a separate feature request,
mapping containers between languages is not easy. Especially arrays, since
Python does not have built-in arrays. There is array module in Python, but
everybody uses numpy arrays.
…On Wed, Apr 5, 2017, 6:14 PM JimSw2016 ***@***.***> wrote:
PyPlot for matplotlib
#442 <#442>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#410 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5Yo_h3-0QUZL6D5ewYWGUbbwsCEjks5rtCBhgaJpZM4MMs2N>
.
|
|
@denfromufa sorry, I am not aware. |
|
@JimSEOW I tried the SimplePythonGraph project. I guess you ran the program in x64 mode. If so, the bug you encountered was caused by the limitation of method PyInt.AsInt(). A solution is, replace all the expressions P.S. The limitation of the PyInt.AsInt method is, This method called the CPython API PyNumber_Int, which converts a python number to C int (maybe C long?). When the target platform of the program was x64, the address of a variable may out of the range of integer. PyNumber_Long is also not working here, because on windows the length of C long is also 4 bytes, no matter the target platform is x86 or x64. |
I get error of {"Specified cast is not valid."}
@yagweb Do you have a running SimplePythonGraph project to share? Relevant issue |
|
@yagweb will your scope class address the GET, SET issues above? |
cc @yagweb @vmuriart
Initialize
Py.GIL and Threads
RunSimpleString, Exec, Eval
Py.Import
Dynamic vs static declaration
Py.kw
Setting paths
Type conversions
Shutdown
The text was updated successfully, but these errors were encountered: