Comments (2)
- JArray must inherit from PyJPArray
- Remove numpy includes
- JPArray::GetSlice will return JArray instance
- JPArray::SetSlice must support sequence and memory view
- PyJPArray must support memory view
- Slice must replicate on Java call usage
- Slice must replicate on copy ctor
- Object arrays handle special
- JPArray must have start, stop, step,
- Backport PyJPArray from 0.8
- Rework getArrayRange
- Rework setArrayRange
- Clone on cast
- Slice assignment must be safe from self assignment
- Figure out how to extract data from struct API in C++
- Figure out how to get Python devs to respond regarding missing buffer API in the ABI
- Incorporate type conversion table for setSlice from buffers to support numpy
- Test getSlice against list with slices and compound slices
- Test setSlice from buffers
- Test getSlice to buffers
https://docs.python.org/3/c-api/typeobj.html#buffer-structs
https://docs.python.org/3/library/struct.html#module-struct
from jpype.
@marscher One big challenge on this is trying to match which rules array set slice should use. The closest equivalent I can find is
https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.astype.html
My best guess currently given the prior implementation is unsafe if sizes match otherwise no conversion as we dont appear to check the Python format codes. It only checks itemsize. This is mostly safe but does automatically turn floats to gibberish as a buggy side effect if you try to cast to int.
If I have to redo it then it needs to make some sense while not blatently replicating useless bugs. Java rules would require safe with same type (double to float) but they dont specify what to do with unsigned.
Thus i am guessing safe with same type plus automatic unsigned to signed on same size would be the most compatible to our current implementation and still not allow insane conversions (double to short)
Bool and char is also weird edge cases. The most permissive bool cases is anything that is not zero is true. That would seem like Python valid syntax, but not Java safe. Char has encoding requirements and like should not take buffer syntax at all.
Do you have any opinions on this?
from jpype.
Related Issues (20)
- Str/Unicode HOT 1
- Item check list HOT 1
- Docstring generation
- Implements
- Stack trace integration
- Auto Proxy
- Segfault on call abstract method
- Examine what is in tcalmant branch HOT 2
- JPype crashing with "AttributeError: _hints can't be set" HOT 33
- Task list for JPype 0.8 Release HOT 1
- Verify the behavior of underbar with Java symbols
- Check if Java primitives are closed
- See about making List satisfy Sequence contract
- Elementwise access for buffers?
- Make JChar derive from unicode
- Investigate exception reported in testDoc.py
- Getting started? HOT 4
- Speed HOT 20
- epypj master list HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpype.