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

MRG: Add ignore_pattern #346

Merged
merged 3 commits into from Feb 19, 2018

Conversation

Projects
None yet
3 participants
@larsoner
Contributor

larsoner commented Feb 9, 2018

Hopefully the doc changes are clear enough, but this allows skipping some files entirely (i.e., not parsing or adding them to the gallery).

Closes #262.

@larsoner larsoner force-pushed the larsoner:ignore branch 3 times, most recently from 55c6afe to 1ccb66a Feb 9, 2018

@codecov-io

This comment has been minimized.

codecov-io commented Feb 9, 2018

Codecov Report

Merging #346 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #346   +/-   ##
=======================================
  Coverage   92.12%   92.12%           
=======================================
  Files          27       27           
  Lines        1842     1842           
=======================================
  Hits         1697     1697           
  Misses        145      145
Impacted Files Coverage Δ
sphinx_gallery/gen_gallery.py 86.51% <ø> (-0.08%) ⬇️
sphinx_gallery/py_source_parser.py 81.48% <ø> (ø) ⬆️
sphinx_gallery/gen_rst.py 95.63% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 282cd2c...1c37c80. Read the comment docs.

@lesteve

Being able to ignore a file completely sounds like a good idea. Two small comments.

listdir = [fname for fname in os.listdir(src_dir)
if fname.endswith('.py')]
# limit which to look at based on regex
listdir = [fname for fname in listdir
if re.match(gallery_conf['ignore_pattern'], fname) is None]

This comment has been minimized.

@lesteve

lesteve Feb 12, 2018

Contributor

As far as I remember, filename_pattern uses the full path. It would be great if ignore_pattern was using the full path as well.

For the same reason, I would use re.search rather than re.match.

@@ -0,0 +1 @@
from numpy import pad

This comment has been minimized.

@lesteve

lesteve Feb 12, 2018

Contributor

Maybe add a comment here rather than an unused import? Something like this for example?

# This file is ignored through ignore_pattern so it does not need to have a
# docstring following the sphinx-gallery convention (i.e. title + description)

@larsoner larsoner force-pushed the larsoner:ignore branch from 963b466 to b055121 Feb 12, 2018

@lesteve

This comment has been minimized.

Contributor

lesteve commented Feb 12, 2018

I saw the Python 3.4 failure before. I am trying to tackle it in #350.

@lesteve lesteve force-pushed the larsoner:ignore branch from b055121 to e48d2fe Feb 19, 2018

@lesteve lesteve merged commit 4993065 into sphinx-gallery:master Feb 19, 2018

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 92.12%)
Details
codecov/project 92.12% (+0%) compared to 282cd2c
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lesteve

This comment has been minimized.

Contributor

lesteve commented Feb 19, 2018

Merging, thanks a lot @larsoner!

@larsoner larsoner deleted the larsoner:ignore branch Feb 19, 2018

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