Skip to content

Improve handling of negative values for DMSAngles and DDMAngle classes #158

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

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

nicgowans
Copy link
Contributor

This pull request primarily fixes an issue with DMSAngle and DDMAngle classes where negative values were lost when the degree term was an integer equal to 0. For example, if -0.0167 was provided to dec2dms(), the returned value would be a DMSAngle initialised with degree=-0, which is stored as 0 thus becoming positive.

A method for the mod operator % is also added for both classes.

Additionally, there are a few changes which are outside the initial scope of this pull request but needed to be addressed due to failing CI workflows, including:

  • python 3.7 not found with ubuntu-latest. Python 3.13 was adopted in its place
  • list formatting errors flagged by python 3.13 in test_convert.py
  • numpy deprecation warnings in transform.py due to ambiguous indexing of arrays : DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

nicgowans and others added 4 commits February 14, 2025 10:15
…where degree is supplied as integer by introducing positive as a kwarg; create mod operators for DMSAngle and DDMAngle; update related dec2dms(), dec2ddm(), hp2dms(), hp2ddm() functions; update associated tests.
Upgrade python to current version (3.13) as 3.7 has reached end of life and is not supported with ubuntu-latest
revert to 3.11 for issues of code conventions which raise warnings in 3.13
…atting in test_convert.py; update array index for numpy deprecation warnings.
Copy link
Collaborator

@harry093 harry093 left a comment

Choose a reason for hiding this comment

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

Thanks for picking that up and fixing, Nic. And I appreciate the other changes, too.

@harry093 harry093 merged commit 476a8d3 into GeoscienceAustralia:master Feb 14, 2025
1 check passed
@nicgowans
Copy link
Contributor Author

No worries, Craig!

@harry093
Copy link
Collaborator

@nicgowans those changes have been included in GeodePy v0.6.0 and it has now been pushed to PyPI

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