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

Fix backreferences.identify_names when module is used without attribute #173

Merged
merged 1 commit into from Nov 27, 2016

Conversation

Projects
None yet
3 participants
@lesteve
Contributor

lesteve commented Nov 23, 2016

Fix #172.

My guess is that backreferences are not used for modules so I excluded modules without attributes from scan_used_functions.

Edit: Close #149 as well.

@lesteve lesteve changed the title from FIX backreferences.identify_names when module is used without attribute to Fix backreferences.identify_names when module is used without attribute Nov 23, 2016

module = splitted[0]
attribute = None
else:
module, attribute = splitted

This comment has been minimized.

@Titan-C

Titan-C Nov 23, 2016

Member

I would test for length 1(or not 2) and do continue. That way you don't save the module, or anything else that is not a module, attribute pair and you save yourself the need to have a check later on.

This comment has been minimized.

@lesteve

lesteve Nov 23, 2016

Contributor

Great suggestion, I'll do that.

This comment has been minimized.

@lesteve

lesteve Nov 23, 2016

Contributor

Done.

@lesteve lesteve force-pushed the lesteve:fix-identify-names branch from 00d04a7 to 5bdafeb Nov 23, 2016

'{module_short}.{name}'.format(**entry)
for entry in example_code_obj.values()
if entry['module'].startswith(gallery_conf['doc_module']) and
entry['name'] is not None)

This comment has been minimized.

@Titan-C

Titan-C Nov 23, 2016

Member

Why do you still need this change?

This comment has been minimized.

@lesteve

lesteve Nov 23, 2016

Contributor

Sorry I meant to remove that ...

@lesteve lesteve force-pushed the lesteve:fix-identify-names branch from 5bdafeb to 6048b23 Nov 23, 2016

FIX backreferences.identify_names
when module is used without attribute

@lesteve lesteve force-pushed the lesteve:fix-identify-names branch from 6048b23 to e51429b Nov 23, 2016

@Titan-C Titan-C merged commit 7969af6 into sphinx-gallery:master Nov 27, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Titan-C

This comment has been minimized.

Member

Titan-C commented Nov 27, 2016

Looks good, merging.
Thank you!

@jnothman

This comment has been minimized.

Contributor

jnothman commented Dec 5, 2016

We'd like this fixed in scikit-learn. Would you recommend we cherry-pick, or wait for a release, @Titan-C?

@lesteve lesteve deleted the lesteve:fix-identify-names branch Dec 5, 2016

@Titan-C

This comment has been minimized.

Member

Titan-C commented Dec 5, 2016

I'll do a release now and PR in scikit-learn

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