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

Rename Angle::as_* into Angle::from_* #43

Merged
merged 2 commits into from
Mar 29, 2024
Merged

Conversation

rhannequin
Copy link
Owner

The initial names as_radians, as_degrees and as_hours were misleading since we made Angle a single class for handling all units of angles, always stored in radians.

It use to make sense when we had classes like Radian, Degree and Hour, but now that an angle is always stored in radians, as_* could let the reader think that the angle is going to be initialized in the specified unit.

These methods have been renamed into the following:

  • ::from_radians
  • ::from_degrees
  • ::from_hours
  • ::from_dms
  • ::from_hms

The initial names `as_radians`, `as_degrees` and `as_hours` were
misleading since we made `Angle` a single class for handling all units
of angles, always stored in radians.

It use to make sense when we had classes like `Radian`, `Degree` and
`Hour`, but now that an angle is always stored in radians, `as_*` could
let the reader think that the angle is going to be initialized in the
specified unit.

These methods have been renamed into the following:
* `::from_radians`
* `::from_degrees`
* `::from_hours`
* `::from_dms`
* `::from_hms`
@rhannequin rhannequin self-assigned this Mar 29, 2024
@rhannequin rhannequin merged commit 28bd4a4 into main Mar 29, 2024
8 checks passed
@rhannequin rhannequin deleted the rename-as-into-from branch March 29, 2024 15:51
rhannequin added a commit that referenced this pull request Mar 29, 2024
 ## 0.3.0 - 2024-03-29

_If you are upgrading: please see [`UPGRADING.md`]._

 ### Improvements

* Drop `Angle#==` ([#42])
* Improved accuracy with Sun's location predictions ([#41])

 ### Breaking changes

* **breaking:** Difference between true and apparent ecliptic and equatorial
  coordinates ([#41])
* **breaking:** Rename `Angle::as_*` into `Angle::from_*` ([#43])

[#41]: #41
[#42]: #42
[#43]: #43
rhannequin added a commit that referenced this pull request Mar 29, 2024
 ## 0.3.0 - 2024-03-29

_If you are upgrading: please see [`UPGRADING.md`]._

 ### Improvements

* Drop `Angle#==` ([#42])
* Improved accuracy with Sun's location predictions ([#41])

 ### Breaking changes

* **breaking:** Difference between true and apparent ecliptic and equatorial coordinates ([#41])
* **breaking:** Rename `Angle::as_*` into `Angle::from_*` ([#43])

[#41]: #41
[#42]: #42
[#43]: #43
rhannequin added a commit that referenced this pull request Mar 29, 2024
 ## 0.3.0 - 2024-03-29

_If you are upgrading: please see [`UPGRADING.md`]._

 ### Improvements

* Drop `Angle#==` ([#42])
* Improved accuracy with Sun's location predictions ([#41])

 ### Breaking changes

* **breaking:** Difference between true and apparent ecliptic and equatorial coordinates ([#41])
* **breaking:** Rename `Angle::as_*` into `Angle::from_*` ([#43])

[#41]: #41
[#42]: #42
[#43]: #43
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.

1 participant