Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More consistent setters #124

Merged
merged 6 commits into from
Oct 19, 2020
Merged

More consistent setters #124

merged 6 commits into from
Oct 19, 2020

Conversation

bdice
Copy link
Member

@bdice bdice commented Oct 17, 2020

Description

I made property setters look the same:

  • Input parameter is named value.
  • Property setting logic is always first (if value > 0:), error raising is always second (else: raise). This is my preference because it ensures the expected path is first (easier to read) and the condition matches the error message text (if value > 0 matches the error Value must be greater than zero. and is thus easier to think through).

I also added setters for ellipse area and ellipsoid volume. (I specifically needed ellipsoid volume but wanted ellipse area to match.)

Motivation and Context

Resolves #114. I did not know the issue already existed and had been assigned to @Tobias-Dwyer, I just wanted to add the volume setter for ellipsoids and figured I'd improve the code base at the same time.

Types of Changes

  • Documentation update
  • Bug fix
  • New feature
  • Breaking change1

1The change breaks (or has the potential to break) existing functionality.

Checklist:

@bdice bdice self-assigned this Oct 17, 2020
@bdice bdice added the enhancement New feature or request label Oct 17, 2020
@vyasr
Copy link
Contributor

vyasr commented Oct 18, 2020

@Tobias-Dwyer this seems like a good PR for you to review :)

Copy link
Contributor

@Tobias-Dwyer Tobias-Dwyer left a comment

Choose a reason for hiding this comment

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

All changes look Rolex to me :D . Thanks for adding the volume setters. Can you do the same thing for setting the surface area? just scale it? (if so I could probably go in and add it)

@bdice
Copy link
Member Author

bdice commented Oct 19, 2020

@Tobias-Dwyer Let’s open an issue and do surface areas / perimeters / etc. in a separate PR? I think the scope of this is complete as it is. (Fix all existing setters and add just the ones I needed immediately.)

@Tobias-Dwyer
Copy link
Contributor

Yep, I agree :D

@bdice bdice merged commit 216c0bd into master Oct 19, 2020
@bdice bdice deleted the feature/consistent-setters branch October 19, 2020 16:56
@bdice
Copy link
Member Author

bdice commented Oct 19, 2020

@Tobias-Dwyer Issue created: #125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make setter names consistent
3 participants