view · edit · sidebar · attach · print · history

Index>

20170927-rapflag-bugs

Summary

  • swissmedic_import with :check must delete packages not in Packungen.xlsx
  • fix rapflag bugs
  • Keep in Mind

Commits

Index

swissmedic_import with :check must delete packages not in Packungen.xlsx

Still have a typo in my last try.

Error: NameError
Message: undefined local variable or method `iksrn' for #<ODDB::SwissmedicPlugin:0x00564d0b6eac68>
Did you mean?  iksnr
Backtrace:
/var/www/oddb.org/src/plugin/swissmedic.rb:277:in `block (2 levels) in check_all_packages'
/var/www/oddb.org/src/plugin/swissmedic.rb:275:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:275:in `block in check_all_packages'
/var/www/oddb.org/src/plugin/swissmedic.rb:272:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:272:in `check_all_packages'
/var/www/oddb.org/src/plugin/swissmedic.rb:396:in `update'
/var/www/oddb.org/src/util/updater.rb:437:in `block in update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:542:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:435:in `update_swissmedic'
jobs/import_swissmedic_only:30:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_swissmedic_only:12:in `<module:Util>'
jobs/import_swissmedic_only:11:in `<module:ODDB>'
jobs/import_swissmedic_only:10:in `<main>'

Dropped and reloaded database. Running import_swissmedic_only with checkes for all registrations and all packages.

Created a separate jobs, which does not send emails and has a hard coded limit. See commit Fix expired packages. But it look like that it will need around 15 hours go fix all problems. Here part of my log

2017-09-27 16:05:16 +0200 We must deactivate 2051 registrations #<ODDB::Registration:0x00556f369a8148> #<ODDB::Registration:0x00556f3a426018>
2017-09-27 16:05:16 +0200 :!registration,46466!sequence,01!package,012.
2017-09-27 16:06:35 +0200 :!registration,46466!sequence,01!package,020.
2017-09-27 16:06:36 +0200 :!registration,23062!sequence,01!package,011.
2017-09-27 16:07:13 +0200 :!registration,23062!sequence,01!package,046.
2017-09-27 16:07:50 +0200 :!registration,55485!sequence,01!package,020.
2017-09-27 16:08:03 +0200 :!registration,45119!sequence,01!package,017.
2017-09-27 16:08:41 +0200 :!registration,41322!sequence,01!package,020.
2017-09-27 16:09:18 +0200 :!registration,41322!sequence,02!package,047.
2017-09-27 16:09:55 +0200 :!registration,52300!sequence,01!package,010.
2017-09-27 16:09:56 +0200 :!registration,52300!sequence,01!package,029.
2017-09-27 16:09:57 +0200 :!registration,00526!sequence,01!package,001.
2017-09-27 16:09:58 +0200 :!registration,00526!sequence,01!package,002.
2017-09-27 16:09:59 +0200 :!registration,00526!sequence,01!package,003.
2017-09-27 16:10:00 +0200 :!registration,00526!sequence,01!package,004.
2017-09-27 16:10:01 +0200 :!registration,44633!sequence,01!package,019.
2017-09-27 16:10:11 +0200 :!registration,44633!sequence,01!package,027.
2017-09-27 16:10:21 +0200 :!registration,46469!sequence,01!package,038.

fix rapflag bugs

The following bugs must still be fixed

  • BUG 2 ("Dividend" again): On AUG-28 on USD Exchange Wallet: you are ignoring the line containing the word Dividend, whereas you are supposed to read that ending balance off of every line (and taking the End-of-Day balance after reading every line) AND classifying the credit on that day as INCOME. REMINDER: "Deposit Wallet" = "Funding Wallet"
  • BUG 3: on AUG-02, in USD wallet (exchange or funding need to check), there is a $3'148 dollar discrepancy between YWeSlack and True. This is most likely because you picked up twice the line where BCH is sold for USD, wherein $3'148 are the cash proceeds for the sale.
  • BUG 4: There seems to be a Timing Discrepancy between the downloaded Ledger Data (YWeSee vs AviRap). I have everything set to CET (Central European Time, e.g., Rome Time) and bitfinex allows me to change that. Check if you can change this setting such that the downloaded data via the API has the same timing convention.
  • BUG 5: on AUG-17: on USD Exchange Wallet: the ending balance for YWeSlack is $4'370, whereas for TRUE the ending balance is $0.
  • BUG 6: on AUG-20: on USD Exchange Wallet: the ending balance for YWeSlack is -$4.15, whereas for TRUE the ending balance is $0. This seems to be because you are not parsing line containing the word Settlement at all, when you are supposed to read that line and classify the debit on that day as INCOME.
  • BUG 8: on BTC (total) there are dates skipped where there are no ledger entries. There supposed to be an Ending Balance (and Income) for every Calendar Day, and if there was no Ledger Entry on that day then the Income should be zero and the Ending Balance should be what it was the day before.

Bug 4 looks like a nice to have feature. Looking at the problems with the ending balance. e,g. bug 6 of Aug-20.

Bug 8 is fixed with commit Emit totals for each day. Released rapflag gem 1.0.5.

Working on Bug 6 revealed that in the spec test the test for the balance was partly wrong. But my changes are not always correct as sometimes I have only rounding differences like USD,2016.10.08,"",2.797999989168701e-05 != USD,2016.10.08,"",2.798e-05 (old), but sometimes the balance is completely different, eg USD,2016.09.30,"",-1.3544096128925015e-13 != USD,2016.09.30,"",0.0 (old)

I am getting now better results with my reworked calculation of the daily balance, e.g

USD,2017.08.02,-3.57210655,2.5923707624997405e-13
USD,2017.08.03,"",2.5923707624997405e-13
USD,2017.08.04,"",2.5923707624997405e-13
USD,2017.08.05,"",2.0002062228741124e-08
USD,2017.08.06,"",0.0
USD,2017.08.07,"",0.0

But why do I get these rounding errors? Or must I trust the balance of the last entry? Yes. Just take the balance of the last entry of the same day

Fixed with commit Fix calculation of daily income/balance. This should fix bugs 3,5,6.

Released rapflag gem version 1.0.6

view · edit · sidebar · attach · print · history
Page last modified on September 27, 2017, at 06:49 PM