*** bkuhn is now known as bkuhnIdle | 01:23 | |
*** mlncn has joined #npoacct | 01:51 | |
*** mlncn has quit IRC | 02:10 | |
*** mlncn has joined #npoacct | 02:26 | |
*** nesciens has quit IRC | 03:49 | |
*** bkuhnIdle has quit IRC | 03:49 | |
*** mlncn-agaric has joined #npoacct | 05:03 | |
*** mlncn has quit IRC | 05:04 | |
*** mlncn-agaric has quit IRC | 07:28 | |
*** mlncn-agaric has joined #npoacct | 07:29 | |
*** nesciens has joined #npoacct | 10:45 | |
*** mlncn-agaric has quit IRC | 12:12 | |
*** mlncn-agaric has joined #npoacct | 13:01 | |
*** bkuhn has joined #npoacct | 13:13 | |
*** nesciens has quit IRC | 13:39 | |
*** benjamin-agaric has joined #npoacct | 13:41 | |
*** mlncn-agaric has quit IRC | 13:41 | |
tgnit | tbm: help! | 16:05 |
---|---|---|
bkuhn | tgnit: what's wrong? | 16:05 |
tgnit | ledger 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 example | 16:08 |
*** tgnitt has joined #npoacct | 16:11 | |
bkuhn | Ok, I think I roughly understand what you're saying, but an example would indeed be helpful. | 16:12 |
bkuhn | But I am not surprised, johnw is one of the most mischievous programmers I know. :) | 16:12 |
tgnitt | commodity 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 GBP | 16:13 |
tgnitt | Sorry , check http://pastebin.com/m0LcAuub | 16:15 |
tgnitt | bkuhn: ledger adds to the balance in the order of the postings and not based on commodities . | 16:17 |
tgnitt | I think what tbm wanted was rounding accumulative balance per commodity calculated in terms of primary commodity . | 16:18 |
tbm | I'm not sure I understand./ Oh, yo mean in terms of GBP, so -X GBP? | 16:19 |
tbm | hm, that's somethnig I hadn't considered | 16:19 |
bkuhn | Sorry I'm being dense, I'm not sure I understand | 16:20 |
bkuhn | I'm looking at the example | 16:20 |
tgnitt | So 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 |
tbm | right | 16:21 |
tgnitt | tbm:but ledger will simply calculate market price in order of postings and add to the balance. | 16:22 |
bkuhn | Oh, yes, indeed, it will. I've seen odd bugs related to this at times. | 16:23 |
tgnitt | so if I want to add based on commodity I will need to sort befor the values are added to the balance. | 16:23 |
tbm | yes, but you said this several days ago | 16:23 |
tbm | are there new insights? | 16:23 |
tgnitt | bkuhn: is it a problem to do this in order or not to do this based on postings ? | 16:23 |
tgnitt | tbm: 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 |
bkuhn | tgnitt: I think tbm's original idea about rounding based on commodity made sense. | 16:25 |
tbm | ah | 16:25 |
tbm | btw, I don't think the example on pastebin is very good because there's no rounding that I can see | 16:25 |
tbm | I think this is a discussion for the ledger mailing list | 16:26 |
tgnitt | tbm: 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 |
bkuhn | tbm: (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 |
bkuhn | tgnitt: 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 |
bkuhn | I 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 |
bkuhn | but I don't know how the example you gave relates to that point if it's suppose to show that point. :) | 16:29 |
tgnitt | bkuhn: 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 help | 16:29 |
tgnitt | bkuhn: just a min , I give another example, I understood what tbm idea is and it is about the difficulty regarding that . | 16:30 |
bkuhn | tgnitt: 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 |
tgnitt | tbm: check http://pastebin.com/Zr2kZFnr if this is better ? | 16:35 |
tgnitt | bkuhn: 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 |
bkuhn | tgnitt: I'm not so sure. This is not something we can "solve" for you. | 16:50 |
bkuhn | you're going to need to propose a way that implements the feature. | 16:50 |
bkuhn | ... and doesn't break anything | 16:50 |
bkuhn | It may be much harder than we thought. | 16:50 |
bkuhn | But I don't think you should give up an wait. | 16:50 |
bkuhn | However, tgnitt, having said all that: | 16:50 |
bkuhn | if 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 |
tgnitt | bkuhn: 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 |
tgnitt | bkuhn: 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 |
tgnitt | bkuhn: thanks for the motivation :) | 16:56 |
*** benjamin-agaric is now known as mlncn | 17:03 | |
bkuhn | tgnitt: johnw answered a few things I said on IRC yesterday. I'd suggest tomorrow pinging him. | 17:07 |
bkuhn | You 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-thing | 17:07 |
tgnitt | bkuhn: ok, i do it now | 17:12 |
bkuhn | (I have to offline for a few hours) | 17:12 |
*** bkuhn has quit IRC | 17:12 | |
*** tgnitt has quit IRC | 17:28 | |
*** nesciens has joined #npoacct | 17:46 | |
*** mlncn-agaric has joined #npoacct | 18:00 | |
*** mlncn has quit IRC | 18:00 | |
*** benjamin-agaric has joined #npoacct | 18:04 | |
*** mlncn-agaric has quit IRC | 18:04 | |
*** bkuhn has joined #npoacct | 18:38 | |
*** benjamin-agaric is now known as mlncn | 19:16 | |
*** bkuhn is now known as bkuhnIdle | 19:32 | |
*** bkuhnIdle is now known as bkuhn | 20:04 | |
*** mlncn has quit IRC | 21:03 | |
*** mlncn has joined #npoacct | 21:45 |
Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!