Friday, 2014-06-27

*** mlncn has quit IRC00:41
*** bkuhn has quit IRC03:09
*** nesciens has quit IRC03:50
*** mlncn has joined #npoacct04:35
*** tgnit has joined #npoacct04:48
*** tgnit has quit IRC05:18
*** tgnitidle has joined #npoacct05:18
*** tgnitidle has quit IRC05:27
*** tgnit has joined #npoacct05:29
*** tgnit has quit IRC11:56
*** tgnit has joined #npoacct12:32
*** bkuhn has joined #npoacct12:37
*** mlncn has quit IRC13:23
*** mlncn has joined #npoacct14:15
*** bkuhn is now known as bkuhnIdle14:22
*** bkuhnIdle is now known as bkuhn15:14
bkuhntgnit: tbm and I are taking a look at your new code now. :)15:24
tgnitbkuhn: thanks15:24
tgnitbkuhn: please don't mind the formatting,  i will clean up later15:25
bkuhn:)15:26
bkuhntgnit: what does has_commodity() method do?15:27
bkuhnI mean, when does it return true?15:27
bkuhn(I am just wondering when an amount *doesn't* have a commodity in ledger)15:27
tgnitif does not have a null commodity ie no commodity attached to it15:27
bkuhntgnit: That probably almost never happens, right?15:27
bkuhnIf I say $N, or X EUR, etc.15:28
bkuhnit's always going to have a commodity.15:28
* bkuhn didn't even know it was valid to put things into ledger without a commodity attached. ;)15:28
tbmyou can say 100 but johnw says this is a bad idea15:28
bkuhnWhat do you know, you can!15:28
tgnitbkuhn: just to be on safe side :)15:29
* bkuhn tried it.15:29
bkuhntgnit: nope, you're right , absoultely.15:29
bkuhnI was just surprised it was valid.15:29
bkuhnBut I just tried it.15:29
bkuhnNow that I think about it, I think I've had errors before where I missed a $ and it was confusing. :)15:29
tgnitbkuhn : it happens15:31
tgnitthere are several other places which we may have to such code,  but this one works for our case.15:33
tbmtgnit: I haven't tested your patch yet.  but I looked at the last one.  So does this do rounding?16:13
tbmtgnit: does it work?16:13
tbmtgnit: are you sure this is the right location to do the rounding?  (just asking... I don't know... you've done the debugging ;)16:13
*** nesciens has joined #npoacct16:15
tgniti feel it is the place for the type of transaction we are looking16:17
tbmok, good16:17
tgnittbm: there are several other cases too, so need to add at different places16:18
tbmso if your patch is working, can you commit a test case to the test suite16:18
tgnittbm: i added some results to npo  you can look at the order in debug16:20
tgnityes I can16:20
tgnitdon't i need to cleanup first?  those debug statements16:21
tbmwell, if you want to submit upstream, you have to clean up the code.  But you can add a test case now16:22
tbmthe debug statements and the test case are unrelated16:22
tgnitya not upstream right now,  i can add it to my fork16:23
tgnitwon't the test case fail without the patch in the upstream?  they build regularly16:24
tbmsorry if I wasn't clear.  I meant: can you add a test case to _your_ repo16:25
tbmnot upstram16:25
tgnitok i do it right away16:33
tgnittbm: added some tests,  working fine16:52
tgnittbm: the test you presented,  i have seen such case.16:53
tgnitthere are other place where we need to round16:54
tgnitledger call several function dynamically depending on cases.16:54
bkuhntgnit: You may want to start keeping separate branches for various things.17:06
bkuhnFor example, you could keep the DEBUG statements in a branch -- as I mentioned in my comment, those are upstreamable.17:06
bkuhnand then you can just rebase your other changes on top of them regularly.17:06
tgnittoday i was just thinking of that  :)17:06
bkuhnI suspect right now you want at least two branches:17:06
bkuhnOne to add DEBUG stateemnts17:06
bkuhnOne to work on this specific feature.17:07
tgnityes17:07
bkuhnand the one the feature will regularly rebase.17:07
bkuhnbut when you want to add a DEBUG statement, switch branches, add it, then come back to your feature branch and rebase17:07
bkuhnIf you do this as rote procedure, the rebasing should be clean.17:07
tgniti will do it right away.17:08
bkuhntgnit: I'd suggest right now (or maybe tomorrow, if it's getting late there), maybe taking a step back, starting with a clean fork, and cherry-picking out your changes.17:08
bkuhnas you do that, you can fix the code formatting issues tbm raised, and start adding tests.17:08
bkuhnetc.17:08
tgnitok17:08
tgnitoki17:08
bkuhnAnd I agree with tbm:17:09
bkuhnIt's good to get started with test cases.17:09
bkuhnadd them, and show them to be failing.17:09
bkuhnthen, write the feature.17:09
bkuhnIt's basically TDD, which I think is useful here.17:09
bkuhnYou could start with tbm's test case.17:10
bkuhnAdd it to ledger's existing test suite.17:10
bkuhnIn a way that it fails.17:10
bkuhnbut would pass as a test if the feature is implemented properly.17:10
tgnitbkuhn: the test case tbm suggested i have seen something similar.  there are several places rounding can take place17:10
bkuhnthat will give you a target.17:10
tgnit17:10
bkuhntgnit: I understand.17:10
bkuhnSo each thing your feature fixes, you should have a test case.17:10
tgnitbkuhn: just read.  got you too17:10
bkuhnAs it stands, when I look at what you've done so far, it's not clear which type of test case your solution so far solves.17:11
bkuhnI get your point that for 'precision' directive to work fully, you'll need to round in more places.17:11
bkuhnBut there must be a "reason" that you felt the place you added the round work:17:11
bkuhnWhat I'd like to see in the git log is:17:11
bkuhn  * Adding of a test case.  If you check out that revision, and run tests, the test case fails.17:12
bkuhn   * Adding of the feature.17:12
tgnityes, i understand.  i think  we should discuss on the irc and mailing list for other test cases meanwhile i should pick old tests from baseline to work according to precision17:12
bkuhn       * the test case passes17:12
bkuhntgnit: You could redo this work even with the precision directive as a way to get used to the procedure:17:12
bkuhnstart a fresh branch.17:12
bkuhnAdd a test case that has a precision directive in it.17:12
tgnitok17:13
bkuhnThe test will fail, because no directive exists.17:13
bkuhnverify that test fails.17:13
bkuhnAdd your first commit that just makes the directive.17:13
bkuhnThen, commit that, and see that the test now passes.17:13
bkuhnand you can modify that same test case as you add the next part of the feature.17:13
bkuhnso the initial test case probably is just on eline17:13
bkuhn"precision 2"17:13
bkuhnwhich fails by itself, because it's invalid  directive.17:13
bkuhnthen you bring in your commit that adds the precision directive17:14
bkuhnand then the test passes.17:14
bkuhnthen modify the test again to add something that your current change solves with regard to precision.17:14
bkuhnit should fail, because you haven't added the code17:14
bkuhnthen bring in the code.17:14
bkuhntgnit: does that procedure make sense?17:14
tgnityes test driven development?17:15
bkuhnBasically, yes.17:15
bkuhnIt's not pure TDD.17:15
bkuhnTDD has a lot of stuff to it.17:15
bkuhnBut this one procedure, which is taken from TDD, makes it much easier to do patch review.17:15
bkuhnBecause you can see what the patch feature wants to do by looking at the tests.17:15
bkuhnI don't really go into programming fads (TDD, Extreme, pair programming, etc.)... but most of them have something to them that's useful.17:15
tgnityes,  i got it.17:16
bkuhnthe TDD stuff is useful in that it focuses the work and makes the commit history clear as to what's trying to be done.17:16
bkuhnwhich is why I suggest it to you here.17:16
bkuhnSo, go for that, and see how it goes.17:16
bkuhnNo need to try to get it done today, I know it's getting late there.17:16
bkuhnBut make that your top priority to reorganize the work so far in that way, and let me and tbm know when you have a result.17:16
tgnitbkuhn:  sorry to mess things up.  they should  become clear from now on.17:16
tgnitabsolutely17:17
bkuhntgnit: nothing is messed up; you're learning, that's the point of this. :)17:17
tgnit;)17:17
*** mlncn has quit IRC17:37
*** mlncn has joined #npoacct17:49
*** mlncn has quit IRC18:05
*** mlncn has joined #npoacct18:33
*** mlncn has quit IRC18:42
*** mlncn has joined #npoacct18:43
*** mlncn has quit IRC19:30
*** mlncn has joined #npoacct20:16
*** bkuhn is now known as bkuhnIdle20:30
*** bkuhnIdle is now known as bkuhn21:42
*** jelmer has quit IRC21:43
*** jelmer has joined #npoacct21:43
*** mlncn has quit IRC22:44
*** jelmer_ has joined #npoacct22:48
*** jelmer has quit IRC22:52
*** mlncn has joined #npoacct23:07
*** mlncn has quit IRC23:29

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