« first day (222 days earlier)      last day (2179 days later) » 

08:08
[[('LF-RF', 44L), ('LF-LH', 28L), ('LF-LF', 92L), ('LF-RH', 76L)],
[('RF-LH', -16L), ('RF-LF', 48L), ('RF-RH', 32L), ('RF-RF', 95L)],
[('LH-LF', 64L), ('LH-RH', 48L), ('LH-RF', 111L), ('LH-LH', 92L)],
[('LF-RH', -16L), ('LF-RF', 47L), ('LF-LH', 28L), ('LF-LF', 92L)],
[('RH-RF', 63L), ('RH-LH', 44L), ('RH-LF', 108L), ('RH-RH', 89L)],
[('RF-LH', -19L), ('RF-LF', 45L), ('RF-RH', 26L)],
[('LH-LF', 64L), ('LH-RH', 45L)],
[('LF-RH', -19L)]]
That's better, it was calculating the distance from itself to itself :P
@TomWijsman yes you could base it on the length of an array, but the indexing get's quite tedious at some point
 
2 hours later…
10:11
progress @DMA57361 :) I have the results in the database, it will calculate the difference in all three dimensions between two contacts and store that
now I have to figure out what a sensible workflow is, because I probably should calculate this stuff after you 'assign' contacts to the database or rather when you say you're done with processing the data
then when you go to analysis and load a session, it will load it from the database, rather than recalculate it :P
I'm just slightly worried that if I'd calculate it right after assigning, I would have to recalculate if they decide they made a 'mistake' and want to reassign them
so I probably need a way to drop the assigned contacts and make that trigger a dropping of their results as well
I can make the changing of the ribbon tabs trigger the loading of the results of all the measurements in that session (I'll deal with filtering those per protocol later :P), just need to tweak when to calculate them I guess
sounds positive :)
well I'm starting like my database more and more :P
I'm just a little shy of querying it a lot, because I have so little experience with it
and I might have to do some refactoring again :\
hadn't anticipated for this tbh, so I'm probably going to put all the calculations in one module
though on second thought, I'll first think it through :P
I made separate models and controllers for all the different results, but they get called from so many different places, it's getting confusing...
confusing is something you can't easily avoid
unfortunately :(
true, another problem I have to resolve is: I have lists with measurements or contacts and I've set it up that as soon as the list is filled, the first item and start loading stuff.
For some reason there's a circular reference in there, because the events get triggered twice everywhere
you did mention the double-trigger before IIRC
what types of events?
10:26
which off course is quite annoying when the tasks become more intensive
AddDataPanel.LoadMeasurements
SelectMeasurement.filllistobjectview
SelectMeasurement.setlistobjectview
SelectMeasurement.filllistobjectview
SelectMeasurement.setlistobjectview
RibbonPanel.OnSwitchPanels
SelectMeasurement.selectfirstmeasurement
DataController.OnSelect
DataModel.select
ContactController.OnReceiveData
EntirePlatePanel.displaymeasurement
SelectMeasurement.selectfirstmeasurement
DataController.OnSelect
SelectMeasurement fills the objectlistview and it gets filled twice. I select the first element because the ribbon switches panels, it loads the data twice
I fear there's something about that Objectlistview that I'm missing
def selectfirstmeasurement(self, event):
    print("SelectMeasurement.selectfirstmeasurement")
    if self.dataOlv.GetItemCount():
        self.dataOlv._SelectAndFocus(0)
        self.rowObj = self.dataOlv.GetObjectAt(0)
    pub.sendMessage("SelectMeasurement.selectfirstmeasurement", self.rowObj)
the function that selects the first object doesn't even do anything strange :S
well shrug, I'm afraid, events are an area I'm lacking much exp in
on another place I've already put in a check, when that object had an attribute selected, it would stop
but obviously that's not really correct either
I don't dare to keep track of whether something is selected at the moment, because I'd probably screw it up and it would block selecting something else :\
wtf :S I've put in somewhere that self.rowObj = [], so I can check in selectfirstmeasurement ==> if not self.rowObj: do something
it actually assigns <model.measurementmodel.Measurement object at 0x094D0690> to self.rowObj
but when it comes there again, its gone :S
that would almost mean there are two instances of the same object right?
I seriously need to figure out how to run certain events only when the right ribbon tab is activated
10:42
yeah, that sounds like you've got a rather unusual bug floating around somewhere :/
no I think I've figured out what the cause for that is, just annoying they trigger the same events :(
I need to pass along the same instance of that panel from Processing to Analysis, because I created a new instance of that list
though I'm not sure if that's the way to go either, because the events of that list are unique to Processing :\
those two lists on the left are the same, just different instances
I'm starting to regret that :P
I see, there's no way to patch the same instance to both?
unless they know where they are being used... Perhaps I could let it pick up which ribbon tab is active and sent out a different flavored message. I could just add processing and analysis behind their pub.sendMessage, so they wouldn't conflict. They would need to know when to sent what though
hmmm, I would need to create the instance at an earlier point and just add it to the panels when I can actually use it I reckon
on small problem might be, if you create an instance of a panel you need to add it to a sizer, else wx is going to put it somewhere
ah well, I'll just try it :P
11:03
lol, oh well
11:26
I tried sharing the instance, but that didn't work out well
though if I can make it check for when it should perform what tasks, that might help
it would trigger the function, but not actually do anything
though I'm probably making the mistake that my View isn't a pure View, but also some form of Controller :\
11:51
@IvoFlipse It shouldn't if you use proper variable names and extract methods when the depth becomes too much.
actually looking closer at the code, the only thing it does is getting triggered when there are measurements, which isn't wrong behavior
I think I just need to change the events that get triggered after that
now select measurement trigger loading data into a panel, that should come from if ribbonpage[1] = active ==> load data
that would make things easier
also there's little harm in just looking up the measurement names, it gets worse when things get loaded
 
4 hours later…
15:38
@DMA57361 look progress! :)
not that I can say this is really 'clear', but meeh it works :P
indeed
how robust did you make the calculations in the end?
I'm not sure if I did it in an intelligent way though
I think they are pretty robust :P
the 'issues' began when I had stuff my results in dictionaries and then needed an average of over different dimensions
blegh, that really sucks
what does?
and when I had those, I had to take it apart AGAIN, because my View required them in a different format
ah, oh dear
15:41
my data is stored as 'temporalspatialid', 'contactid', 'compcontactid', 'diffx', 'diffy', 'diffz'
so first I get them from the database and sort them so I bundle them per sideid (which as you see isn't in this information :P)
then I need to sort them again, so I can calculate the average distance between contacts, so all LF-LFs and LF-LHs need to be in a list or something
when I've looped through all the data, I can finally calculate an average
I see
then I had a dictionary with 3 dictionaries (diffx, diffy, diffz) that each have 4 keys (the 4 sideids)
next time, I think it would be easier to just have the controller sent a message to my view: look pal, I have an average value here, its from the LF paw, distance to LH and its the x distance
instead of having to decrypt my own objects :P
on the bright side, those four panels, with 4 listctrls are now in dictionaries, so instead of duplicating everything, its a little more generic :P
oh boy, the values are editable, guess I need to prevent that
and it seems the orientation is incorrect, it adds the values as they come, which means its putting LF-RF in 3rd place. The GridSizer therefore puts it in the bottom left (it goes left to right, top to bottom)...
And now I'm wondering whether I should calculate the diagonal distance. Because the step length is 'shorter' when the dog is walking at an angle :\
16:34
and I just realised I completely forgot to include the standard deviations
16:53
why on earth those Python print ± as ± :S
ermm.... unicode fail?
pretty much :\
0
Q: how to correct the misencoded string?

Dyno Fui used mutagen to read the mp3 metadata, since the id3 tag is read in as unicode but in fact it is GBK encoded. how to correct this in python? audio = EasyID3(name) title = audio["title"][0] print title print repr(title) produces µ±Äã¹Âµ¥Äã»áÏëÆðË­ u'\xb5\xb1\xc4\xe3\xb9\xc2\xb5\xa5\xc4\xe3\...

f/e, encoding time
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u5364' in position 0: character maps to <undefined>
The windows-1252 encoding used by Spyder lacks the characters Ω☠√☃♥.
it's a Spyder issue apparently :S
17:08
ah, can you not change the encoding?
I honestly don't know :P
I see
is this the encoding of the source file?
maybe try popping the source file open in NP++ and switching it to UTF8 using the "encode" menu :)
well the source file is just my script
I want to type something like 64 ± 15
yeah, but if the IDE can't encode the ± character correctly in the source file what hope does the Python interp have of reading it correctly?
no idea :P
so should I put in the unicode thing there and display that?
because then its not encoded the wrong way
17:14
I'd be inclined to use the encode function however it has to be used (?) to get the character done right
I tried the encoding
and no luck?
riiiiiiiiiight for some reason the A in front of it was because it was decoded the wrong way or something
because it did display +-
\xb1 was the part for just the +-
and now that works
ok, so it's working?
17:19
step length: 10.0±42.0 ...? (top-left LF-RH) that's quite some deviation to have -32 in there :/
I think that is one of those issues I was talking about :P
I don't know why, but for some reason that just happened to be the first one I looked at :)
I'll check the raw data to see where its going wrong
hehe, it does seem the only odd value
I have a feeling its actually correct :S
though its odd to have one outlier
[74.0, -15.0, -17.0, -10.0, 76.0, -16.0, -19.0]
yeah that's a bit odd indeed
[1L, 3L, 2L, 1L, 4L, 3L, 2L, 1L, 4L, 3L, 2L] + [1L, 4L, 3L, 2L, 4L, 3L, 2L, 4L] + [1L, 3L, 2L, 1L, 4L, 3L, 2L, 1L, 4L]
that's the patterns of the sideids in which the paws landed on the plate
so there are 2 1's before the first 4
so I should invalidate that one
crap I made it skip that first value, because else it started calculating the distance from 1 till the first 1 (itself!)
I could take that out and make it check that if the side == itself, that value needs to be 2
before crapping out
or rather, it should crap out as soon as it becomes 2
I also think I may have made a mistake or something in annotating the paws in the second measurement :S there's not 2nd LF
Hmmm it seems the insert of those contacts failed somewhere
For some reason, I doesn't update the measurementid, which is probably related to my 'solution' to the selection problem I mentioned earlier
hoeray for tracking down weird bugs :\
18:00
indeed, but it's better than not finding them in the first place :)
18:15
indeed
I found the 'bug'
I had this 'unique' requirement, which wasn't very unique :P
I used the measurementid and frame at which they started, because my if I added the row as well, it was too long
what was too long?
hmmm odd, the last time I tried this, it crapped out on me now it works
:/ magically disappearing bugs are the worst
anyway - time for dinner - will probably ttyl
have a nice meal :)
now its measurementid_contactstartframe_contactstartrow_contactstartcol
much more unique :P
18:42
ah, that's what you mean by too long, I see lol
anyway, I've an impromptu trip to the pub, so I'll talk to you tomorrow, probably
18:57
luckily I know have @TomWijsman to complain against :P
 
3 hours later…
21:55
@DMA57361 that should have solved it I think
22:13
@IvoFlipse Well, my browser is open most of the day, so you can always complain... :)
hehe, well I think I fixed my problem, finally
my loop wasn't exiting properly, so I put it in a function
Btw any thoughts on how I should layout my results?
I think it looks fine, if you mean by that screenshot.
Probably but them in boxes (<fieldset> in HTML, dunno how they call it in GUIs) but other than that it should be fine.
yeah haven't done any effort for the layout
22:17
Oh I see, looks more detailed.
Normally the values are laid over a measurement, but these are the averages over 3 measurements and about 10 contacts per measurement
so if I pick one, its not really represenative
and since glumpy doesn't work with wxpython :( I can't let it roll off infinitely through all measurements
technically the information I have in there is about as detailed as you can get, I've compared each paw with all the others (and its next own instance) in both x, y and time.
Sounds like you need a wrapper or something in between them to make it work.
@IvoFlipse that's lookin real nice @IvoFlipse
stupid double uploads :(
@TomWijsman wrapper around glumpy?
Ah, gl, OpenGL.
Hmm, can't you show OpenGL inside WxPython?
Just need to create some object that serves as a Device Context (DC) or something for Glumpy I think.
Yeah the part I didn't understand :\
My thought would be, just run glumpy in some window, then figure out how to embed such a top level window
Well, you can strip the whole window creating and pass along your DC (or how it's exactly called) as the thing to draw to instead of the window.
So most of window.py would be empty expect for the function that returns the device context.
22:24
2
A: How can I speed up an animation?

Ivo FlipseI found Joe Kington's answer that mentioned using Glumpy instead. At first I couldn't get it to work on my own data, but with some help on chat we managed to figure out how to adapt one of the Matplotlib examples that come with Glumpy to work on my data. import numpy, glumpy from glumpy.pylab im...

That's my code for displaying the thing
Perhaps we should put it in a question, so you can answer it for me ;)
Can't you skip glumpy/glut altogether?
how? because I have zero understanding of opengl
Hmm
I think it would be sufficient to disable the window from appearing (or hide it off screen, whatever) and then adjust window.draw() to draw to your place instead.
I'd be willing to learn more about it, but in that case it will have to wait some time
But I'm still searching how.
def draw(self):
        glut.glutPostRedisplay()
22:31
As for that image I linked, they just used fancier names: step length is LF-RF, cycle is LF-LF, the time parts idem dito
That doesn't do much... :(
Seems it's all indeed in glut, so you have the option to either not use it or be happy with a window popping up.
> One solution would be to use pyglet (see users forum where someone just posted a solution on how to use pyglet and wx together) and translate window.py into pyglet code. Since glumpy window .py has been largely copied from pyglet window api, it should be quite straightforward (but I do not have much time right now to write the code).
I've looked through glumpy's window.py but I didn't understand which parts needed translation :S
Because that would be changing a single line in the init of window.py.
But it depends on how the sub window thing functions...
I've looked through glut, there is not really a way to specify context.
@IvoFlipse: Perhaps it might be interesting to look into this:
There you see three randomly generated updating numpy arrays displayed in the same window. :)
wxgl, that sounds good :P
Dunno what wxgl is, but I looked up pyglet numpy for the above.
It seems double buffered if I look at the example code because it does a swap() and thus it should be fairly fast without glitches.
22:46
I'm running an example, though the data is rather boring :P
btw was this the software being used to track flies?
> ctrax - the Caltech Multiple Fly Tracke
ah yes, I spotted this before, just didn't know how it worked
Sounds like a nice library...
just need to see how hard it is for it to display the arrays
aii = ArrayInterfaceImage(arr) where arr is an array, that looks simple enough :P
i=0
    while not w.has_exit:
        w.dispatch_events()

        background.blit_tiled(0, 0, 0, w.width, w.height)
        img.blit(0, 0, 0)
        w.flip()

        if filename is None and 1:
            # modify numpy array in-place

            arr.fill(i)
            aii.dirty() # dirty the ArrayInterfaceImage because the data changed
            i=(i+1)%256

            if i == 1 and 0:
                arr = numpy.ones_like( arr ) # create a new array
                aii.view_new_array(arr) # switch ArrayInterfaceImage to view the new array
numpy.ones_like, hmm this basically copies the shape of another array?
that's good to know :)
either the arr.fill or the arr = numpy must be edited, unsure but it should work for you
hmm, I guess the other stuff is documented so if you know what the aii does you should be able to read the example
yeah I'm going to check the documentation
I still want to work with 3D scanners and given that Blender shows Python can be awesome for 3D stuff
23:22
hmm @TomWijsman the documentation is kind of vague :\
and they point me to pyglet :P
I also can't really tell what I can/should use wxglvideo or that pygarray
Try creating small prototypes.

« first day (222 days earlier)      last day (2179 days later) »