-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore commodities without price #96
Conversation
Hmm, without price entries and converting them, the resulting asset allocation would be incorrect. This is why they are treated as errors and not warnings. I would not want to change that unless there's a strong counter argument I'm missing. If there is one, perhaps a switch targeted towards such a scenario would be best. Thoughts? |
That makes sense, thank you! What do you think of entirely ignoring unpriced assets from the overall asset allocation? |
The problem with that is, we get an allocation output that looks correct, with no indication that certain assets were skipped. If the goal is to tell the system to not include certain assets, doing so by implicitly excluding those without a price conversion would frequently result in unexpected output. Take for example, a user that looked at their asset alloc for years, and one day, an importer (or a plugin) adds one single price conversion statement. The asset alloc would drastically change, leaving the user either confused (in the best case), or having them not even notice, and make financial decisions based on an asset allocation that doesn't match their mental model. In addition, it would be impossible to have a price conversion on a certain asset (for unconnected reasons), and still include it in the asset alloc or vice versa. An explicit way of specifying configuration would thus be a basic requirement to have all this work correctly. For example, a config to explicitly list currencies to include and those to exclude, perhaps. That would have to be thought through. |
I have just marked this PR as "draft" since it is obviously not ready for prime time :) If I have time, I'll try to give it more thought. Continuing on your configuration note, what if instead users could explicitly opt-out assets from their allocation, e.g. as a metadata? A-la Python: explicit is better than implicit :) That way, no price posting would change their allocation without their knowing, etc. As for me, that would allow me to just mark assets I do not have a price for as excluded and still get the rest of the allocation. |
Yes, configuration either through metadata or through the existing configuration dictionary would both be reasonable options to consider. The questions I'd ask are:
|
Maybe there was confusion based on my usage of the word "asset": I was thinking to "assets" as "accounts", rather than currency. In my case, I'd simply skip something like
I just tested this since I always prefer re-using existing functionality. My configuration was, previously, as follows:
The accounts triggering the issue are of the form
This works. Now, is it better to specify the exclusion here or through a commodity metadata? |
That's exactly the way to configure it :). |
Some commodities in my ledger do not have a price, nor are meant to have one.
Before, I was getting the following error:
Error: unable to convert 1 XXX to base currency YYY (Missing price directive?)
As a result,
fava
was also exiting.This PR simply ignores those commodities.