Comments (11)
I ended up running it with Docker where it works, posting as it may help others running into the same issue:
Create Dockerfile
FROM python:3.9
WORKDIR /usr/src/app
RUN pip3 install rp2
In same dir run
docker build --tag rp2
Go to your directory with input.ods
and input.config
files, run
docker run -it --rm --name rp2-script -v "$PWD":/usr/src/app -w /usr/src/app rp2 rp2_us input.config input.ods
from rp2.
This looks like another Python 3.10 decimal issue, similar to issue #25. I haven't tested RP2 on Python 3.10: it does look like it's not working yet on that version of the language. The (non ideal) workaround is to use Python 3.9. If you find a way to modify PR #28 so that RP2 works on all versions of Python, I'll accept it.
from rp2.
Since issue #25 seems due to some problem with your specific Python installation (see my latest comments there), this behavior might have the same origin. You may want to try uninstalling Python and reinstalling it.
from rp2.
Well it's an endless loop which you can confirm following the link in my original post. Does not look like Python version related at all. The crypto_example.ods
sample works fine, it's just my own sample has some input that rp2
cannot handle and instead of throwing an exception (see the link in my original post), it goes to your overwritten method where you call quantize() again.
Now, I don't know which cell has an invalid value so I recommend adding verbosity to be able to better debug invalid values.
from rp2.
Running the tests locally I also get the recursion error so it looks like it might be setup related. I don't know much about Python development and I have no clue how there can possibly be different behaviors in that regard, it's a clean Python install (through the package manager) and I reinstalled multiple times with different versions.
from rp2.
If anyone cares, here is a CSV that fails:
IN,1,2,3,4,5,6,7,8,9,10,11,12
timestamp,exchange,holder,type,asset,crypto_in,spot_price,[crypto_fee],[fiat_fee],[fiat_in_fee],[fiat_in_nofee],[id],[notes]
2020-02-01T11:18Z,Kraken,self,BUY,ETH,107,1,0,,,,,x
TABLE END,,,,,,,,,,,,
,,,,,,,,,,,,
OUT,1,2,3,4,5,6,7,8,9,10,11,12
timestamp,exchange,holder,type,asset,crypto_out_nofee,spot_price,[crypto_fee],[fiat_fee],[crypto_out_fee],[fiat_out_nofee],[id],[notes]
2020-02-02T11:18Z,Kraken,self,SELL,ETH,50,1,0.00,0,,,,
TABLE END,,,,,,,,,,,,
and here one that succeeds
IN,1,2,3,4,5,6,7,8,9,10,11,12
timestamp,exchange,holder,type,asset,crypto_in,spot_price,[crypto_fee],[fiat_fee],[fiat_in_fee],[fiat_in_nofee],[id],[notes]
2020-02-01T11:18Z,Kraken,self,BUY,ETH,100,1,0,,,,,x
TABLE END,,,,,,,,,,,,
,,,,,,,,,,,,
OUT,1,2,3,4,5,6,7,8,9,10,11,12
timestamp,exchange,holder,type,asset,crypto_out_nofee,spot_price,[crypto_fee],[fiat_fee],[crypto_out_fee],[fiat_out_nofee],[id],[notes]
2020-02-02T11:18Z,Kraken,self,SELL,ETH,50,1,0.00,0,,,,
TABLE END,,,,,,,,,,,,
the only difference is for crypto_in
to be 100
instead of 107
[rounding exception]
from rp2.
Can you add a print statement at /home/rndstr/venv3/lib/python3.10/site-packages/rp2/rp2_decimal.py", line 64, in add? Something like:
print(self, other)
The last printed values before the exception should be the ones causing the problem in the add.
from rp2.
it prints this
-3.17757009345794393E-14 0E-13
from rp2.
You have a small repro: that's good. Can you upload the ODS file instead of CSV and its related config? That way I can feed it directly to RP2 on my machine.
from rp2.
uploaded it at rndstr@3a973c8
i wonder whether the Python decimal library is using something in my system that messes the rounding or accuracy up
from rp2.
I tried your files and they worked on my machine:
> rp2_us loop.config loop.ods
INFO: Country: us
INFO: Accounting Method: fifo
INFO: Configuration file: loop.config
INFO: Input file: loop.ods
INFO: Processing ETH
INFO: Generating output for plugin 'rp2.plugin.report.rp2_full_report'
INFO: Plugin 'rp2.plugin.report.rp2_full_report' output: /private/tmp/output/fifo_rp2_full_report.ods
INFO: Generating output for plugin 'rp2.plugin.report.us.tax_report_us'
INFO: Plugin 'rp2.plugin.report.us.tax_report_us' output: /private/tmp/output/fifo_tax_report_us.ods
INFO: Log file: ./log/rp2_2022_04_12_21_22_19_512993.log
INFO: Generated output directory: output/
INFO: Done
I wonder if other Python packages using Decimal and high-precision math work on your machine: it might be an experiment worth trying.
from rp2.
Related Issues (20)
- Short term vs. long term gains HOT 5
- Parameter 'crypto_fee' has zero value HOT 3
- Open Positions affected by "from date" HOT 1
- Spending from Exchange with zero balance HOT 14
- option to specify columns in config.ini by letter HOT 1
- Non-zero balances when zero is expected HOT 2
- Few minor suggestions HOT 1
- Uncertain, but considering making a python wallet reader HOT 1
- Per wallet/exchange Specific Identification (FIFO, LIFO, etc...) Resolution HOT 27
- Exception when executing HOT 3
- Question about "Open Positions by Asset" report HOT 2
- Crypto fee in OUT table HOT 24
- FIFO and exchange/wallet cost-basis calculation HOT 5
- RP2 process runs after "DONE" HOT 5
- Investment Expenses can no longer be used for Deductions HOT 10
- Call for GUI coders: create an intuitive GUI to drive RP2 and DaLI HOT 3
- I can def help HOT 2
- Using Pionex data to Rp2 using dali isn't working. __crypto_sent = unknown HOT 4
- Error total in-transaction crypto value < total taxable crypto value HOT 1
- [Request] Expose settings for what constitutes a taxable event HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rp2.