-
Notifications
You must be signed in to change notification settings - Fork 49
Use netcdftime #85
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
Use netcdftime #85
Conversation
.travis.yml
Outdated
|
|
||
| python: | ||
| - 2.7 | ||
| - 3.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conda-forge deprecated py34
| - conda config --add channels conda-forge | ||
| - ENV_NAME='test-environment' | ||
| - conda create --quiet -n $ENV_NAME python=$TRAVIS_PYTHON_VERSION | ||
| - conda create --name $ENV_NAME python=$TRAVIS_PYTHON_VERSION udunits2 --file requirements.txt --file requirements-dev.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building the env in one go saves us some trouble. Sometimes conda does not respect channel preference when adding packages to an env.
setup.py
Outdated
| import versioneer | ||
|
|
||
|
|
||
| class PyTest(TestCommand): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not get this to work, kept getting "tests not found." I switched to a direct pytest call with the pytest-cov plugin instead, hope that is OK.
|
Looks like some genuine test failures here. Happy in general with the changes. Thanks @ocefpaf! |
I'll take a closer look at those soon.
Maybe we should wait for a stable release of |
|
@pelson the failures seems to be due to a change in how the comparison works. It is refusing compare dates with different calendars: That makes sense to me but I'm not sure how to proceed to make the tests valid again. Maybe we can compare the timetuple like cftime.datetime(1970, 1, 1, 0, 0, 20).timetuple() == _num2date_to_nearest_second(20., useconds).timetuple()
TrueIs that OK? |
That works for me.
In which case, cf_units is testing questionable behaviour IMO. I'm fully supportive of removing any such behaviour, unless there was a genuine mistake in writing the test (I didn't look yet). |
| - conda config --set show_channel_urls True | ||
| - conda config --set always_yes yes --set changeps1 no --set show_channel_urls True | ||
| - conda update --quiet conda | ||
| - conda config --add channels conda-forge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conda-forge's udunits2 is newer, hope that this change is OK @bjlittle
|
@ocefpaf The Could you update the [run]
branch = True
omit =
setup.py
versioneer.py
cf_units/_version.py
cf_units/etc/*
cf_units/tests/*
.eggsThat should do the trick... |
|
@ocefpaf Let's do that rebase tango again... 😉 |
Done! |
|
@ocefpaf Awesome, thanks 👍 |
This PR uses the new
netcdftimepackage instead ofnetCDF4-python.I can rebase this later but I left the individual commits to make it easier to review.
There are 6 tests failing but I believe they are unrelated to this PR b/c they are failing on master too. Note that on master py34 was passing, but I guess that is due to an old
netCDF4-pythonversion.