change to binary types for large datasets

my project requires a large dataset and an iteration in bytearray of char’s and add a single bit into a vector for which every other bit is distinguishable, [ setattr(obj,intvar,obj.intvar+=2-((a<0 and 1 ) or 0)) for a in array_of_ints] and base 3 is [ setattr(obj,intvar,obj.intvar+=3-((a<0 and 1) and (a>1 and 2) or 0) for a in array_of_ints ]
but as you can see I have very little logic experience in python I’m sure there’s a better way more dynamic way of packing these structures down.

That looks quite complex, and I’m not sure what you actually try to achieve. Do you need to compute large arrays, or is this more about how to store your data efficiently in a blend?

well I have a classifier for edge detection in 2d images that unwraps the edges from the image into an array from a sparse spiral left-to-right top-to-bottom then right-to-left bottom-to-top-1y left-to-right-2x, etc ,etc. and I want to match this 2d sparse space to in many different cases (and it’s expensive in python types) so I want to make the task eaiser on memory, I actually came up with one solution last night, using a hash generated to the the contour of light for a focal orientation, but this is for much more intensive purposes, in the interum I want to cheat and use bgl.GL_FEEDBACK mode to extract visible GL_3D BYTES with bgl.glFeedbackBuffer(GL_3D,256,bgl.Buffer(GL_BYTE,[2563],bytearray([2563]))); but I’m not even sure how to get the api to populate in any other than python types in that case I’d rather stick with images, until I get a handle on parsing out very distant objects let alone textures far away. Let me know If you got any thought’s if you have trouble with the game api try;
add the function to a always sensor and It should only run once.import os,sys,imp,time,threading,readlineclass code_obj(): def init(self,pipe=sys.stdin,pipeout=sys.stdout,use_readline=False,completekey=“Tab”,local=None): self.pipe=pipe;self.err=None; self.local=local; self.use_encoding=True; self.pipeout=pipeout; self.cmdq=[]; self.use_readline=use_readline; self.running=False;self.more=False; self.use_local=False; self.retval=True;self.use_input=True; def rl(): self.completer=readline.get_completer(); readline.set_completer(self.completer); if completekey: readline.parse_and_bind(completekey+": complete"); def loop(self): if (self.running==False): while (self.err==None): try: if (self.use_input): line=input([’>>’,’…’][[False,True].index(self.more)]); else: time.sleep(.1); if (self.use_readline): self.rl(); readline.set_completer(self.old_completer); cmd=None; try: cmd=compile("
“.join(self.cmdq+[line]),”",“single”,0x200); except(SyntaxError,ValueError,AttributeError): cmd=None;self.cmdq=[];line=None; if cmd: self.cmdq=[]; self._cmd(cmd); self.more=False; else: if (line): if self.use_encoding: enc=getattr(sys,‘encoding’,None); if enc and not isinstance(line,unicode): try: line=line.decode(enc); except(EncodingError,DecodingError): self.use_encoding=False self.cmdq.append(line); self.more=True except(Exception): self.traceback(); except(EOFError): self.use_input=False def _cmd(self,cmd,local=None): if (self.use_local): local=local or self.local; eval(cmd,local); else: eval(cmd); def traceback(self): exc=sys.exc_info(); self.pipeout.write(str(exc[1])+chr(10)); self.pipeout.flush();def consoleHead(): import thread; codeloop=code_obj(); #thread.start_new_thread(codeloop,()); codeloop.loop(); #this.head=Window(this); #this.head.loop()if name==‘main’: consoleHead();

Hm, can’t help you with this. Not sure if Blender API supports GL_FEEDBACK even…