Skip to content

Update documentation to reflect removal of inplace option #3586

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

Closed
monocongo opened this issue Dec 1, 2019 · 1 comment · Fixed by #4615
Closed

Update documentation to reflect removal of inplace option #3586

monocongo opened this issue Dec 1, 2019 · 1 comment · Fixed by #4615

Comments

@monocongo
Copy link

MCVE Code Sample

# Your code here
ds_gamma.reset_coords('month', drop=True, inplace=True)

~/miniconda3/envs/spi_multi/lib/python3.8/site-packages/xarray/core/utils.py in _check_inplace(inplace)
     38 def _check_inplace(inplace: Optional[bool]) -> None:
     39     if inplace is not None:
---> 40         raise TypeError(
     41             "The `inplace` argument has been removed from xarray. "
     42             "You can achieve an identical effect with python's standard assignment."

TypeError: The `inplace` argument has been removed from xarray. You can achieve an identical effect with python's standard assignment.

Expected Output

Coordinates reset in-place, or documentation that does not list inplace as a valid argument.

Problem Description

The documentation for Dataset.reset_coords and Dataset.reset_coords lists an inplace argument that is no longer supported. My assumption is that this should be removed from the documentation but I'm not sure how this documentation is generated -- it may come from the docstring and/or function signature and the argument is still present in the function signature so it shows up in the documentation as a result?

This appears to have been addressed before in issue #858 but maybe the inplace argument slipped back into the documentation somehow? I see that there is a function to check for an inplace argument and raise an error if present -- why is this being used rather than removing the inplace argument altogether? Is this mechanism in place to facilitate backward compatibility, etc.?

Output of xr.show_versions()

# Paste the output here xr.show_versions() here INSTALLED VERSIONS ------------------ commit: None python: 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-70-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.1

xarray: 0.14.1
pandas: 0.25.3
numpy: 1.17.3
scipy: 1.3.2
netCDF4: 1.5.3
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.0.4.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2.8.1
distributed: 2.8.1
matplotlib: 3.1.2
cartopy: None
seaborn: None
numbagg: None
setuptools: 42.0.1.post20191125
pip: 19.3.1
conda: None
pytest: None
IPython: 7.10.0
sphinx: None

@max-sixty
Copy link
Collaborator

Thanks for the issue and observation @monocongo

We left the kwarg for a couple versions so that existing users had an informative error message and clear instructions for . We removed it from the docstring.

That said, it's been a couple versions, so would welcome a PR to remove these for v0.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants