question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecate constants context manager

See original GitHub issue

As stated in the diff of #8517:

The context manager may be used at any time in a Python session, but it
uses the prior version only for `astropy.constants`, and not for any
other subpackage such as `astropy.units`.

due to this warning (removed in the aforementioned PR):

Units such as ``u.M_sun`` will use the current version of the
corresponding constant. When using prior versions of the constants,
quantities should be constructed with constants instead of units.

With ScienceState enabled for constants and units, perhaps the constants context manager is more confusing than helpful now? Should we deprecate it and ask users to use ScienceState exclusively? Or is there still a need for context manager?

cc @stargaser and @mhvk

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
bsipoczcommented, Jun 18, 2019

And since we are not supposed to deprecate stuff in LTS (if I remember @bsipocz correctly), this will have to wait till 4.1?

imo LTS is not the best place to add a new experimental API as then we need to stick with it for quite a while. but LTS is the best place to clean up APIs, deprecate and remove stuff, and to clear up previous deprecations.

1reaction
mhvkcommented, Jun 18, 2019

My addendum to APE 2 - https://github.com/astropy/astropy-APEs/pull/20 - was exactly the reverse: that LTS is the right time to add deprecation warnings, since most people will not be supporting two LTS at the same time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

contextlib — Utilities for with-statement contexts ... - Python Docs
This module provides utilities for common tasks involving the with statement. For more information see also Context Manager Types and With Statement Context ......
Read more >
How to fix with statement deprecation warning - Stack Overflow
and every time I run this, Python gives me the DeprecationWarning: With-statements now directly support multiple context managers with settings( ...
Read more >
Automatic differentiation package - torch.autograd - PyTorch
The Variable API has been deprecated: Variables are no longer necessary to ... Context manager that manages autograd profiler state and holds a...
Read more >
Context Managers and Python's with Statement
In this step-by-step tutorial, you'll learn what the Python with statement is and how to use it with existing context managers.
Read more >
DEPRECATE Pragma - Database - Oracle Help Center
The DEPRECATE pragma marks a PL/SQL element as deprecated. The compiler issues warnings for uses of pragma DEPRECATE or of deprecated elements.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found