Skip to content

test_notebooks #337

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

Merged
merged 22 commits into from
Feb 6, 2016
Merged

Conversation

BibMartin
Copy link
Contributor

Create a test_notebooks test file that runs every notebook in folium/examples.

This will also enable to convert these notebook to markdown for enriching the docs.

@BibMartin BibMartin changed the title Create test_notebooks test_notebooks Jan 20, 2016
@@ -17,7 +17,8 @@ before_install:
- travis_retry conda create --yes -n test python=$PYTHON --file requirements.txt
- source activate test
- conda install --yes --file requirements-dev.txt
- travis_retry conda install --yes pytest pandas vincent flake8
- travis_retry conda install --yes pytest pandas vincent flake8 nbconvert jupyter_client ipykernel shapely fiona
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move those to requirements-dev.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided they are in requirements-dev.txt, can we remove this line ?
(I don't know what travis_retry does).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided they are in requirements-dev.txt, can we remove this line ?

Yep.

(I don't know what travis_retry does).

Exactly what the name says. It re-tries a few times. (Good for stuff that might hang up on you like file downloads.)

@ocefpaf
Copy link
Member

ocefpaf commented Jan 21, 2016

Create a test_notebooks test file that runs every notebook in folium/examples.

I am 👍 to this

This will also enable to convert these notebook to markdown for enriching the docs.

But that a look at nbsphinx before going forward. Maybe we already have what we need there.

Overall comments:

  • The notebooks diffs are hard to interpret, but I guess you are just doing some editing and or running them, right?
  • We can drop the Python 3.3, but I have no idea what is going on with Python 2.7! I will take a second look soon.

Thanks!

@BibMartin
Copy link
Contributor Author

But that a look at nbsphinx before going forward. Maybe we already have what we need there.

Yes and no ; I'm not sure nbsphinx can be embedded in the tests routines.
And it seems nbsphinx requires pandoc that's more difficult to install (apt-get) (as far as I know).

The notebooks diffs are hard to interpret, but I guess you are just doing some editing and or running them, right?

Yes, there are some transformations to illustrate the new API. For example:

mmap.simple_marker(...)

has been replaced by

folium.Marker(...).add_to(mmap)

We can drop the Python 3.3

Yes, it would simplify the problem, if it's not needed anymore.

but I have no idea what is going on with Python 2.7! I will take a second look soon.

I'll try to understand that this WE.

@@ -16,8 +16,11 @@ before_install:
- conda update --yes --all
- travis_retry conda create --yes -n test python=$PYTHON --file requirements.txt
- source activate test
- conda install --yes --file requirements-dev.txt
- travis_retry conda install --yes pytest pandas vincent flake8
- if [[ "$PYTHON" != "3.3" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just drop Python 3.3 support.

@ocefpaf
Copy link
Member

ocefpaf commented Jan 24, 2016

Yes and no ; I'm not sure nbsphinx can be embedded in the tests routines.
And it seems nbsphinx requires pandoc that's more difficult to install (apt-get) (as far as I know).

OK. Let's leave nbsphinx for another day. (Although pandoc should be available in conda. I will see what I can do about that.)

but I have no idea what is going on with Python 2.7! I will take a second look soon.

I'll try to understand that this WE.

Don't worry to much. Let's just skip the Python 2.7 notebooks tests for now.

@BibMartin
Copy link
Contributor Author

Well, it can be interesting to test the notebooks and generate them in the docs.
But it seems the way I did it is full of drawbacks:

  • Python 2.7 and 3.3 don't work for 2 different (unknow ?) reasons
  • Tests are much longer to run
  • requirements-dev increases much
  • .travis.yml is becoming complicated
  • I'm not able to reproduce Travis's fails (maybe this can be overcome)

Finally, I'm not even sure that this PR is a good idea.

Another way of having (almost) the same result would be:

  • Forget about running the notebooks in the tests
  • Create a script the runs and transforms the notebooks to markdown when building the docs (with nbsphinx eventually)
  • Provide a requirements-docbuild.txt that contains the larger dependencies.

Thus the notebooks would not be tested at every PR, but only when one builds the doc.

@ocefpaf
Copy link
Member

ocefpaf commented Jan 25, 2016

We can use an if clause in .travis.yaml to run notebook tests only for Python 3.4. I would like to see notebook test at every PR even at the cost of longer Travis-CI runs. (We broke folium many times in the past because we merged PRs without testing them in a notebook.)

@BibMartin
Copy link
Contributor Author

@ocefpaf
I think this PR is big enough to be merged.
I'll try to do another PR to finish doctrings' TODO.
Then we're done, aren't we ?

@ocefpaf
Copy link
Member

ocefpaf commented Feb 6, 2016

I think this PR is big enough to be merged.

👍

I'll try to do another PR to finish doctrings' TODO.

Don't worry too much. We have enough for a release.

Then we're done, aren't we?

Done? Never! Ready for a release? We were probably good enough a few PRs ago 😜

ocefpaf added a commit that referenced this pull request Feb 6, 2016
@ocefpaf ocefpaf merged commit 5f50773 into python-visualization:master Feb 6, 2016
@ocefpaf ocefpaf added bug An issue describing unexpected or malicious behaviour documentation Documentation about a certain topic should be added labels Feb 12, 2016
@ocefpaf ocefpaf added this to the v0.2.0 milestone Feb 12, 2016
sanga pushed a commit to sanga/folium that referenced this pull request Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected or malicious behaviour documentation Documentation about a certain topic should be added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants