|
| 1 | +# Stock Splits |
| 2 | +_Because Lockefox is an idiot and made the project no-db_ |
| 3 | + |
| 4 | +So, they announced [PLEX was going to be split](https://community.eveonline.com/news/dev-blogs/plex-changes-on-the-way/). NBD, right? Because ProsperAPI has no backing database, this is actually more difficult than it should be. |
| 5 | + |
| 6 | +# Declaring A Split |
| 7 | + |
| 8 | +```javascript |
| 9 | +publicAPI/split_info.json |
| 10 | +[ |
| 11 | + |
| 12 | + { |
| 13 | + "type_id": , #which item |
| 14 | + "type_name": , #type name for debug |
| 15 | + "original_id": , #ID before the split |
| 16 | + "new_id": , #ID after the split |
| 17 | + "split_date": , #%Y-%m-%d of split |
| 18 | + "bool_mult_div": , #price multiplied by split? |
| 19 | + "split_rate": , #new quantity |
| 20 | + } |
| 21 | +] |
| 22 | +``` |
| 23 | + |
| 24 | +Split info is designed to work in pairs. Define both old and new items in paired splits for backwards-compatability. |
| 25 | + |
| 26 | +Also can be used with a `"split_rate": 1` for a `type_id` remapping. |
| 27 | + |
| 28 | +# Backloading cache data |
| 29 | +Because [Prophet](https://github.com/EVEprosper/ProsperAPI/blob/master/docs/crest_endpoint.md#prophet) requires 720 days of back history, we need to keep an archive in-project to keep expected quality of service. Also, though CCP has said ESI will allow some back-compat, [EVE-Marketdata](https://eve-marketdata.com/) makes no such promises. |
| 30 | + |
| 31 | +To backload: |
| 32 | +> `python scripts/create_splitcache.py` |
| 33 | +
|
| 34 | +See `-h` for settings for switching source, type, filename, regions, etc |
| 35 | + |
| 36 | +Don't forget to commit updates ;) |
| 37 | + |
| 38 | +# Testing |
| 39 | +Test suite uses a hacky sideload that uses Tritanium (34) and Pyerite (35) to validate behavior. |
| 40 | + |
| 41 | +Also, `.travis.yml` creates a local split_cache.json file just for automated testing. See `.travis.yml` for preparing [test environment](https://github.com/EVEprosper/ProsperAPI/blob/master/docs/release.md#2-test-your-shit). |
| 42 | + |
| 43 | +# Database Note: |
| 44 | +Splitcache has purposefully been made to run in a flat-file, rather than use [tinymongo](https://github.com/schapman1974/tinymongo) for remote database connection compatability. This was done to continue the spirit of "anyone can launch ProsperAPI anywhere". |
| 45 | + |
| 46 | +PLEX split was prepared with the following: |
| 47 | +> `python scripts\create_splitcache.py -t 29668 -r 720 -s eve-marketdata` |
0 commit comments