Skip to content

Commit 83fe3f3

Browse files
committed
DOC: reformat install.rst testing section
TST: run.test() now defaults warnings based on release version
1 parent 85981eb commit 83fe3f3

File tree

2 files changed

+54
-56
lines changed

2 files changed

+54
-56
lines changed

doc/source/install.rst

+31-43
Original file line numberDiff line numberDiff line change
@@ -192,32 +192,31 @@ installed), make sure you have `nose
192192

193193
::
194194

195-
$ nosetests pandas
196-
..........................................................................
197-
.......................S..................................................
198-
..........................................................................
199-
..........................................................................
200-
..........................................................................
201-
..........................................................................
202-
..........................................................................
203-
..........................................................................
204-
..........................................................................
205-
..........................................................................
206-
.................S........................................................
207-
....
195+
>>> import pandas as pd
196+
>>> pd.test()
197+
Running unit tests for pandas
198+
pandas version 0.18.0
199+
numpy version 1.10.2
200+
pandas is installed in pandas
201+
Python version 2.7.11 |Continuum Analytics, Inc.|
202+
(default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)]
203+
nose version 1.3.7
204+
..................................................................S......
205+
........S................................................................
206+
.........................................................................
207+
208208
----------------------------------------------------------------------
209-
Ran 818 tests in 21.631s
209+
Ran 9252 tests in 368.339s
210210

211-
OK (SKIP=2)
211+
OK (SKIP=117)
212212

213213
Dependencies
214214
------------
215215

216216
* `setuptools <http://pythonhosted.org/setuptools>`__
217217
* `NumPy <http://www.numpy.org>`__: 1.7.1 or higher
218-
* `python-dateutil <http://labix.org/python-dateutil>`__ 1.5 or higher
219-
* `pytz <http://pytz.sourceforge.net/>`__
220-
* Needed for time zone support
218+
* `python-dateutil <http://labix.org/python-dateutil>`__: 1.5 or higher
219+
* `pytz <http://pytz.sourceforge.net/>`__: Needed for time zone support
221220

222221
.. _install.recommended_dependencies:
223222

@@ -226,7 +225,7 @@ Recommended Dependencies
226225

227226
* `numexpr <https://github.com/pydata/numexpr>`__: for accelerating certain numerical operations.
228227
``numexpr`` uses multiple cores as well as smart chunking and caching to achieve large speedups.
229-
If installed, must be Version 2.1 or higher.
228+
If installed, must be Version 2.1 or higher. Version 2.4.6 or higher on Windows is highly recommended.
230229

231230
* `bottleneck <http://berkeleyanalytics.com/bottleneck>`__: for accelerating certain types of ``nan``
232231
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups.
@@ -246,21 +245,16 @@ Optional Dependencies
246245
version. Version 0.19.1 or higher.
247246
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions
248247
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage. Version 3.0.0 or higher required, Version 3.2.1 or higher highly recommended.
249-
* `SQLAlchemy <http://www.sqlalchemy.org>`__: for SQL database support. Version 0.8.1 or higher recommended.
250-
* Besides SQLAlchemy, you also need a database specific driver.
251-
Examples of such drivers are `psycopg2 <http://initd.org/psycopg/>`__ for PostgreSQL
252-
or `pymysql <https://github.com/PyMySQL/PyMySQL>`__ for MySQL. For
253-
`SQLite <https://docs.python.org/3.5/library/sqlite3.html>`__ this is
254-
included in Python's standard library by default.
255-
You can find an overview of supported drivers for each SQL dialect in the
256-
`SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__.
248+
* `SQLAlchemy <http://www.sqlalchemy.org>`__: for SQL database support. Version 0.8.1 or higher recommended. Besides SQLAlchemy, you also need a database specific driver. You can find an overview of supported drivers for each SQL dialect in the `SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__. Some common drivers are:
249+
250+
- `psycopg2 <http://initd.org/psycopg/>`__: for PostgreSQL
251+
- `pymysql <https://github.com/PyMySQL/PyMySQL>`__: for MySQL.
252+
- `SQLite <https://docs.python.org/3.5/library/sqlite3.html>`__: for SQLite, this is included in Python's standard library by default.
253+
257254
* `matplotlib <http://matplotlib.sourceforge.net/>`__: for plotting
258-
* `statsmodels <http://statsmodels.sourceforge.net/>`__
259-
* Needed for parts of :mod:`pandas.stats`
260-
* `openpyxl <http://packages.python.org/openpyxl/>`__, `xlrd/xlwt <http://www.python-excel.org/>`__
261-
* Needed for Excel I/O
262-
* `XlsxWriter <https://pypi.python.org/pypi/XlsxWriter>`__
263-
* Alternative Excel writer
255+
* `statsmodels <http://statsmodels.sourceforge.net/>`__: Needed for parts of :mod:`pandas.stats`
256+
* `openpyxl <http://packages.python.org/openpyxl/>`__, `xlrd/xlwt <http://www.python-excel.org/>`__: Needed for Excel I/O
257+
* `XlsxWriter <https://pypi.python.org/pypi/XlsxWriter>`__: Alternative Excel writer
264258
* `Jinja2 <http://jinja.pocoo.org/>`__: Template engine for conditional HTML formatting.
265259
* `boto <https://pypi.python.org/pypi/boto>`__: necessary for Amazon S3
266260
access.
@@ -271,16 +265,10 @@ Optional Dependencies
271265
<http://www.pygtk.org/>`__, `xsel
272266
<http://www.vergenet.net/~conrad/software/xsel/>`__, or `xclip
273267
<http://sourceforge.net/projects/xclip/>`__: necessary to use
274-
:func:`~pandas.io.clipboard.read_clipboard`. Most package managers on Linux
275-
distributions will have xclip and/or xsel immediately available for
276-
installation.
268+
:func:`~pandas.io.clipboard.read_clipboard`. Most package managers on Linux distributions will have ``xclip`` and/or ``xsel`` immediately available for installation.
277269
* Google's `python-gflags <http://code.google.com/p/python-gflags/>`__
278-
and `google-api-python-client <http://github.com/google/google-api-python-client>`__
279-
* Needed for :mod:`~pandas.io.gbq`
280-
* `setuptools <https://pypi.python.org/pypi/setuptools/>`__
281-
* Needed for :mod:`~pandas.io.gbq` (specifically, it utilizes `pkg_resources`)
282-
* `httplib2 <http://pypi.python.org/pypi/httplib2>`__
283-
* Needed for :mod:`~pandas.io.gbq`
270+
and `google-api-python-client <http://github.com/google/google-api-python-client>`__: Needed for :mod:`~pandas.io.gbq`
271+
* `httplib2 <http://pypi.python.org/pypi/httplib2>`__: Needed for :mod:`~pandas.io.gbq`
284272
* One of the following combinations of libraries is needed to use the
285273
top-level :func:`~pandas.io.html.read_html` function:
286274

@@ -327,5 +315,5 @@ Optional Dependencies
327315

328316
Without the optional dependencies, many useful features will not
329317
work. Hence, it is highly recommended that you install these. A packaged
330-
distribution like `Enthought Canopy
318+
distribution like `Anaconda <http://docs.continuum.io/anaconda/>`__, or `Enthought Canopy
331319
<http://enthought.com/products/canopy>`__ may be worth considering.

pandas/util/nosetester.py

+23-13
Original file line numberDiff line numberDiff line change
@@ -178,28 +178,38 @@ def test(self, label='fast', verbose=1, extra_argv=None,
178178
doctest.master = None
179179

180180
if raise_warnings is None:
181-
raise_warnings = 'release'
181+
182+
# default based on if we are released
183+
from pandas import __version__
184+
from distutils.version import StrictVersion
185+
try:
186+
StrictVersion(__version__)
187+
raise_warnings = 'release'
188+
except ValueError:
189+
raise_warnings = 'develop'
182190

183191
_warn_opts = dict(develop=(DeprecationWarning, RuntimeWarning),
184192
release=())
185193
if isinstance(raise_warnings, string_types):
186194
raise_warnings = _warn_opts[raise_warnings]
187195

188196
with warnings.catch_warnings():
189-
# Reset the warning filters to the default state,
190-
# so that running the tests is more repeatable.
191-
warnings.resetwarnings()
192-
# Set all warnings to 'warn', this is because the default 'once'
193-
# has the bad property of possibly shadowing later warnings.
194-
warnings.filterwarnings('always')
195-
# Force the requested warnings to raise
196-
for warningtype in raise_warnings:
197-
warnings.filterwarnings('error', category=warningtype)
198-
# Filter out annoying import messages.
199-
warnings.filterwarnings("ignore", category=FutureWarning)
200197

201-
from numpy.testing.noseclasses import NumpyTestProgram
198+
if len(raise_warnings):
202199

200+
# Reset the warning filters to the default state,
201+
# so that running the tests is more repeatable.
202+
warnings.resetwarnings()
203+
# Set all warnings to 'warn', this is because the default 'once'
204+
# has the bad property of possibly shadowing later warnings.
205+
warnings.filterwarnings('always')
206+
# Force the requested warnings to raise
207+
for warningtype in raise_warnings:
208+
warnings.filterwarnings('error', category=warningtype)
209+
# Filter out annoying import messages.
210+
warnings.filterwarnings("ignore", category=FutureWarning)
211+
212+
from numpy.testing.noseclasses import NumpyTestProgram
203213
argv, plugins = self.prepare_test_args(
204214
label, verbose, extra_argv, doctests, coverage)
205215
t = NumpyTestProgram(argv=argv, exit=False, plugins=plugins)

0 commit comments

Comments
 (0)