From efb4547a373cb5d25d4d8e4ab80816b753500780 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Mon, 27 Nov 2017 17:04:51 +0100 Subject: [PATCH] updating master --- README.md | 22 ++++++++++++++++------ helix/calculators/bom_helper.py | 9 ++++++++- helix/constants/ebom_parts.py | 12 ++++++++++-- test/calculators/ebom_calculator_test.py | 4 ++-- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b39392a..bea73d8 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,7 @@ | google-chrome-stable/stable,now 62.0.3202.94-1 amd64 | | nodejs/unknown,now 6.12.0-1nodesource1 amd64 | -##### Test locally with CircleCi - -- Go to the project dir -- ```circleci build``` - -##### Develop +##### Set up for Develop and Testing - Run the docker container for the 1st time @@ -72,12 +67,27 @@ npm install &&\ invoke db_migrate ``` + ##### Important - Open another terminal tab, this script watches for changes and pass them to the docker conatiner, which will restart the web server ```./watch.sh``` +##### Run the server +```invoke serve_debug``` + + +##### Test locally without CircleCi +```invoke test_ci``` + + +##### Test locally with CircleCi + +- Go to the project dir +- ```circleci build``` + + ## OS steps wihout Docker #### macOS systems diff --git a/helix/calculators/bom_helper.py b/helix/calculators/bom_helper.py index 115838a..e8c9539 100644 --- a/helix/calculators/bom_helper.py +++ b/helix/calculators/bom_helper.py @@ -1,12 +1,19 @@ from math import ceil from helix.constants.panel_type import PanelType +from helix.constants.parts import * +# This story askes for this special parts to be showed +# www.pivotaltracker.com/n/projects/1544689/stories/148016595 +PARTS_SHOWN_EVEN_WITH_0_ELEMENTS = [ + delta_kit_inverter_mount, + delta_kit_inverter_mount_dt +] def add_parts_to_list(parts_list, parts_to_add, multiplier=1): for part, quantity in parts_to_add.items(): previous_value = parts_list.get(part) or 0 - if quantity != 0: + if quantity != 0 or part in PARTS_SHOWN_EVEN_WITH_0_ELEMENTS: parts_list[part] = previous_value + quantity * multiplier diff --git a/helix/constants/ebom_parts.py b/helix/constants/ebom_parts.py index b1f0f7f..ff608d9 100644 --- a/helix/constants/ebom_parts.py +++ b/helix/constants/ebom_parts.py @@ -128,9 +128,17 @@ def standalone_inverter_parts(inverter, system_type, module_type): if inverter['model'] in InverterType.DELTA.all(): parts = {} if system_type == SystemType.singleTilt: - parts = {**parts, delta_kit_inverter_mount: 1} + parts = { + **parts, + delta_kit_inverter_mount: 1, + delta_kit_inverter_mount_dt: 0 + } else: - parts = {**parts, delta_kit_inverter_mount_dt: 1} + parts = { + **parts, + delta_kit_inverter_mount: 0, + delta_kit_inverter_mount_dt: 1 + } if inverter['splice_box']: parts = {**parts, delta_splice_box: 1} return parts diff --git a/test/calculators/ebom_calculator_test.py b/test/calculators/ebom_calculator_test.py index f36b6f5..271c3b4 100644 --- a/test/calculators/ebom_calculator_test.py +++ b/test/calculators/ebom_calculator_test.py @@ -206,6 +206,7 @@ class EbomCalculatorTest(unittest.TestCase): delta_60kw_inverter: 1, delta_splice_box: 2, delta_kit_inverter_mount: 3, + delta_kit_inverter_mount_dt: 0 } assert_dictionary_equal(self.subject.compute_ebom(), expected_output) @@ -223,7 +224,6 @@ class EbomCalculatorTest(unittest.TestCase): 'attachment_point': ('Switch Gear', None) }, ] - self.user_values.system_type.return_value = SystemType.dualTilt self.user_values.module_type.return_value = ModuleType.Cell96 expected_output = { @@ -237,9 +237,9 @@ class EbomCalculatorTest(unittest.TestCase): harness_4_string_mf: 2, harness_4_string_fm: 2, delta_42kw_inverter: 1, + delta_kit_inverter_mount: 0, delta_kit_inverter_mount_dt: 1, } - assert_dictionary_equal(self.subject.compute_ebom(), expected_output) def test_computes_ebom_with_aux_plugs(self):