Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silence a couple of warnings in tests #2727

Merged
merged 1 commit into from
Jan 30, 2019
Merged

Conversation

max-sixty
Copy link
Collaborator

The only other warning is:


xarray/tests/test_dataset.py::TestDataset::test_convert_dataframe_with_many_types_and_multiindex
  /Users/maximilian/workspace/xarray/xarray/core/dataset.py:3146: FutureWarning: Converting timezone-aware DatetimeArray to timezone-naive ndarray with 'datetime64[ns]' dtype. In the future, this will return an ndarray with 'object' dtype where each element is a 'pandas.Timestamp' with the correct 'tz'.
  	To accept the future behavior, pass 'dtype=object'.
  	To keep the old behavior, pass 'dtype="datetime64[ns]"'.
    data = np.asarray(series).reshape(shape)
  /usr/local/lib/python3.7/site-packages/pandas/core/apply.py:286: FutureWarning: Converting timezone-aware DatetimeArray to timezone-naive ndarray with 'datetime64[ns]' dtype. In the future, this will return an ndarray with 'object' dtype where each element is a 'pandas.Timestamp' with the correct 'tz'.
  	To accept the future behavior, pass 'dtype=object'.
  	To keep the old behavior, pass 'dtype="datetime64[ns]"'.
    results[i] = self.f(v)

I'm not sure what we want to do here - potentially we should make a choice between:

  • the worse behavior of object
  • accepting the coercing to naive datetimes
  • supporting pandas extension arrays

@dcherian
Copy link
Contributor

@max-sixty See #2666

@max-sixty
Copy link
Collaborator Author

Great, thanks @dcherian

Lmk if we can merge this, then

@dcherian
Copy link
Contributor

Ya sounds good.

Though this job is showing a bunch more: https://travis-ci.org/pydata/xarray/jobs/486320561. We can leave these for a future PR.

 /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/dask/array/blockwise.py:204: UserWarning: The da.atop function has moved to da.blockwise
    warnings.warn("The da.atop function has moved to da.blockwise")
xarray/tests/test_plot.py::TestPlot::test_2d_coords_line_plot
  /home/travis/build/pydata/xarray/xarray/tests/test_plot.py:213: PytestDeprecationWarning: The 'message' parameter is deprecated.
  (did you mean to use `match='some regex'` to check the exception message?)
  Please comment on https://github.com/pytest-dev/pytest/issues/3974 if you have concerns about removal of this parameter.
    with pytest.raises(ValueError, message='If x or y are 2D '):
xarray/tests/test_dataset.py::TestDataset::test_to_dict_with_numpy_attrs
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/lib/type_check.py:546: DeprecationWarning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead
    'a.item() instead', DeprecationWarning, stacklevel=1)
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/lib/type_check.py:546: DeprecationWarning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead
    'a.item() instead', DeprecationWarning, stacklevel=1)
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/lib/type_check.py:546: DeprecationWarning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead
    'a.item() instead', DeprecationWarning, stacklevel=1)
xarray/tests/test_dataarray.py::TestDataArray::test_to_and_from_cdms2_sgrid
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/ma/core.py:7705: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
    if not np.all(xinf == filled(np.isinf(y), False)):
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/ma/core.py:7705: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
    if not np.all(xinf == filled(np.isinf(y), False)):
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/ma/core.py:7705: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
    if not np.all(xinf == filled(np.isinf(y), False)):
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/numpy/ma/core.py:7705: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
    if not np.all(xinf == filled(np.isinf(y), False)):
  /home/travis/miniconda/envs/test_env/lib/python3.6/site-packages/cdms2/axis.py:825: UserWarning: genutil module not present, was not able to determine if axis is level based on units
    "genutil module not present, was not able to determine if axis is level based on units")

3.5 is triggering this (https://travis-ci.org/pydata/xarray/jobs/486320560):

/home/travis/miniconda/envs/test_env/lib/python3.5/site-packages/numpy/ma/core.py:6447: MaskedArrayFutureWarning: In the future the default for ma.maximum.reduce will be axis=0, not the current None, to match np.maximum.reduce. Explicitly pass 0 or None to silence this warning.
  return self.reduce(a)

@max-sixty
Copy link
Collaborator Author

Thanks for listing those!

Am I understanding correctly that those are not from code that's in xarray, though?

@max-sixty max-sixty merged commit 5527f69 into pydata:master Jan 30, 2019
@max-sixty max-sixty deleted the warnings branch January 30, 2019 19:06
dcherian pushed a commit to yohai/xarray that referenced this pull request Feb 4, 2019
* master:
  remove xfail from test_cross_engine_read_write_netcdf4 (pydata#2741)
  Reenable cross engine read write netCDF test (pydata#2739)
  remove bottleneck dev build from travis, this test env was failing to build (pydata#2736)
  CFTimeIndex Resampling (pydata#2593)
  add tests for handling of empty pandas objects in constructors (pydata#2735)
  dropna() for a Series indexed by a CFTimeIndex (pydata#2734)
  deprecate compat & encoding (pydata#2703)
  Implement integrate (pydata#2653)
  ENH: resample methods with tolerance (pydata#2716)
  improve error message for invalid encoding (pydata#2730)
  silence a couple of warnings (pydata#2727)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants