remove delay stuff

this branch (timedistribution) handles delay with timespans and therefore abondans delay accounts and delayed_transactions

this commit removes the documentation
This commit is contained in:
Flukx 2020-12-13 17:13:20 +00:00
parent bafa1760a7
commit 85c531f910
5 changed files with 32 additions and 48 deletions

View file

@ -34,11 +34,7 @@ developing as well as for additional usage of the same data.
It also should make useful shortcuts and a quick-to-use command-line
interface possible, creatable with hopefully easy python interfaces.
## Implementation in terms of double accounting
*The following paragraph describes the original idea implemented in the
master branch. This branch uses a different idea: each split in a transaction
can have a time span, implemented in the module `time_span`.*
## Double accounting
My understanding of double accounting (doppelte Buchführung) as in gnucash:
every transaction has a date and a list of accounts (mostly two, but
@ -52,35 +48,35 @@ on household stuff.
This double accounting is useful to model both amounts of money that
you have (bank accounts, cash, credits to and from other people)
and categorisation (mobility, food, household, income, presents, donations, ...). My problem is only that the date the transaction has
and categorisation (mobility, food, household, income, presents, donations, ...).
My problem is only that the date the transaction has
usually reflects well the date when my cash gets decreased but
poorly when I actually use the benefit of my spending („use“ of the money).
### Implementation in terms of double accounting
The solution can be achieved within the system of double accounting:
one transaction moves money from the account „bank account“ to
an intermediate account „tmp-vacation“ at the date of paying
and 10 more transactions move each a tenth of the money
from „tmp-vacation“ to „vacation“ at the 10 days when I do my
vacation months later.
vacation months later. I started to implement this but it creates
such a huge amount of transactions that the file grew far too quickly
(in the magnitude of 10 MB for about 100 transactions) and reading
from it also was slow.
This solution is sound in terms of double accounting but not
practical to do by hand. Especially when I have a lot of days
(e.g. rent, internet, gas, electricity are a lot of daily costs
that also needs changing up to several years later when the bill comes.
Here this project comes into play: it should give an interface
that captures the described 10 transactions into one
„human understandable transaction“,
let's call it „delayed transaction“, and allows
easy handling and nice evaluation output.
### Implementation with time spans
Instead I use a different data model: each split in a transaction
can have a time span, implemented in the module `time_span`. This could
be a list of days or a period with begin and end. This time span is
saved as a `slot` in the gnucash file. I have not found a way to display
it in the GnuCash gui and processing the entire file for an overview
diagram still takes a lot of time but at least the file size does not
increase so quickly.
## Detail ideas
- Decision necessary: how many proxy accounts should exist. Options are:
- one. Everything goes via a single one per currency. Used so far.
* one per category account
* one per delayed transaction
Not sure if they have considerable (dis)advantages.
In the best case this decision is only in a low level
and could be changed without affecting a lot of code.
- Aggregation of buying things: not only using money but also spending
money is spread over several transactions
- Example: for building a house you need to pay a lot of
@ -92,40 +88,41 @@ easy handling and nice evaluation output.
## Code
* Python
* with annotations
* with git-flowish workflow
* with git-flowish workflow (not really happening since I am alone on this so far)
* with tests existing before code existing („Test driven development“)
* Based on [some opinion](https://pythontesting.net/transcripts/2-pytest-vs-unittest-vs-nose/) use `pytest`
* use properties where useful: <https://www.python-course.eu/python3_properties.php>
* use type annotations: <https://docs.python.org/3/library/typing.html>
* use internationalizing: <https://docs.python.org/3/library/i18n.html>
* An conda environment should be supplied or easily set up.
* An conda environment should be supplied or easily set up. (See [Setup](#usage))
* It would be good to seperate the packages that are needed for development and those needed for running the software (much less)
* Thoughts about documentation: google-style for docstrings best for use with [sphynx](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html)
* [Documentation](#usage): google-style for docstrings best for use with [sphynx](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html)
## Usage
### Environment
To create a python environment with the necessary dependencies, install `conda` and run `conda env create`.
It uses the configuration of the file `environment.yml`. Then run `conda activate moneyusage` to activate
the new environment.
Since the current piecash version does not work with the current GnuCash version,
I probably have to adjust piecash to the current GnuCash (4.0).
Right now I have temporarily "solved" the issue by removing the
version check. I do not know when this will backfire.
A pull request is heading in a similar direction but for GnuCash version 3.7: https://github.com/sdementen/piecash/pull/130. Since I am using
a "custom" piecash version it is probably best to include this
in a submodule and create pull requests if I adjust it to actually
work with version 4.0 of GnuCash.
Since the current piecash version does not always work with the current GnuCash version,
I probably have to adjust [piecash](https://github.com/sdementen/piecash/blob/master/piecash/core/session.py)
to the installed GnuCash version (4.0) if they don't fit.
The issue can be temporarily "solved" by removing the
version check.
To run the tests, you need to "install" this project into the current environment.
This is done via `pip install --editable .` in the environment file.
Otherwise the source is not in the pythonpath and the tests cannot import it.
It uses the `setup.py` with the `setup.cfg` config.
### Tests and Test coverage
The tests are run with `pytest` in the main directory.
Test coverage can be calculated with the
[coverage](https://coverage.readthedocs.io) module:
`coverage run --source=src -m pytest`
and shown with `coverage report` or `coverage html` afterwards.
### Documentation
To create the documentation go to the `docs` directory: `cd docs` and run `make html`.
Then under `docs/_build/html/index.html` you can view the created documentation.

View file

@ -1,4 +0,0 @@
Delay Account
=============
.. automodule:: account
:members:

View file

@ -1,4 +0,0 @@
Delayed Transactions
====================
.. automodule:: delayed_transaction
:members:

View file

@ -7,6 +7,4 @@ moneyusage
piecash
database
tests
delayed_transaction
account
overview_table

View file

@ -3,9 +3,6 @@ Tests
.. automodule:: test_database
:members:
.. automodule:: test_account
:members:
.. automodule:: test_period
:members: