TASK: Add Measurement class (#18)#48
TASK: Add Measurement class (#18)#48Poorna-Chandra-D wants to merge 5 commits intoTheGittyPerson:mainfrom
Measurement class (#18)#48Conversation
0002fff to
b6d0849
Compare
|
@Poorna-Chandra-D Since this is a duplicate of #46 (@P-r-e-m-i-u-m submitted the PR first but you started working first, I thought it would be unfair to choose one), are you interested in working with @P-r-e-m-i-u-m? It's totally fine if you prefer to work solo (@P-r-e-m-i-u-m has already worked on many PRs so don't feel guilty). If you want to collaborate with him, you may discuss with him in his PR (or tag him here). |
171f367 to
1ef13e7
Compare
|
Updated your branch 👍 |
1ef13e7 to
da2cc7a
Compare
- Add src/measurement.py with Measurement class that stores a value and unit - Measurement supports meters, centimeters, feet, and inches - Updated Person.height to use Measurement type instead of float - Added Person.set_height() method to set height with unit support - Updated introduce() to display height using Measurement string representation Closes TheGittyPerson#18 # Conflicts: # theperson/measurement.py # theperson/person.py # Conflicts (2nd rebase conflict): # theperson/person.py
da2cc7a to
beb8603
Compare
Signed-off-by: Morpheus <167074500+thegittyperson@users.noreply.github.com>
Measurement class (#18)
|
@Poorna-Chandra-D are you able to address my review comments? If you're busy or unable to do so, I completely understand 👍 |
|
Thanks for checking in. I am okay with @P-r-e-m-i-u-m incorporating my Measurement updates and your review suggestions into #46. Since #48 is a duplicate, feel free to proceed with #46 as the main PR. |
|
@TheGittyPerson confirming: the commented review points have been addressed in the updated Measurement implementation (VALID_UNITS now includes aliases, comparison behavior is consistent with exact equality/ordering, and total_ordering is used so <=/>=/ > are supported). |
|
"Incorporated review feedback from #48 — rejected bool in value check, added lt and @total_ordering for full comparison support. Ready for re-review @TheGittyPerson 👍" |
TheGittyPerson
left a comment
There was a problem hiding this comment.
Here are some more suggestions for improvement. Please do ask if you have any questions
|
Please ignore the above change request comment, it was meant to go to Premium's PR (I got confused because the titles are the same lol) |
|
This pull request has been inactive for some time, and will therefore be marked as 'stale'. |
Summary
Adds a
Measurementclass to represent a numeric measurement with a unit (meters, centimeters, feet, inches), and integrates it into thePersonclass to replace the barefloatheight attribute.Changes
src/measurement.py— addsMeasurementclass with:valueandunitattributesmeters,centimeters,feet,inches)__str__returning a human-readable representation (1.8 meters)__repr__for developer conveniencesrc/person.py:heightattribute type changed fromfloat | NonetoMeasurement | Noneintroduce()displaysself.heightnaturally viastr(Measurement)outputset_height(value, unit)method for convenient height assignment.Usage
Closes #18