pipe symbol deprecated

59 views
Skip to first unread message

Saša Janiška

unread,
Oct 10, 2016, 9:55:31 AM10/10/16
to bean...@googlegroups.com
Hello,

I’ve converted my Gnucash file to ledger and then used python script to
convert to Beancount format and bean-check is silent now and fixed all
the balances - there were several transcations rportin stuff like:

Transaction does not balance: (-1.96E-18 EUR)


but I did fix them all. :-)

The next step is to re-orgnize my Beancount file to take advantage of
org-mode/beancount modes, but wonder about announced deprecation of pipe
(’|’) symbol?

The online docs and sidebar comments speak about it and example
generator uses it as well.

Personally, I like it, but fo not want to introduce obsolete stuff in my
ledger/beancount file. Please, advise!

Btw, thanks a lot for Beancount!! In companion with Fava it is really a
great piece of software.


Sincerely,
Gour

--
A person who is not disturbed by the incessant flow of
desires — that enter like rivers into the ocean, which is
ever being filled but is always still — can alone achieve
peace, and not the man who strives to satisfy such desires.

Martin Blais

unread,
Oct 10, 2016, 9:46:13 PM10/10/16
to Beancount
On Mon, Oct 10, 2016 at 9:54 AM, Saša Janiška <go...@atmarama.com> wrote:
Hello,

I’ve converted my Gnucash file to ledger and then used python script to
convert to Beancount format and bean-check is silent now and fixed all
the balances - there were several transcations rportin stuff like:

Transaction does not balance: (-1.96E-18 EUR)

Could you share one example that would generate these errors?
I'm curious.


but I did fix them all. :-)

The next step is to re-orgnize my Beancount file to take advantage of
org-mode/beancount modes, but wonder about announced deprecation of pipe
(’|’) symbol?

The online docs and sidebar comments speak about it and example
generator uses it as well.

Personally, I like it, but fo not want to introduce obsolete stuff in my
ledger/beancount file. Please, advise!

It'll be removed eventually, along with other deprecated things (unimportant things, don't worry).
I'll do this all at once and send an announcement ahead of time.
I try hard not to make "breaking" changes often, and when I do I try to gate them behind a variable.
It's probably best not to use the pipe, but should you do it, it would be easy to remove them with a script later on.



Btw, thanks a lot for Beancount!! In companion with Fava it is really a
great piece of software.

Glad they're useful for you :-)



Sincerely,
Gour

--
A person who is not disturbed by the incessant flow of
desires — that enter like rivers into the ocean, which is
ever being filled but is always still — can alone achieve
peace, and not the man who strives to satisfy such desires.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/87twckjoly.fsf%40atmarama.com.
For more options, visit https://groups.google.com/d/optout.

Saša Janiška

unread,
Oct 11, 2016, 3:49:45 AM10/11/16
to bean...@googlegroups.com
Martin Blais <bl...@furius.ca> writes:

> Could you share one example that would generate these errors?
> I'm curious.


Practically, all the transactions in regard to money exchange between
EUR and HRK, e.g.

2013-01-21 * "money exchange"
Assets:Gotovina:HRK 3004 HRK @ 0.13315579227696404794 EUR
Assets:Gotovina:EUR -400 EUR

which generates: Transaction does not balance: (1.176E-17 EUR)

and solution was simple:

2013-01-21 * "money exchange"
Assets:Gotovina:HRK 3004 HRK
Assets:Gotovina:EUR -400 EUR @ 7.51 HRK

> I try hard not to make "breaking" changes often, and when I do I try
> to gate them behind a variable.
> It's probably best not to use the pipe, but should you do it, it
> would be easy to remove them with a script later on.

OK.

Sincerely,
Gour

--
He who is satisfied with gain which comes of its own accord, who
is free from duality and does not envy, who is steady in both
success and failure, is never entangled, although performing actions.

Martin Blais

unread,
Oct 11, 2016, 11:13:37 PM10/11/16
to Beancount
On Tue, Oct 11, 2016 at 3:48 AM, Saša Janiška <go...@atmarama.com> wrote:
Martin Blais <bl...@furius.ca> writes:

> Could you share one example that would generate these errors?
> I'm curious.


Practically, all the transactions in regard to money exchange between
EUR and HRK, e.g.

2013-01-21 * "money exchange"
  Assets:Gotovina:HRK                3004 HRK @ 0.13315579227696404794 EUR
  Assets:Gotovina:EUR                -400 EUR

which generates: Transaction does not balance: (1.176E-17 EUR)

and solution was simple:

2013-01-21 * "money exchange"
  Assets:Gotovina:HRK                3004 HRK
  Assets:Gotovina:EUR                -400 EUR @ 7.51 HRK

That's one way to solve it, but there's a better way.
Rounding it manually like this will be time-consuming, probably.

The problem here is that because you haven't used digits on "400", the tolerance for balancing EUR currencies in this transaction is 0, meaning it has to match perfectly. With such a rate this is virtually impossible.

Try making 400 -> 400.00 instead, and now the inferred tolerance will be 0.005 EUR, and it will work. I also don't suggest this method, because it will be manual - just putting it out there to illustrate how the tolerances are inferred from the digits that are presented in the file.

Now, a much better solution would be to tell Beancount what tolerance to use when none can be inferred, like here. You would do this once, at the top of your file, with this option:

option "inferred_tolerance_default" "EUR:0.005"


That should probably be enough.
You could do this for all the currencies you have which aren't using digits very often.

If you'd like to learn more about how tolerances are inferred automatically and how defaults are handled, you can read this document:

I hope this helps,

Saša Janiška

unread,
Oct 12, 2016, 3:09:50 AM10/12/16
to bean...@googlegroups.com
Martin Blais <bl...@furius.ca> writes:

> That's one way to solve it, but there's a better way.
> Rounding it manually like this will be time-consuming, probably.

Indeed.

> The problem here is that because you haven't used digits on "400",
> the tolerance for balancing EUR currencies in this transaction is 0,
> meaning it has to match perfectly. With such a rate this is virtually
> impossible.

Ahh…thank you for explanation. Btw, this is residue from Gnucash where,
probably, it does not make a difference.

> Try making 400 -> 400.00 instead, and now the inferred tolerance will
> be 0.005 EUR, and it will work. I also don't suggest this method,
> because it will be manual - just putting it out there to illustrate
> how the tolerances are inferred from the digits that are presented in
> the file.

I agree.

> Now, a much better solution would be to tell Beancount what tolerance
> to use when none can be inferred, like here. You would do this once,
> at the top of your file, with this option:
>
>
> option "inferred_tolerance_default" "EUR:0.005"
>
>
> That should probably be enough.

It is and it’s very nice!

> You could do this for all the currencies you have which aren't using
> digits very often.

OK.

>
> If you'd like to learn more about how tolerances are inferred
> automatically and how defaults are handled, you can read this
> document:
> http://furius.ca/beancount/doc/tolerances

I’ll do.

> I hope this helps,

Surely it does. ;)


Sincerely,
Gour

--
Even a man of knowledge acts according to his own nature, for
everyone follows the nature he has acquired from the three modes.
What can repression accomplish?

Reply all
Reply to author
Forward
0 new messages