Wednesday, 2014-07-16

*** bkuhn is now known as bkuhnIdle01:23
*** mlncn has joined #npoacct01:51
*** mlncn has quit IRC02:10
*** mlncn has joined #npoacct02:26
*** nesciens has quit IRC03:49
*** bkuhnIdle has quit IRC03:49
*** mlncn-agaric has joined #npoacct05:03
*** mlncn has quit IRC05:04
*** mlncn-agaric has quit IRC07:28
*** mlncn-agaric has joined #npoacct07:29
*** nesciens has joined #npoacct10:45
*** mlncn-agaric has quit IRC12:12
*** mlncn-agaric has joined #npoacct13:01
*** bkuhn has joined #npoacct13:13
*** nesciens has quit IRC13:39
*** benjamin-agaric has joined #npoacct13:41
*** mlncn-agaric has quit IRC13:41
tgnittbm: help!16:05
bkuhntgnit: what's wrong?16:05
tgnitledger mischievously take advantage of not rounding anything.  as discussed i was looking to solve error in the balance but after tracking a lot i found after exchange calc of commodity in one form, it does not distinguish between various quantities based on original commodity. i will clear it with example16:08
*** tgnitt has joined #npoacct16:11
bkuhnOk, I think I roughly understand what you're saying, but an example would indeed be helpful.16:12
bkuhnBut I am not surprised, johnw is one of the most mischievous programmers I know. :)16:12
tgnittcommodity GBP    precision 2    format 1000.000 GBP  2010-01-01 Opening balance     Assets:Pension                 200.20 AAA @@  200.20 GBP     Assets:Cash    2010-01-10 * Buy XXX     Assets:Pension                 342.2904 XXX @@  820.72 GBP     Assets:Cash    2014-01-02 Opening balance     Assets:Pension                 100.10 AAA @@  100.10 GBP     Assets:Cash      P 2011/01/01 XXX 2.7316 GBP16:13
tgnittSorry , check http://pastebin.com/m0LcAuub16:15
tgnittbkuhn: ledger adds to the balance in the order of the postings and not based on commodities .16:17
tgnittI think what tbm wanted was rounding accumulative balance per commodity calculated in terms of primary commodity .16:18
tbmI'm not sure I understand./ Oh, yo mean in terms of GBP, so -X GBP?16:19
tbmhm, that's somethnig I hadn't considered16:19
bkuhnSorry I'm being dense, I'm not sure I understand16:20
bkuhnI'm looking at the example16:20
tgnittSo in the above example for AAA  200.2 +100.1 =300.3 GBP  should be rounded separately and for XXX  820.72 rounded separately and then added to balance.16:20
tbmright16:21
tgnitttbm:but ledger will simply calculate market price in order of postings and add to the balance.16:22
bkuhnOh, yes, indeed, it will.  I've seen odd bugs related to this at times.16:23
tgnittso if I want to add based on commodity I will need to sort befor the values are added to the balance.16:23
tbmyes, but you said this several days ago16:23
tbmare there new insights?16:23
tgnittbkuhn: is it a problem to do this in order or not to do this based on postings ?16:23
tgnitttbm: I earlier thought it was due to prices being stored after rounding but solving that problem did not help. I was also debugging if  there could be other places to round which could help but this is the obstacle.16:25
bkuhntgnitt: I think tbm's original idea about rounding based on commodity made sense.16:25
tbmah16:25
tbmbtw, I don't think the example on pastebin is very good because there's no rounding that I can see16:25
tbmI think this is a discussion for the ledger mailing list16:26
tgnitttbm:  ya ,right but this was just to show the problem in focus and not wiith the result.  I can edit for better explanation though .16:27
bkuhntbm: (re no rounding) yeah, I was confused by that as well.  I still don't see where the problem shows up in existing ledger and how our patch would fix it.16:27
bkuhntgnitt: Yeah, if you want my comment, I think I need that.  Again, sorry I'm being dense, but I'm not 100% clear on what the difficulty is here... I agree with tbm's original suggestions, and I'm not 100% clear if what you're saying.16:28
bkuhnI suspect that you're  saying "what tbm suggested still is the right approach, but it's harder than any of us thought to implement in ledger."16:29
bkuhnbut I don't know how the example you gave relates to that point if it's suppose to show that point. :)16:29
tgnittbkuhn: There is a default sorting based on posts and it is sorted again before evaluating value of the balance but  I noted that it is a generic sorter function so you can actually pass a comparator to it as an argument . May be writing a comparator based on commodity will help16:29
tgnittbkuhn: just a min ,  I give another example, I understood what tbm idea is and  it is about the difficulty regarding that .16:30
bkuhntgnitt: I understand that part now.  However, I suspect that many semantics of ledger rely on the sort being the order in which it currently does.16:30
bkuhn... and if you change it, tests will fail, behavior will be unexpected, etc.16:30
tgnitttbm: check http://pastebin.com/Zr2kZFnr if this is better ?16:35
tgnittbkuhn:  I understood, will check if there is a work around. but I feel I should start focussing on the tests till this is solved.16:36
bkuhntgnitt: I'm not so sure.  This is not something we can "solve" for you.16:50
bkuhnyou're going to need to propose a way that implements the feature.16:50
bkuhn... and doesn't break anything16:50
bkuhnIt may be much harder than we thought.16:50
bkuhnBut I don't think you should give up an wait.16:50
bkuhnHowever, tgnitt, having said all that:16:50
bkuhnif the complexities here are annoying you and you need a break to work on something else, working on some of the test TODOs we discussed yesterday is indeed  a great way to clear your head and get something useful done while doing it!16:51
tgnittbkuhn: got you, well I don't expect to be solved by others but views will be helpful. Also wanted to confirm I am headed the right way and understood the problem correctly . :)16:54
tgnittbkuhn: yup, exhausted right now . I will take up tests for time being. problem is more time is spending reading the code and debugging where I look for the code flow or any small but helpful function I would have missed .16:56
tgnittbkuhn: thanks for the motivation :)16:56
*** benjamin-agaric is now known as mlncn17:03
bkuhntgnitt: johnw answered a few things I said on IRC yesterday.  I'd suggest tomorrow pinging him.17:07
bkuhnYou may also want to post the problem to the ledger mailing list: explain what you're trying to do, what you encountered in the code, and talk about the sort-thing17:07
tgnittbkuhn: ok, i do it now17:12
bkuhn(I have to  offline for a few hours)17:12
*** bkuhn has quit IRC17:12
*** tgnitt has quit IRC17:28
*** nesciens has joined #npoacct17:46
*** mlncn-agaric has joined #npoacct18:00
*** mlncn has quit IRC18:00
*** benjamin-agaric has joined #npoacct18:04
*** mlncn-agaric has quit IRC18:04
*** bkuhn has joined #npoacct18:38
*** benjamin-agaric is now known as mlncn19:16
*** bkuhn is now known as bkuhnIdle19:32
*** bkuhnIdle is now known as bkuhn20:04
*** mlncn has quit IRC21:03
*** mlncn has joined #npoacct21:45

Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!