From 6b3e94729c6306b300f049d57930209c123725d6 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Thu, 31 Oct 2019 15:05:14 +0300 Subject: [PATCH 1/6] Update staticdata and bump version --- staticdata/bulkdata/dogmatypeattributes.json | 87 +++++++++++++++++++- staticdata/bulkdata/dogmatypeeffects.json | 25 ++++++ staticdata/fsd_lite/evetypes.json | 25 +++++- staticdata/phobos/metadata.json | 4 +- version.yml | 2 +- 5 files changed, 135 insertions(+), 8 deletions(-) diff --git a/staticdata/bulkdata/dogmatypeattributes.json b/staticdata/bulkdata/dogmatypeattributes.json index 155da3c82..8d963005c 100644 --- a/staticdata/bulkdata/dogmatypeattributes.json +++ b/staticdata/bulkdata/dogmatypeattributes.json @@ -387087,7 +387087,7 @@ { "attributeID": 37, "typeID": 11365, - "value": 195.0 + "value": 295.0 }, { "attributeID": 38, @@ -2889503,5 +2889503,90 @@ "attributeID": 2422, "typeID": 52814, "value": 18201.0 + }, + { + "attributeID": 4, + "typeID": 53287, + "value": 0.0 + }, + { + "attributeID": 38, + "typeID": 53287, + "value": 0.0 + }, + { + "attributeID": 161, + "typeID": 53287, + "value": 1.0 + }, + { + "attributeID": 162, + "typeID": 53287, + "value": 1.0 + }, + { + "attributeID": 175, + "typeID": 53287, + "value": 3.0 + }, + { + "attributeID": 176, + "typeID": 53287, + "value": 3.0 + }, + { + "attributeID": 177, + "typeID": 53287, + "value": 3.0 + }, + { + "attributeID": 178, + "typeID": 53287, + "value": 3.0 + }, + { + "attributeID": 179, + "typeID": 53287, + "value": 3.0 + }, + { + "attributeID": 182, + "typeID": 53287, + "value": 3402.0 + }, + { + "attributeID": 277, + "typeID": 53287, + "value": 1.0 + }, + { + "attributeID": 330, + "typeID": 53287, + "value": 172800000.0 + }, + { + "attributeID": 1087, + "typeID": 53287, + "value": 10.0 + }, + { + "attributeID": 1647, + "typeID": 53287, + "value": 1080.0 + }, + { + "attributeID": 1890, + "typeID": 53287, + "value": 1.0 + }, + { + "attributeID": 1916, + "typeID": 53287, + "value": 1.0 + }, + { + "attributeID": 2422, + "typeID": 53287, + "value": 18293.0 } ] \ No newline at end of file diff --git a/staticdata/bulkdata/dogmatypeeffects.json b/staticdata/bulkdata/dogmatypeeffects.json index 3e0ebe9f3..d4a84cc62 100644 --- a/staticdata/bulkdata/dogmatypeeffects.json +++ b/staticdata/bulkdata/dogmatypeeffects.json @@ -212823,5 +212823,30 @@ "effectID": 310, "isDefault": false, "typeID": 52814 + }, + { + "effectID": 302, + "isDefault": false, + "typeID": 53287 + }, + { + "effectID": 304, + "isDefault": false, + "typeID": 53287 + }, + { + "effectID": 306, + "isDefault": false, + "typeID": 53287 + }, + { + "effectID": 308, + "isDefault": false, + "typeID": 53287 + }, + { + "effectID": 310, + "isDefault": false, + "typeID": 53287 } ] \ No newline at end of file diff --git a/staticdata/fsd_lite/evetypes.json b/staticdata/fsd_lite/evetypes.json index 16397b913..38d257434 100644 --- a/staticdata/fsd_lite/evetypes.json +++ b/staticdata/fsd_lite/evetypes.json @@ -587541,7 +587541,7 @@ "53093": { "basePrice": 0.0, "capacity": 0.0, - "description": "This crate contains a frigate-class starship from your faction's combat line.\r\nThese ships are excellent choices for completing level 1 security agent missions as well as inexpensive pvp combat against other capsuleers.", + "description": "This crate contains a frigate class starship from your faction's combat line.\r\nThese ships are excellent choices for completing level 1 security agent missions as well as inexpensive pvp combat against other capsuleers.", "descriptionID": 552916, "groupID": 1194, "iconID": 1443, @@ -587551,7 +587551,7 @@ "published": false, "radius": 1.0, "typeID": 53093, - "typeName": "Frigate-Class Starship", + "typeName": "Frigate Class Starship", "typeNameID": 552915, "volume": 2500.0 }, @@ -587575,7 +587575,7 @@ "53095": { "basePrice": 0.0, "capacity": 0.0, - "description": "This crate contains a destroyer-class starship from your faction's attack line.\r\nDestroyers are larger and more powerful than frigates, with excellent damage output. However their larger size makes them easier for enemy ships to hit effectively. \r\nThese ships are excellent choices for completing level 1 or 2 security agent missions, as well as group pvp combat as part of a capsuleer corporation.", + "description": "This crate contains a destroyer class starship from your faction's attack line.\r\nDestroyers are larger and more powerful than frigates, with excellent damage output. However their larger size makes them easier for enemy ships to hit effectively. \r\nThese ships are excellent choices for completing level 1 or 2 security agent missions, as well as group pvp combat as part of a capsuleer corporation.", "descriptionID": 552920, "groupID": 1194, "iconID": 1443, @@ -587585,7 +587585,7 @@ "published": false, "radius": 1.0, "typeID": 53095, - "typeName": "Destroyer-Class Starship", + "typeName": "Destroyer Class Starship", "typeNameID": 552919, "volume": 5000.0 }, @@ -587861,6 +587861,23 @@ "typeNameID": 553277, "volume": 1.0 }, + "53287": { + "basePrice": 0.0, + "capacity": 0.0, + "description": "Cerebral accelerators are military grade boosters that significantly increase a pilot’s skill development for a limited time. This is achieved by priming the user’s brain and neural pathways for increased data bandwidth during knowledge transfer.\r\n\r\nDesigned for new capsuleers, this cerebral accelerator will cease to function for pilots who have been registered for more than 45 days.\r\nThe compounds used in this cerebral accelerator are unstable, and will expire on YC122/02/01.", + "descriptionID": 553412, + "groupID": 303, + "iconID": 10144, + "isDynamicType": false, + "mass": 0.0, + "portionSize": 1, + "published": false, + "radius": 1.0, + "typeID": 53287, + "typeName": "Starter Gift Cerebral Accelerator", + "typeNameID": 553411, + "volume": 1.0 + }, "533": { "basePrice": 0.0, "capacity": 0.0, diff --git a/staticdata/phobos/metadata.json b/staticdata/phobos/metadata.json index 4ade8aa12..e23fb1ed7 100644 --- a/staticdata/phobos/metadata.json +++ b/staticdata/phobos/metadata.json @@ -1,10 +1,10 @@ [ { "field_name": "client_build", - "field_value": 1595463 + "field_value": 1596526 }, { "field_name": "dump_time", - "field_value": 1572435719 + "field_value": 1572522923 } ] \ No newline at end of file diff --git a/version.yml b/version.yml index a5797e04e..6c2e0ad84 100644 --- a/version.yml +++ b/version.yml @@ -1 +1 @@ -version: v2.14.0 +version: v2.14.1 From 9eb3b9e0175bf8e7a355e27dc5c037eb10cba152 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 4 Nov 2019 02:50:55 +0300 Subject: [PATCH 2/6] Do not use evepraisal info unless there are orders up --- service/marketSources/__init__.py | 2 +- service/marketSources/evepraisal.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/service/marketSources/__init__.py b/service/marketSources/__init__.py index eb0162324..410ceb724 100644 --- a/service/marketSources/__init__.py +++ b/service/marketSources/__init__.py @@ -1 +1 @@ -__all__ = ['evemarketer', 'evemarketdata', 'evepraisal'] +__all__ = ['evemarketer', 'evepraisal', 'evemarketdata'] diff --git a/service/marketSources/evepraisal.py b/service/marketSources/evepraisal.py index e910b92fa..66dd5b1f0 100644 --- a/service/marketSources/evepraisal.py +++ b/service/marketSources/evepraisal.py @@ -66,11 +66,15 @@ class EvePraisal: try: typeID = int(itemData['typeID']) price = itemData['prices']['sell']['min'] + orderCount = itemData['prices']['sell']['order_count'] except (KeyError, TypeError): continue # evepraisal returns 0 if price data doesn't even exist for the item if price == 0: continue + # evepraisal seems to provide price for some items despite having no orders up + if orderCount < 1: + continue priceMap[typeID].update(PriceStatus.fetchSuccess, price) del priceMap[typeID] From 41c6062ff9d2faf0f059e26b8f22890b537875b8 Mon Sep 17 00:00:00 2001 From: Gochim <54093496+Gochim@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:26:41 +0200 Subject: [PATCH 3/6] Added instructions to run tests for the project --- CONTRIBUTING.md | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1becb0b0a..9e0c60f80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ - Python 3.6 - Git CLI installed -- Python, pip and git are all available as command-line commands (add to path if needed) +- Python, pip and git are all available as command-line commands (add to the path if needed) Virtual environment will be created in *PyfaEnv* folder. Project will be cloned and run from the *PyfaDEV* folder. Separate virtual environment will be created so required libraries won't clutter the main python installation. @@ -17,12 +17,12 @@ Clone the repository git clone PyfaDEV ``` -Create virtual environment +Create the virtual environment ``` python -m venv PyfaEnv ``` -Activate virtual environment +Activate the virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat @@ -52,11 +52,11 @@ python PyfaDEV\pyfa.py Install PyCharm / Other IntelliJ product with Python plugin -After launching select *Check out from Version Control* -> *GIt* +After launching - select *Check out from Version Control* -> *GIt* ![welcome](https://user-images.githubusercontent.com/54093496/66862580-d8edab00-ef99-11e9-94e2-e93d7043e620.png) -Login to GitHub, paste repo URL and seect the folder to which to clone the project, press *Clone*. +Login to GitHub, paste the repo URL and select the folder to which to clone the project into, press *Clone*. ![Clone](https://user-images.githubusercontent.com/54093496/66862748-38e45180-ef9a-11e9-9f68-4903baf47385.png) @@ -68,7 +68,7 @@ Press on options and add new virtual environment. ![venv](https://user-images.githubusercontent.com/54093496/66862833-67622c80-ef9a-11e9-94fa-47cca0158d29.png) -Open project tree view and double-click on *requirements.txt*. Press *Install requirements*. Install all requirements. +Open project tree view and double-click on the *requirements.txt*. Press *Install requirements*. Install all requirements. ![Reqs](https://user-images.githubusercontent.com/54093496/66862870-7a74fc80-ef9a-11e9-9b18-e64be42c49b8.png) @@ -76,4 +76,27 @@ Create new *Run Configuration*. Set correct *Script path* and *Python interprete ![Run configuraion](https://user-images.githubusercontent.com/54093496/66862970-b4460300-ef9a-11e9-9fb4-20e24759904b.png) -Test that the project is starting properly. \ No newline at end of file +Check that the project is starting properly. + +## Running tests + +Switch to the proper virtual environment +``` +For cmd.exe: PyfaEnv\scripts\activate.bat +For bash: source /bin/activate +``` + +Install pytest +``` +pip install pytest +``` + +Switch to pyfa directory. + +Run tests (any will do) +``` +python -m pytest +py.test +``` + +More information on tests can be found on appropriate [Wiki page](https://github.com/pyfa-org/Pyfa/wiki/Developers:-Writing-Tests-for-Pyfa). \ No newline at end of file From c6c74be38dae509e87256f0dd6e4ed47123b534d Mon Sep 17 00:00:00 2001 From: Gochim <54093496+Gochim@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:26:41 +0200 Subject: [PATCH 4/6] Added instructions to run tests for the project --- CONTRIBUTING.md | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1becb0b0a..9e0c60f80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ - Python 3.6 - Git CLI installed -- Python, pip and git are all available as command-line commands (add to path if needed) +- Python, pip and git are all available as command-line commands (add to the path if needed) Virtual environment will be created in *PyfaEnv* folder. Project will be cloned and run from the *PyfaDEV* folder. Separate virtual environment will be created so required libraries won't clutter the main python installation. @@ -17,12 +17,12 @@ Clone the repository git clone PyfaDEV ``` -Create virtual environment +Create the virtual environment ``` python -m venv PyfaEnv ``` -Activate virtual environment +Activate the virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat @@ -52,11 +52,11 @@ python PyfaDEV\pyfa.py Install PyCharm / Other IntelliJ product with Python plugin -After launching select *Check out from Version Control* -> *GIt* +After launching - select *Check out from Version Control* -> *GIt* ![welcome](https://user-images.githubusercontent.com/54093496/66862580-d8edab00-ef99-11e9-94e2-e93d7043e620.png) -Login to GitHub, paste repo URL and seect the folder to which to clone the project, press *Clone*. +Login to GitHub, paste the repo URL and select the folder to which to clone the project into, press *Clone*. ![Clone](https://user-images.githubusercontent.com/54093496/66862748-38e45180-ef9a-11e9-9f68-4903baf47385.png) @@ -68,7 +68,7 @@ Press on options and add new virtual environment. ![venv](https://user-images.githubusercontent.com/54093496/66862833-67622c80-ef9a-11e9-94fa-47cca0158d29.png) -Open project tree view and double-click on *requirements.txt*. Press *Install requirements*. Install all requirements. +Open project tree view and double-click on the *requirements.txt*. Press *Install requirements*. Install all requirements. ![Reqs](https://user-images.githubusercontent.com/54093496/66862870-7a74fc80-ef9a-11e9-9b18-e64be42c49b8.png) @@ -76,4 +76,27 @@ Create new *Run Configuration*. Set correct *Script path* and *Python interprete ![Run configuraion](https://user-images.githubusercontent.com/54093496/66862970-b4460300-ef9a-11e9-9fb4-20e24759904b.png) -Test that the project is starting properly. \ No newline at end of file +Check that the project is starting properly. + +## Running tests + +Switch to the proper virtual environment +``` +For cmd.exe: PyfaEnv\scripts\activate.bat +For bash: source /bin/activate +``` + +Install pytest +``` +pip install pytest +``` + +Switch to pyfa directory. + +Run tests (any will do) +``` +python -m pytest +py.test +``` + +More information on tests can be found on appropriate [Wiki page](https://github.com/pyfa-org/Pyfa/wiki/Developers:-Writing-Tests-for-Pyfa). \ No newline at end of file From c52170b7312fc39b427938d6896fd639ae885b6f Mon Sep 17 00:00:00 2001 From: Gochim <54093496+Gochim@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:45:29 +0200 Subject: [PATCH 5/6] Fixed path for bash script call --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e0c60f80..b5132c16e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ Activate the virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat -For bash: source /bin/activate +For bash: source /Scripts/activate ``` > For other OS check [Python documentation](https://docs.python.org/3/library/venv.html) @@ -83,7 +83,7 @@ Check that the project is starting properly. Switch to the proper virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat -For bash: source /bin/activate +For bash: source /Scripts/activate ``` Install pytest From e6cfd334355cec0b3faaa5f606b07839b58dada3 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Thu, 7 Nov 2019 18:35:14 +0300 Subject: [PATCH 6/6] Fix #2076 - use collection ABCs from .abc module --- eos/modifiedAttributeDict.py | 5 +++-- service/port/esi.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index 7be24ff76..0a9eda8a4 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -17,7 +17,8 @@ # along with eos. If not, see . # =============================================================================== -import collections + +from collections import MutableMapping from copy import copy from math import exp @@ -96,7 +97,7 @@ class ChargeAttrShortcut: return return_value or default -class ModifiedAttributeDict(collections.MutableMapping): +class ModifiedAttributeDict(MutableMapping): overrides_enabled = False class CalculationPlaceholder: diff --git a/service/port/esi.py b/service/port/esi.py index 7b1e35954..c9296e1ec 100644 --- a/service/port/esi.py +++ b/service/port/esi.py @@ -18,8 +18,8 @@ # ============================================================================= -import collections import json +from collections import defaultdict from logbook import Logger @@ -61,7 +61,7 @@ def exportESI(ofit, callback): # max fit name length is 50 characters # Most keys are created simply because they are required, but bogus data is okay - nested_dict = lambda: collections.defaultdict(nested_dict) + nested_dict = lambda: defaultdict(nested_dict) fit = nested_dict() sFit = svcFit.getInstance()