[SciPy-User] ANN: SciPy 1.0 beta release

Thomas Jollans tjol at tjol.eu
Fri Sep 29 05:02:52 EDT 2017


On 2017-09-28 19:56, Joe Harrington wrote:
> To the minor point about -Wd, is scipy turning off DeprecationWarnings
> by default, or is some environment like ipython doing it?

Python turns them off by default; ipython turns them ON (so a lot of
users actually see them)

> I see numpy deprecation warnings all over the place, until I fix them.
> They're not turned off by default.  I'm running in straight Python on
> Ubuntu Linux, with numpy and sometimes scipy.  I'm not using ipython.
> This behavior has been true in all versions of Python, numpy, and scipy
> I've used.

That's interesting, since the default Pythons on Ubuntu don't show
deprecation warnings:

0:tjol at krikkit:~% python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.warn(DeprecationWarning('foo'))
>>>
0:tjol at krikkit:~% python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.warn(DeprecationWarning('foo'))
>>>
0:tjol at krikkit:~% ipython
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import warnings

In [2]: warnings.warn(DeprecationWarning('foo'))
/home/tjol/.local/bin/ipython:1: DeprecationWarning: foo
  #!/usr/bin/python3

In [3]:
Do you really want to exit ([y]/n)?
0:tjol at krikkit:~% python3 -Wd
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.warn(DeprecationWarning('foo'))
__main__:1: DeprecationWarning: foo
>>>


> 
> So, I think that paragraph could use another look, from the perspective
> of not just the preferred environment of the developer who wrote it.  If
> SciPy turns off DeprecationWarnings and numpy doesn't, does this really
> make sense?  Because numpy doesn't.
> 
> If it's an environment doing it, then it should be noted that -Wd is
> needed only in those environments.  Finally, it should be noted that -Wd
> is shorthand for -W default, which is all the Python man page talks
> about.  Searching for -Wd there comes up with nothing.
> 
> --jh--
> 
> On Thu, 28 Sep 2017 11:21:50 -0400, Warren Weckesser
> <warren.weckesser at gmail.com> wrote:
> 
>> On Thu, Sep 28, 2017 at 9:44 AM, Joe Harrington <jh at physics.ucf.edu> wrote:
>>
>>> Ok, I saw the -Wd at the end, but it just requests the default, so how
>>> does this change anything?
>>
>>
>>
>> Here's a fun sentence from the documentation at
>> https://docs.python.org/3.6/library/warnings.html#updating-code-for-new-versio>
>> ns-of-python
>> regarding the option -Wd:
>>
>>> This enables default handling for all warnings, including those that are
>> ignored by default.
>>
>> Fortunately, the sentences previous to that one explain that when -Wd is
>> used, DeprecationWarnings (usually ignored) are made visible.
>>
>> Warren
>>
>>
>> If it's just an ipython benefit, say that
>>> it's recommended for ipython users.
>>>
>>> Also, remember that for the vast majority of users, they don't install a
>>> new version, they suddenly discover that their system now has one,
>>> through some software update.  Think students and casual users, as
>>> opposed to PhD research scientists experienced in software management.
>>>
>>> But, what we really need is more information about what to DO about the
>>> deprecations.  Not, "we pulled the rug out from under you", but "so that
>>> we don't pull the rug out from under you, do this".  And, in a
>>> more-obvious place than the release notes, which most users don't ever
>>> see.
>>>
>>> --jh--
>>>
>>>> Um...  This commit has to do with wheels, not deprecations.  Great that
>>>> we're flying with wheels up, though. :-)
>>>>
>>>> --jh--
>>>>
>>>> On Thu, 28 Sep 2017 21:48:41 +1300,  Ralf Gommers <ralf.gommers at gmail.com
>>>>
>>>> wrote:
>>>>
>>>>> Done in https://github.com/scipy/scipy/pull/7947
>>>>
>>>>>> On Mon, Sep 18, 2017 at 1:16 AM, Joe Harrington <jh at physics.ucf.edu>
>>>>>> wrote:
>>>>>>
>>>>>>> On Sun, 17 Sep 2017 22:48:35 +1200 Ralf Gommers <
>>> ralf.gommers at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I'm excited to be able to announce the availability of the first
>>> beta
>>>>>>>> release of Scipy 1.0.
>>>>>>>>
>>>>>>> [I won't quote the entire release notes!]
>>>>>>>
>>>>>>> Awesome news, looooong in the making!
>>>>>>>
>>>>>>> The number of deprecations and removals is understandably large.
>>>>>>> I think we need a centralized resource for navigating deprecations,
>>>>>>> removals, and changes.  It could be a simple web page, or a more
>>>>>>> involved database.  It should list the change, give or link to the
>>>>>>> rationale, and state the date and package version number.  Most
>>>>>>> importantly, it should give the suggested replacement(s).
>>>>>>>
>>>>>>> Googling "scipy deprecation" found only this page, plus a bunch of
>>>>>>> release notes and discussions.  The page was last updated on Jan 16,
>>>>>>> 2017, and is limited to C-API deprecations:
>>>>>>>
>>>>>>> https://docs.scipy.org/doc/numpy-dev/reference/c-api.
>>> deprecations.html
>>>>>>>
>>>>>>> Even once such a document/page/searchable database exists, many will
>>> be
>>>>>>> unaware of it, or not know where to find it, so referring to it at the
>>>>>>> top of any list of deprecations/removals would be good.
>>>>>>>
>>>>>>> Once it exists, deprecations could be entered before being
>>> implemented,
>>>>>>> and deprecation warnings could refer to an index number in this
>>>>>>> resource, where the user could go for more information on how to fix
>>> the
>>>>>>> issue.
>>>>>>>
>>>>>>
>>>>>> Thanks for your thoughts Joe! I'm not sure a database is the way to go,
>>>>>> but you make a good point. We have to guide users a bit more in what
>>> to do
>>>>>> about deprecations. I think clear instructions about upgrading in both
>>> the
>>>>>> html docs and release announcements would be useful. I don't think
>>> there's
>>>>>> many users who run ``python -Wd my_code.py`` .(making depreacations
>>> that
>>>>>> affect your code visible) ....
>>>>>>
>>>>>
>>>>
>>>>
>>> _______________________________________________
>>> SciPy-User mailing list
>>> SciPy-User at python.org
>>> https://mail.python.org/mailman/listinfo/scipy-user
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at python.org
> https://mail.python.org/mailman/listinfo/scipy-user
> 


More information about the SciPy-User mailing list