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

WIP check for stability for dec near poles #26

Closed
wants to merge 1 commit into from

Conversation

taldcroft
Copy link
Member

Description

This was my initial approach, but I stopped working after getting some unexpected results and deciding it wasn't that high a priority. For the record this is what I had.

Testing

  • Passes unit tests on MacOS, linux, Windows (at least one required)
  • Functional testing

Fixes #10

def _check_dec_for_stability(self, dec):
if np.any(np.abs(dec) > MAX_DEC_FOR_STABILITY):
warnings.warn(f'Declination abs(value) > {MAX_DEC_FOR_STABILITY}'
f', numerical problems possible')
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to supply a stacklevel, and thinking on this now maybe that is why I wasn't seeing a warning when I expected it in some ipython interactive testing. That way the warning shows the context of the user call that generated the warning, except that sometimes it is not a fixed number of stack levels up to the user call. Ugh.

Or maybe better is to put this in a warnings context manager to set the warning filter here to 'always'. That has the downside that it becomes impossible to disable the warning.

@taldcroft
Copy link
Member Author

Not worth the effort.

@taldcroft taldcroft closed this Apr 11, 2020
@taldcroft taldcroft deleted the check-stability branch April 11, 2020 10:55
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.

Warning for equatorial calculations above 89.99999
1 participant