Skip to content
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

Fixed broken URL in help output #1051

Merged
merged 5 commits into from Jan 16, 2017
Merged

Fixed broken URL in help output #1051

merged 5 commits into from Jan 16, 2017

Conversation

jlstevens
Copy link
Contributor

This PR addresses #978. The code change is trivial but it is likely that the test data will need updating.

@jlstevens
Copy link
Contributor Author

I'm a little surprised that the tests passed...maybe this output is being sent to the pager and therefore isn't captured?

@philippjfr
Copy link
Member

Yes, I think that's it. One issue I have is that custom Elements will also point to non-existent entries in the elements tutorial. Got any ideas to disable that?

@jlstevens
Copy link
Contributor Author

I agree that is an issue though not a particularly major one. My only suggestion is to suggest the help URL only if the element is one of the ones we offer. Do we have such a list?

Maybe the top level __init__.py could set a global variable (list of all our elements) in core.pprint. At least this would avoid having to pass this list though help, then Store, then into the pretty printer and all its methods...

@philippjfr
Copy link
Member

Could probably just iterate over the hv.element namespace and find all Element types to get that list.

@jlstevens
Copy link
Contributor Author

I suppose so given that seaborn elements aren't in that tutorial anyway. Should I really do the same for Containers or can I just ignore the possibility of custom Containers? I doubt people will want to build new containers often...

@philippjfr
Copy link
Member

Should I really do the same for Containers or can I just ignore the possibility of custom Containers?

Fine to ignore right now I think.

@jlstevens
Copy link
Contributor Author

Added filtering of elements as suggested:

image

Versus a core element:

image

Note this PR isn't quite ready to merge. I might as well fix the issue about showing help for the active backend while I am working on this code.

@@ -25,6 +25,7 @@
from .operation import ElementOperation, MapOperation, TreeOperation # noqa (API import)
from .element import * # noqa (API import)
from . import util # noqa (API import)
from .element import __all__ as elements_list
Copy link
Member

Choose a reason for hiding this comment

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

That doesn't seem right, it should at least filter for objects of type Element.

Copy link
Member

Choose a reason for hiding this comment

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

I know hv.element.__all__ filters for ViewableElement but I think that includes some other types as well, e.g. Overlays. So maybe just tighten that check to use Element instead of ViewableElement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that __all__ contains strings (which I want) but doing tighter subclass checks requires a list of those classes. I could iterate over locals but I find that pretty ugly. What would you suggest?

Copy link
Member

Choose a reason for hiding this comment

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

I'd change line 99 of hv.element.__init__ to:

return issubclass(obj, Element)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! I was hesitant in case anything was expecting to find ViewableElements...

Copy link
Member

Choose a reason for hiding this comment

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

Appears you were right being hesitant, but it really shouldn't be relying on importing Overlay via hv.element.

@jlstevens
Copy link
Contributor Author

Ok. If the tests pass I think this PR is ready for final review/merge.

@philippjfr
Copy link
Member

Looks good, merging.

@philippjfr philippjfr merged commit a026702 into master Jan 16, 2017
@philippjfr philippjfr deleted the help_url_fix branch January 27, 2017 02:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants