Deprecate constants context manager
See original GitHub issueAs 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:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.