cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<kenaan> rlamy py3.6 996be08dae82 /lib-python/3/test/test_coroutines.py: Fix tests that can't work on PyPy (and avoid a warning)
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
dustinm- has quit [Quit: Leaving]
dustinm has joined #pypy
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
adamholmberg has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
adamholmberg has quit [Ping timeout: 260 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
xcm has quit [Killed (moon.freenode.net (Nickname regained by services))]
xcm has joined #pypy
_whitelogger has joined #pypy
_whitelogger has joined #pypy
_whitelogger has joined #pypy
_whitelogger has joined #pypy
_whitelogger has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
altendky has quit [Quit: Connection closed for inactivity]
Ai9zO5AP has quit [Read error: Connection reset by peer]
adamholmberg has joined #pypy
Ai9zO5AP has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
rubdos has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 258 seconds]
rubdos has quit [Quit: WeeChat 2.4]
dddddd has quit [Ping timeout: 260 seconds]
ekaologik has joined #pypy
<tos9> mattip: what did we end up thinking about MACOSX_DEVELOPMENT_TARGET -- I forget who else here was talking about it recently
<tos9> mattip: In https://github.com/Julian/svmlight-loader/blob/master/tox.ini#L25 bumping it to 10.9 made numpy at least install, but I actually remember now I forgot to check that it doesn't just fail somewhere down the line, so probably I should run numpy.test or whatever it's called
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
_whitelogger has joined #pypy
ekaologik has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall.]
_whitelogger has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
TheNewbie has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
TheNewbie has quit [Quit: Leaving]
<mattip> tos9: yes please, give numpy.test() a try. I think you may need to install pytest to make it work
* tos9 nods
altendky has joined #pypy
Garen has quit [Read error: Connection reset by peer]
Garen has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
marky1991 has joined #pypy
<marky1991> ttrr
marky1991 has quit [Remote host closed the connection]
dddddd has joined #pypy
jcea has joined #pypy
rubdos has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/254 [mattip: force build, release-pypy3.6-v7.x]
<mattip> trying to translate with pypy2.7-v7.3.0rc1-aarch64, maybe that will mix things up enough to avoid the inlining problem
xcm has quit [Ping timeout: 260 seconds]
jvesely has joined #pypy
<arigato> michelp: hi
<arigato> do you still need an answer for yesterday's question?
<michelp> hello arigato! thanks for getting back to me, I have made some progress, I'm able to make a BinaryOp and use it with graphblas https://gist.github.com/michelp/55f11547d14439723fac5b446249fd35
<arigato> a quick note, these two lines:
<michelp> I was going to spend some time today trying and try to avoid using literal C code, was hoping it was possible to user a numba.types.Record instead of the cdef code but haven't found a way around that yet
<arigato> data = ffi.new('BF_tuple[1]')
<arigato> ptr = ffi.cast('BF_tuple*', data)
<arigato> here 'data' and 'ptr' are roughly the same thing, so you really only need "data = ffi.new('BF_tuple *')"
<arigato> or 'BF_tuple[1]', that's almost equivalent
<arigato> the point is that the cast that follows is never necessary
<michelp> ah ok, thanks, I think I cribbed that from the numba docs where they do something similar https://github.com/numba/numba/blob/master/examples/notebooks/Accessing%20C%20Struct%20Data.ipynb
<michelp> but I see what you mean, I'll fix that up
<arigato> to answer your question, if you really don't want to write ffi.new('BF_tuple *') with a string, you can also write ffi.new(ffi.typeof('BF_tuple *')), and then move the ffi.typeof('BF_tuple *') into some global constant and use that
<arigato> it's a constant that represents the same type in a non-string fashion
<michelp> that's a good idea, the string I was hoping to avoid was having to write out the struct and function prototypes and instead build those structures programatically
<arigato> ah, the string you pass in cdef()? sorry I misunderstood
<michelp> and sort of hide the machinery behind some abstractions
<arigato> yes, it's a nice idea to hide the machinery behind abstractions in general
<michelp> all the users care about are the struct and the two functions (bf_min/bf_plus) those are the essential bits to build operations
<arigato> note that I see you call ffi.set_source(), but go on using this ffi for operations like ffi.new()
<arigato> that set_source() is only meaningful if you're doing offline building
<michelp> ah yeah, sorry that vestigial to my example from me playing around
<arigato> OK
<arigato> so no, there is no alternative to providing cdef() with one (or a few) big strings
<arigato> maybe you can build that string from some other places instead of having it hard-coded, but in the end you need the string
<michelp> what's got me there is there's two ffi object, the one from the library wouldn't let me do somethign, sorry i can't remember it after sleeping it got flushed out, but it was giving me an error that it was "CompiledFFI" or something like that, so I had to make a new one
<arigato> in terms of that overview.html web page, a "CompiledFFI" is the type of the ffi object you get from "from _pi_cffi import ffi, lib"
<arigato> and indeed such an ffi object doesn't have the cdef() method any more, because it's supposed to be already built from the _pi_cffi module (in this case)
<michelp> ok, that makes sense as follows basically what i was guessing at there
<arigato> sorry, I don't really know numba's cffi_support, so I'm not sure about the details there
<michelp> something that caught my eye searching around for this was the following gist that maps pointers to jitclass instances https://gist.githubusercontent.com/sklam/ab2948068f76b6b206459fa4e2b4aafc/raw/c9849a6243fc1a7987f9eb4a2ec56b72115d3900/unsafe_cast.py
<michelp> was thinking that might be another approach, users write jitclasses with operations that map to the matrix operators
<arigato> sorry, I really know next to nothing about numba
<michelp> that's fine, you've been super helpful thank you! and cffi is one of my favorite libraries, and a python and C programmer it's the best of both worlds :)
<arigato> :-)
<michelp> once i get around this hurdle pygraphblas will be essentially 100% feature complete which i'm pretty excited about
<arigato> yes, I can only repeat that ideally, you're supposed to use cffi "under the hood" when designing some nicer Pythonic interface on top of it
<arigato> :-)
<michelp> yeah most of graphblas is hidden away, the User Defined Type stuff is where there's some exposure of the lower level stuff, it might be unavoidable as it's the most advanced usage of the library
Cheery_ has quit [Quit: Reconnecting]
Cheery has joined #pypy
<michelp> unfortunately it's pretty critical to solving any advanced problems so i'm going to keep trying to simplify until I get there
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 265 seconds]
jcea has quit [Ping timeout: 245 seconds]
xcm has joined #pypy
<mattip> marmoute: ping
<marmoute> mattip: pong
altendky has quit [Quit: Connection closed for inactivity]
adamholmberg has joined #pypy
ccamel has quit [Quit: ZNC 1.7.4 - https://znc.in]
camelCaser has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/254 [mattip: force build, release-pypy3.6-v7.x]
adamholmberg has quit [Ping timeout: 258 seconds]
<kenaan> mattip pypy.org[extradoc] d3d2835dab48 /source/download.txt: add pypy7.3.0rc3 hashes
<mattip> pypy 7.3.0rc3 tarballs are up, the hashes are here ^^^
jvesely has quit [Quit: jvesely]
jvesely has joined #pypy
jvesely has quit [Client Quit]
jvesely has joined #pypy
jvesely has quit [Quit: jvesely]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]