-
Notifications
You must be signed in to change notification settings - Fork 16
Issue 63: StaticView.add_nearest_neighbours() should not duplicate relationships #64
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #64 +/- ##
==========================================
+ Coverage 90.60% 91.18% +0.57%
==========================================
Files 69 69
Lines 2108 2109 +1
Branches 208 210 +2
==========================================
+ Hits 1910 1923 +13
+ Misses 177 167 -10
+ Partials 21 19 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only some style changes. Otherwise this is a great addition.
Makefile
Outdated
@@ -8,6 +8,7 @@ | |||
qa: | |||
isort src/structurizr/ tests/ examples/ setup.py | |||
black src/structurizr/ tests/ examples/ setup.py | |||
flake8 src/structurizr/ tests/ examples/ setup.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove this line before merging. make qa
is intended for applying style fixes and not for checking for problems. You can either use tox -e flake8
for that or create a separate command make qc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, sure.
Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
add_nearest_neighbours()
was calling_add_element()
withadd_relationships=True
which was resulting in the duplication. As the relationships are added explicitly based on the type filter, then simply setting this toFalse
solves the problem. Also added a check toView
to protect against other cases where someone may be unknowingly adding the same relationship twice.Got caught out by
flake8
yet again, so added this tomake qa
and updated the examples to be compliant.Also fixed issue 40 whilst in the area, so diagrams with blank descriptions in the Structurizr UI can now be loaded through the Python API. Not discovered any other similar incompatibilities yet.
THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE Apache License v.2.0. YOU MAY OBTAIN A COPY OF THE LICENSE AT https://www.apache.org/licenses/LICENSE-2.0.
THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.