Skip to content

Should netcdftime be a depen #764

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
jhamman opened this issue Feb 26, 2018 · 2 comments
Closed

Should netcdftime be a depen #764

jhamman opened this issue Feb 26, 2018 · 2 comments

Comments

@jhamman
Copy link
Contributor

jhamman commented Feb 26, 2018

I think we should add netcdftime as a hard dependency to netCDF4-python. The removal of netcdftime in #756 removed the code and the top level API. I'm proposing two changes,

  1. add netcdftime to the install_requires block in setup.py:

setuptools_extra_kwargs = {
"install_requires": ["numpy>=1.7"],

  1. import the top level API functions from netcdftime in _netCDF4.pyx:
import netcdftime
from netcdftime import date2num, num2date, date2index

instead of:

try:
import netcdftime
_has_netcdftime = True
except ImportError:
_has_netcdftime = False

This would also allow for the removal of the wrapper functions from _netCDF4.pyx.

cc @shoyer
xref pydata/xarray#1933

@shoyer
Copy link
Contributor

shoyer commented Feb 26, 2018

Yes, I think this is a good idea.

Most netcdf4-python users probably want netcdftime, too, and this will ease the transition to a separate package. Otherwise a number of downstream projects will suddenly break when they upgrade to a newer release of netcdf4-python.

If you want to eventually remove the hard dependency on netcdftime, that would be fine, but it would be good to issue warnings for some time so users have time to adapt.

@jswhit
Copy link
Collaborator

jswhit commented Feb 26, 2018

pull request #765. My main concern is that we have binary wheels for all the platforms that netcdf4-python has, so the installation is transparent. Don't want this to generate a whole bunch of netcdf4-python support requests.

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

No branches or pull requests

3 participants