Skip to content

Commit 895f8cd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into to_html-to_string
* upstream/master: BUILD: Simplifying contributor dependencies (pandas-dev#23522) BUG/REF: TimedeltaIndex.__new__ (pandas-dev#23539)
2 parents 87297cd + 592fd64 commit 895f8cd

21 files changed

+511
-213
lines changed

ci/code_checks.sh

+15-5
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99
# In the future we may want to add the validation of docstrings and other checks here.
1010
#
1111
# Usage:
12-
# $ ./ci/code_checks.sh # run all checks
13-
# $ ./ci/code_checks.sh lint # run linting only
14-
# $ ./ci/code_checks.sh patterns # check for patterns that should not exist
15-
# $ ./ci/code_checks.sh doctests # run doctests
12+
# $ ./ci/code_checks.sh # run all checks
13+
# $ ./ci/code_checks.sh lint # run linting only
14+
# $ ./ci/code_checks.sh patterns # check for patterns that should not exist
15+
# $ ./ci/code_checks.sh doctests # run doctests
16+
# $ ./ci/code_checks.sh dependencies # check that dependencies are consistent
1617

1718
echo "inside $0"
1819
[[ $LINT ]] || { echo "NOT Linting. To lint use: LINT=true $0 $1"; exit 0; }
19-
[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "doctests" ]] || { echo "Unknown command $1. Usage: $0 [lint|patterns|doctests]"; exit 9999; }
20+
[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "doctests" || "$1" == "dependencies" ]] \
21+
|| { echo "Unknown command $1. Usage: $0 [lint|patterns|doctests|dependencies]"; exit 9999; }
2022

2123
source activate pandas
24+
BASE_DIR="$(dirname $0)/.."
2225
RET=0
2326
CHECK=$1
2427

@@ -172,4 +175,11 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
172175

173176
fi
174177

178+
### DEPENDENCIES ###
179+
if [[ -z "$CHECK" || "$CHECK" == "dependencies" ]]; then
180+
MSG='Check that requirements-dev.txt has been generated from environment.yml' ; echo $MSG
181+
$BASE_DIR/scripts/generate_pip_deps_from_conda.py --compare
182+
RET=$(($RET + $?)) ; echo $MSG "DONE"
183+
fi
184+
175185
exit $RET

ci/environment-dev.yaml

-20
This file was deleted.

ci/requirements-optional-conda.txt

-28
This file was deleted.

ci/requirements_dev.txt

-16
This file was deleted.

doc/source/contributing.rst

+3-8
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ We'll now kick off a three-step process:
170170
.. code-block:: none
171171
172172
# Create and activate the build environment
173-
conda env create -f ci/environment-dev.yaml
173+
conda env create -f environment.yml
174174
conda activate pandas-dev
175175
176176
# or with older versions of Anaconda:
@@ -180,9 +180,6 @@ We'll now kick off a three-step process:
180180
python setup.py build_ext --inplace -j 4
181181
python -m pip install -e .
182182
183-
# Install the rest of the optional dependencies
184-
conda install -c defaults -c conda-forge --file=ci/requirements-optional-conda.txt
185-
186183
At this point you should be able to import pandas from your locally built version::
187184

188185
$ python # start an interpreter
@@ -221,14 +218,12 @@ You'll need to have at least python3.5 installed on your system.
221218
. ~/virtualenvs/pandas-dev/bin/activate
222219
223220
# Install the build dependencies
224-
python -m pip install -r ci/requirements_dev.txt
221+
python -m pip install -r requirements-dev.txt
222+
225223
# Build and install pandas
226224
python setup.py build_ext --inplace -j 4
227225
python -m pip install -e .
228226
229-
# Install additional dependencies
230-
python -m pip install -r ci/requirements-optional-pip.txt
231-
232227
Creating a branch
233228
-----------------
234229

doc/source/whatsnew/v0.24.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ Backwards incompatible API changes
248248

249249
- A newly constructed empty :class:`DataFrame` with integer as the ``dtype`` will now only be cast to ``float64`` if ``index`` is specified (:issue:`22858`)
250250
- :meth:`Series.str.cat` will now raise if `others` is a `set` (:issue:`23009`)
251+
- Passing scalar values to :class:`DatetimeIndex` or :class:`TimedeltaIndex` will now raise ``TypeError`` instead of ``ValueError`` (:issue:`23539`)
251252

252253
.. _whatsnew_0240.api_breaking.deps:
253254

@@ -971,6 +972,7 @@ Deprecations
971972
- The class ``FrozenNDArray`` has been deprecated. When unpickling, ``FrozenNDArray`` will be unpickled to ``np.ndarray`` once this class is removed (:issue:`9031`)
972973
- Deprecated the `nthreads` keyword of :func:`pandas.read_feather` in favor of
973974
`use_threads` to reflect the changes in pyarrow 0.11.0. (:issue:`23053`)
975+
- Constructing a :class:`TimedeltaIndex` from data with ``datetime64``-dtyped data is deprecated, will raise ``TypeError`` in a future version (:issue:`23539`)
974976

975977
.. _whatsnew_0240.deprecations.datetimelike_int_ops:
976978

environment.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: pandas-dev
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
# required
7+
- NumPy
8+
- python=3
9+
- python-dateutil>=2.5.0
10+
- pytz
11+
12+
# development
13+
- Cython>=0.28.2
14+
- flake8
15+
- flake8-comprehensions
16+
- flake8-rst
17+
- hypothesis>=3.58.0
18+
- isort
19+
- moto
20+
- pytest>=3.6
21+
- setuptools>=24.2.0
22+
- sphinx
23+
- sphinxcontrib-spelling
24+
25+
# optional
26+
- beautifulsoup4>=4.2.1
27+
- blosc
28+
- bottleneck>=1.2.0
29+
- fastparquet>=0.1.2
30+
- gcsfs
31+
- html5lib
32+
- ipython>=5.6.0
33+
- ipykernel
34+
- jinja2
35+
- lxml
36+
- matplotlib>=2.0.0
37+
- nbsphinx
38+
- numexpr>=2.6.1
39+
- openpyxl
40+
- pyarrow>=0.7.0
41+
- pymysql
42+
- pytables>=3.4.2
43+
- pytest-cov
44+
- pytest-xdist
45+
- s3fs
46+
- scipy>=0.18.1
47+
- seaborn
48+
- sqlalchemy
49+
- statsmodels
50+
- xarray
51+
- xlrd
52+
- xlsxwriter
53+
- xlwt

pandas/core/arrays/datetimes.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ def __new__(cls, values, freq=None, tz=None, dtype=None):
234234

235235
result = cls._simple_new(values, freq=freq, tz=tz)
236236
if freq_infer:
237-
inferred = result.inferred_freq
238-
if inferred:
239-
result.freq = to_offset(inferred)
237+
result.freq = to_offset(result.inferred_freq)
240238

241239
# NB: Among other things not yet ported from the DatetimeIndex
242240
# constructor, this does not call _deepcopy_if_needed

0 commit comments

Comments
 (0)