Commit Graph

11 Commits

Author SHA1 Message Date
Simon Michael
46bbc9e0aa fix simple aliases that match the whole account name 2015-05-28 10:40:48 -07:00
Simon Michael
7f6cf1f849 balance, register, register-csv: depth 0 shows summary items (#206)
Previously, a depth:0 query produced an empty report (since there are no
level zero accounts). Now, it aggregates all data into one summary item
with account name "...".

This makes it easier to see the kind of data Gwern was looking for from
register-csv (net worth over time). Eg this shows one line per month
summarising the total of assets and liabilities:

hledger register-csv -- -MHE ^assets ^liabilities depth:0

Single and multi-column balance reports behave similarly.
2014-10-19 17:53:20 -07:00
gwern
d1618aaca8 strip trailing whitespace from all Haskell files 2014-10-14 18:48:24 -07:00
Simon Michael
00f22819ae balance report speedup
This refactoring fixes an O(n^2) slowdown in the balance command with
large numbers of accounts. It's now speedy, and the implementation is
clearer. To facilitate this, the Account type now represents a tree of
accounts which can easily be traversed up or down (and/or flattened
into a list).

Benchmark on a 2010 macbook:

    +-------------------------------------------++--------------+------------+--------+
    |                                           || before:      | after:     |        |
    |                                           || hledger-0.18 | hledgeropt | ledger |
    +===========================================++==============+============+========+
    | -f data/100x100x10.journal     balance    ||         0.21 |       0.07 |   0.09 |
    | -f data/1000x1000x10.journal   balance    ||        10.13 |       0.47 |   0.62 |
    | -f data/1000x10000x10.journal  balance    ||        40.67 |       0.67 |   1.01 |
    | -f data/10000x1000x10.journal  balance    ||        15.01 |       3.22 |   2.36 |
    | -f data/10000x1000x10.journal  balance aa ||         4.77 |       4.40 |   2.33 |
    +-------------------------------------------++--------------+------------+--------+
2012-10-21 17:18:18 +00:00
Simon Michael
9b3486c14c docs: fix incorrect haddock 2012-04-14 01:11:11 +00:00
Simon Michael
96aa9bfc76 matcher improvements, tests 2011-06-11 18:35:20 +00:00
Simon Michael
5084280879 imports, api cleanup 2011-05-28 04:11:44 +00:00
Simon Michael
dd9e78a67a reorganize tests 2010-12-27 20:26:22 +00:00
Simon Michael
73572e2d85 balance: with --flat, --drop N elides leading account name components. Feature or frill ? 2010-05-24 20:45:48 +00:00
Simon Michael
856f1f965a docs: hledger-lib module haddock updates 2010-05-27 03:58:47 +00:00
Simon Michael
7d4593cee9 move Ledger.* to Hledger.Data.* 2010-05-19 23:08:53 +00:00