beancount / beangrow

Returns calculations on portfolios in Beancount
GNU General Public License v2.0
57 stars 21 forks source link

Returns: add new option to make verification easier: --configured-accounts-only #2

Open redstreet opened 3 years ago

redstreet commented 3 years ago

From this doc: After building a basic config file and perhaps making a few simple changes to your ledger, compute_returns.py spits out numbers. How can the correctness of these numbers be verified?

Something that has been tripping me up a lot: an underspecified config. For example:

investment {
  currency "ABCD"
  asset_account: "Assets:Investments:ABCD"
  cash_accounts: "Assets:BankOrange"
  dividend_accounts: "Income:Diidends:ABCD"   ; <-- spelling error causes silent underspecification, and incorrect results
  dividend_accounts: "Income:Interest:ABCD"   ; <-- If I forget to include this line, postings with it are silently ignored
}

The problem is, these are all silent failures unless one examines investments/*.org in the output, of which I have tons, too many to manually inspect.

A --configured-accounts-only would work only if all accounts found in all relevant postings are specified in the config. It could further list all the unspecified accounts. Even better, it could auto-generate a new config with them with a comment for the user to complete specifying them.

blais commented 3 years ago

Thanks for the bug reports Red. I have to review the returns code. Planning to move to its own repo under name "beangrow".

redstreet commented 3 years ago

Good idea, and I like the name!

I'll probably file more improvement requests/bugs as I find them if that's okay. I plan to work on patches for these when I can find the time.

I've got it up and running for most of my portfolio in the past couple of weeks, and it's been very helpful in providing insights that I've wanted for a long time. Thanks again for writing and sharing this!

gety9 commented 3 years ago

Great suggestion by redstreet on "--configured-accounts-only", and in my opinion and should be default setting. (to make function less error / misspelling prone)