Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Add Point class to main#1

Merged
GenericError merged 18 commits into
masterfrom
development
Dec 18, 2017
Merged

Add Point class to main#1
GenericError merged 18 commits into
masterfrom
development

Conversation

@GenericError

Copy link
Copy Markdown
Owner

Adding the Point class to the main branch, getting ready for a first release.

Created .gitignore to ignore .pyc files
Created the test file and implemented one test that creates a Point instance
Added x and y coordinates to the Point class. If no coordinates are supplied when the point is created, it defaults to (0, 0)
Added a string representation of the Point class
Added a string representation of the Point class
Cleaned up the formatting to help improve PEP compliance, and added docstrings to help explain the code
Added a function that determines what quadrant of the cartesian plane the point is located in, as well as the tests that confirm it is correct
Implemented a distance function which calculates the distance between a given point and the point the method is executed on, otherwise the distance from the origin
Added codecov and travis integration
Added build, ebert and codecov badges to the README file
Adjusted the structure of the algorithm that determines which quadrant a point lies in
Removed unnecessary logic from the distance() function
Improved the distance function by utilising a named tuple as a default argument
Implemented an equality dunder function (__eq__) for the Point class. This will ensure that when Points are compared, they will be considered the same if they share the same coordinates with one another, regardless of whether they are internally different instances of the Point class
Added extra tests for the __eq__ method to ensure that objects that don't match are not considered equal
Added a method to the Point class that will return the midpoint of the point the method is executed on and another given point (or the default of the origin)
@GenericError

Copy link
Copy Markdown
Owner Author

Ebert has finished reviewing this Pull Request and has found:

  • 1 possible new issue (including those that may have been commented here).

But beware that this branch is 2 commits behind the GenericError:master branch, and a review of an up to date branch would produce more accurate results.

You can see more details about this review at https://ebertapp.io/github/GenericError/cartesian/pulls/1.

Comment thread cartesian.py
return True
return False

def quadrant(self):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyclomatic complexity is too high in method quadrant. (7)

@codecov-io

codecov-io commented Dec 18, 2017

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@050d9a9). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             master     #1   +/-   ##
=======================================
  Coverage          ?   100%           
=======================================
  Files             ?      2           
  Lines             ?    100           
  Branches          ?      0           
=======================================
  Hits              ?    100           
  Misses            ?      0           
  Partials          ?      0
Impacted Files Coverage Δ
tests.py 100% <100%> (ø)
cartesian.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 050d9a9...58c3c78. Read the comment docs.

@GenericError GenericError merged commit 3f6411c into master Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants