Skip to content

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Apr 7, 2014

This makes the inheritance diagrams have less super tiny text by including only the class name, not the fully-qualified class name. This is most acutely different in astropy.coordinates, for example.

This also includes #2288 (and is really just a follow-on to it).

mdboom added 2 commits April 7, 2014 11:04
Resolve links to "canonical" location of classes to "api" location of
classes so that Bases and inheritance diagrams work.
@mdboom mdboom added the docs label Apr 7, 2014
@mdboom
Copy link
Contributor Author

mdboom commented Apr 7, 2014

Before:

After:

inheritance-c61d242bba15245d5cae1a636cdcc10fda800f37

@pllim
Copy link
Member

pllim commented Apr 7, 2014

👍

@embray
Copy link
Member

embray commented Apr 7, 2014

Related question unrelated to Astropy--I was trying to include an inheritance diagram for a different project in its docs. But I couldn't figure out how to say, given a class, generate an inheritance diagram including this class and all its subclasses. Any ideas? Would one of these plugins help?

@embray
Copy link
Member

embray commented Apr 7, 2014

By the by, if this is merged don't let me forget to also merge it into astropy-helpers.

@mdboom
Copy link
Contributor Author

mdboom commented Apr 7, 2014

The inheritance-diagram mostly works the other way: given a class, diagram its base classes. (Or, as we use it in astropy, give it a module and diagram everything in it). To do what you want, I think you'd probably have to subclass it the inheritance-diagram directive. It shouldn't be too bad, because it already takes as input a "set of classes" -- you'd just need a shim to generate that set and pass it along.

@astrofrog
Copy link
Member

This looks great! Will review today.

cc @kbarbary @eteq since it fixes all the API link-related issues!

@astrofrog
Copy link
Member

@mdboom - this looks good to me! Is it ready to merge?

mdboom added a commit that referenced this pull request Apr 10, 2014
@mdboom mdboom merged commit b4f4f66 into astropy:master Apr 10, 2014
@eteq
Copy link
Member

eteq commented Apr 10, 2014

@mdboom - this is a tricky way to solve this, but it's nice, and I like the result!

The one concern is that this may have unintended consequences when there's name overlap. E.g., if in the future someone adds a warning to astropy.time called IllegalSecondWarning, this will cause the links to resolve incorrectly, right?

This was still fine right now, because it's better than the alternative of not merging, but I want to make sure I understand this in case it ends up happening down the road.

@mdboom mdboom deleted the doc/shorter-inheritance-diagrams branch May 21, 2014 23:54
astrofrog pushed a commit to astropy/sphinx-automodapi that referenced this pull request Jan 27, 2018
…itance-diagrams

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants