State of average cost booking?

539 views
Skip to first unread message

redst...@gmail.com

unread,
Apr 18, 2016, 4:42:58 PM4/18/16
to Beancount
I was just wondering what the state of average cost booking is. I see the booking branch in bitbucket, but was trying to figure out if it is something that you'd like help developing or testing or anything else. Do let me know if this is the case. I'd love to see this work. 

Thanks!

yegle

unread,
Apr 18, 2016, 7:13:47 PM4/18/16
to Beancount
I'm also waiting for the feature to land in tip to improve my booking of 401k account.

The average cost booking could also be useful in other scenarios. For example, when you buy gift card in various discounted price, redeem it to an account, and use it later. One can manually recalculate cost-basis like this: http://pastie.org/private/fxtirb6nhojyqmhuop9dfq but it would be good to have beancount handle it for me.

On Mon, Apr 18, 2016 at 1:42 PM, <redst...@gmail.com> wrote:
I was just wondering what the state of average cost booking is. I see the booking branch in bitbucket, but was trying to figure out if it is something that you'd like help developing or testing or anything else. Do let me know if this is the case. I'd love to see this work. 

Thanks!

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/00800f21-7443-43d8-aaa3-9bd4201dfdbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Martin Blais

unread,
Apr 19, 2016, 12:10:32 AM4/19/16
to Beancount
On Mon, Apr 18, 2016 at 4:42 PM, <redst...@gmail.com> wrote:
I was just wondering what the state of average cost booking is. I see the booking branch in bitbucket, but was trying to figure out if it is something that you'd like help developing or testing or anything else. Do let me know if this is the case. I'd love to see this work. 

Hi redstreet0 & yegle,

I was talking about it with Filippo whom I'm was having drinks with tonight - he's a friend and now an enthusiastic user who's been asking questions on this list. He needs it too, to deal with various Canadian trading scenarios, apparently all Canadian accounts are to be treated at average cost. And I need it too myself. And I know mharris does as well. So that makes at least 5 of us. This is the sore point of Beancount so far.

Recently it was tax time and I had to produce records of wash sales. In order to do that, I had to figure out short-vs-long term lots on sales, and the carrying of the acquisition date for each sold lot is something that will also come with the new booking code. But because I needed this right away, I quickly created a kludge in the 'carry_cost_and_book_date' branch to the dates working for my report; it worked, and I'm not happy with that code--I won't merge it---but it got me to wrangle code in that area again.

To be honest this would the last bit of code I'd want a contribution for--it touches at the very heart of the balance update mechanism. It's not super hard, just a bit sensitive, because I have to change how the inventory update logic works and I have to write many unit tests for it, it'll be easy to break things. Filippo just compiled a list of many hairy use cases he's facing which I'll use as a set of additional test cases. 70% of the work is done and I just need to get back into it; I've been busy with a combination of taxes and traveling for work and other life things.

There are two things left for Beancount to be "complete" (in my mind): that booking branch, and writing a good intro doc. Right now I'm consolidating a bunch of TODO files that have grown in different places. After that I'll resume work on booking. Sorry for the time it's taking.



Nathan Grigg

unread,
Apr 19, 2016, 12:29:45 AM4/19/16
to bean...@googlegroups.com
On Apr 18, 2016, at 9:10 PM, Martin Blais <bl...@furius.ca> wrote:
> So that makes at least 5 of us.

Another vote from me. Thanks Martin!

Nathan

redst...@gmail.com

unread,
Apr 19, 2016, 9:08:51 AM4/19/16
to Beancount
Thanks, Martin! I understand contributions for this would be difficult. So instead, do let us know if we can help with early testing or anything else.

redst...@gmail.com

unread,
Apr 19, 2016, 9:12:04 AM4/19/16
to Beancount
On Monday, April 18, 2016 at 4:13:47 PM UTC-7, Yuchen Ying wrote:
The average cost booking could also be useful in other scenarios. For example, when you buy gift card in various discounted price, redeem it to an account, and use it later. One can manually recalculate cost-basis like this: http://pastie.org/private/fxtirb6nhojyqmhuop9dfq but it would be good to have beancount handle it for me.

This is exactly what I do as well, and had similarly thought it would be a great secondary use for average cost booking. It would be good to document this somewhere. Perhaps Martin would like it in one of his documents or at Simon's plain text accounting site/

Martin Blais

unread,
Apr 20, 2016, 12:05:15 AM4/20/16
to Beancount
 When I write the document on average cost basis, I'll add this example in. 

Dennis Megaffin

unread,
Jan 22, 2018, 1:15:10 PM1/22/18
to Beancount
Hi Martin,

I am a new beancount user. Just wondering if average cost booking is working yet?

Is the merge flag now working? {*}

Thanks for any and all update!

-Dennis M

P.S. Thanks for all your contributions!

Martin Blais

unread,
Jan 23, 2018, 9:58:22 PM1/23/18
to Beancount
Actually, it gets parsed, but it doesn't get used, as the general lot merging functionality should be common in AVERAGE booking and that's the one booking method not implemented.
I'll make it generate an error for now.

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Robert Sesek

unread,
Feb 2, 2018, 8:23:20 AM2/2/18
to bean...@googlegroups.com
Hi Martin,

Is there an issue that tracks the remaining work items for the average cost booking method (I searched and couldn't find one)? I see that there's at least a partial implementation of booking_method_AVERAGE, but I have to imagine it's incomplete since it is currently disabled.

Upthread you noted this is not an area you would want contributions for. But if there were ways to make incremental progress on average booking, I'd be interested in helping out.

Thanks,
Robert

On Tue, Jan 23, 2018 at 9:58 PM Martin Blais <bl...@furius.ca> wrote:
Actually, it gets parsed, but it doesn't get used, as the general lot merging functionality should be common in AVERAGE booking and that's the one booking method not implemented.
I'll make it generate an error for now.
On Mon, Jan 22, 2018 at 1:15 PM, Dennis Megaffin <dennism...@gmail.com> wrote:
Hi Martin,

I am a new beancount user. Just wondering if average cost booking is working yet?

Is the merge flag now working? {*}

Thanks for any and all update!

-Dennis M

P.S. Thanks for all your contributions!

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/SP5KeksHbCk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Martin Blais

unread,
Feb 6, 2018, 1:07:11 AM2/6/18
to Beancount
There's no ticket but it definitely merits one:

It's probably not super difficult to implement, but the problem is that I'm afraid there may be very many corner cases and it will probably require a ton of unit testing scenarios. Not something to hash out on just a quick Sunday afternoon.

Always open to contributions, but as always... a lot of us use that thing twice / week and we simply _cannot_ break it, so heavy coverage in unit testing - especially for stuff like this - is super important if you'd like to bring it to completion. There's little more frustrating to me than needing to update my Ledger and finding bugs (it immediately throws off the next couple of hours of my life into a fit of rather unhappy "unplanned" coding session). Often people make submissions without tests, and of course as soon as you write tests you realize there's always a /lot/ more to it than it seemed... like 10x more, so these inevitably go on the backburner.  Anyhow, just saying.  I've been very conservative about patches in order to avoid risking the stability of Beancount.  If you understand and you think you can replicate a simliar abundance of test scenarios as those which are in the codebase, you're welcome to take a shot at it, I'd look at it. OTOH a patch without any tests is almost guaranteed to sit there for a long time (it's very easy and quick to hack something that appears to work).



On Thu, Feb 1, 2018 at 9:21 PM, Robert Sesek <rse...@bluestatic.org> wrote:
Hi Martin,

Is there an issue that tracks the remaining work items for the average cost booking method (I searched and couldn't find one)? I see that there's at least a partial implementation of booking_method_AVERAGE, but I have to imagine it's incomplete since it is currently disabled.

Upthread you noted this is not an area you would want contributions for. But if there were ways to make incremental progress on average booking, I'd be interested in helping out.

Thanks,
Robert

On Tue, Jan 23, 2018 at 9:58 PM Martin Blais <bl...@furius.ca> wrote:
Actually, it gets parsed, but it doesn't get used, as the general lot merging functionality should be common in AVERAGE booking and that's the one booking method not implemented.
I'll make it generate an error for now.
On Mon, Jan 22, 2018 at 1:15 PM, Dennis Megaffin <dennism...@gmail.com> wrote:
Hi Martin,

I am a new beancount user. Just wondering if average cost booking is working yet?

Is the merge flag now working? {*}

Thanks for any and all update!

-Dennis M

P.S. Thanks for all your contributions!

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/SP5KeksHbCk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

markusteu...@gmail.com

unread,
Feb 6, 2018, 12:05:42 PM2/6/18
to Beancount
On the topic of tests and corner cases:

http://hypothesis.works is definitely work one or several looks, especially in this type of software that is mostly a fancy frontend and language for doing basic calculus operations.

I also agree that it is far too easy to get the "happy path" working and then throw others in a world of pain and debugging for their slightly off use case.
Reply all
Reply to author
Forward
0 new messages