Skip to content
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

[DISCUSSION] Historical price analysis and unit conversion in report #36

Open
2 tasks
RagibHasin opened this issue Dec 28, 2024 · 6 comments
Open
2 tasks

Comments

@RagibHasin
Copy link

RagibHasin commented Dec 28, 2024

This is a great project. I was looking into porting https://github.com/simonmichael/hledger to Rust with added historical price analysis and unit conversion features. Discovering this project saved me much pain.

Do you think historical price analysis s in scope for tackler?

Edit:

As per the tentative agreement to add these features, here are the tasks to be completed:

  • Price data support
  • Unit conversion support
@35VLG84
Copy link
Collaborator

35VLG84 commented Dec 28, 2024

Hello, welcome and thanks, that's great to hear!

The historical price analysis and also unit conversions would be very nice features. There have been some plans to have unit conversions in the past, as I have some systems where that would be really handy. Also support for pricedb is something I am looking to have. So definitely yes!

Few practicalities, as the proper developer documentation is not so great at the moment:

  • One of the core principles of Tackler is that all features it have, must be well tested. This has payed many times itself off (for example: Scale depends on computing order of additions when subsequent result is zero paupino/rust-decimal#695) . So Unit tests where applicable and integration tests for main features will be needed.
  • I develop tackler so that all major features are first designed and only after that implemented and merged (An old TEP-1012 as an example). Part of the design phase is also planning how the feature will be tested and validated.
  • At the moment all math in Tackler are done so that there won't be rational or irrational numbers of unknown precision as the result. (e.g. no 1/3). With unit conversions these must be handled (depending which kind of conversions are allowed), and there must be solid story how repeating rational numbers or irrational numbers are handled (what is the used precision?).
  • Parsing of the pricedb can not be done with ANTRL, as I am in progress to replace that. The replacement is probably Winnow - in any case, winnow is already dependency of Gix, so using it would be ok (or parsing by hand, the pricedb syntax is fairly simple).
  • The pricedb syntax should be same as with ledger/hledger/beancount if possible, so that same downloaders could be used.

If this sounds like something you would like to contribute or participate, that would awesome and be most welcomed!

If you are interested, we could discuss more about the features in this ticket, and when we have rough idea, I will create a new TEP where we can finalize the feature. And don't worry about T3DB, I will take care of that.

What do you think? And in any case, thanks for nice words and taking the time to look the project!

@RagibHasin
Copy link
Author

I am definitely interested in it.

I agree that it would be the best to adopt the pricedb format.

As for the precision in case of rational numbers, would giving an option to the user along with selecting the smallest exact representation of the commodity (as Ledger does), not be the best choice?

35VLG84 added a commit that referenced this issue Dec 30, 2024
GH-36

[skip ci]

Signed-off-by: 35V LG84 <[email protected]>
@35VLG84
Copy link
Collaborator

35VLG84 commented Dec 30, 2024

I suggest that we split this into two different features

  • Price data support
    • Price data support is needed and could be used for historical price analysis
  • Unit conversion in reports
    • This could build on top of price data support
      • Constant conversions: hours to seconds
      • Variable conversions: Litres of Helium to €

For price data support I created TEP-1015.

There is a branch https://github.com/e257-fi/tackler-ng/tree/tep/tep-1015-price-data for planning and implementation. Please feel free to use it for recording your planning and ideas. Especially as you design this feature, when you have idea of how something can break or go wrong, please record it on the testing section. We can then later remove those test cases which are not needed.

The branch will be also used for actual implementation.

This GH Org / repo has Sub-Issue feature enabled, so it's also possible (and recommended) to create a sub-issues to this issue if needed.

And most importantly - Great that you are interested in this!

@RagibHasin
Copy link
Author

Thanks!

This GH Org / repo has Sub-Issue feature enabled

Didn't know this was a thing!

@RagibHasin
Copy link
Author

Ah, it seems the sub-issue feature is glitching.

Anyway, does Tackler has any Matrix/Zulip presence? A GitHub issue does not feel very accessible for long discussions to me.

@35VLG84
Copy link
Collaborator

35VLG84 commented Dec 31, 2024

If you have noticed issues with the sub-issues (pun intended), you could report them to Github - it's beta feature and they are looking feedback. https://gh.io/issues-updates-feedback

There is a room for Tackler in Matrix, https://matrix.to/#/#tackler:matrix.org, see you there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants