QuantEcon / QuantEcon/QuantEcon.py

DOC: Render subpackage API pages under the public quantecon.<pkg> namespace (drop internal module segment)

Open
#854 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.4k
Forks
2.3k
Avg merge
3d 3h
Merged PRs (30d)
3

Description

Summary

Follow-up from #850 (raised by @oyamad). #850 moved the base-level tools API pages to document the public objects in the quantecon namespace (e.g. quantecon.ARMA instead of quantecon._arma.ARMA / quantecon.arma.ARMA). The subpackage pages still document objects by their internal file module, so they render the internal module segment.

Example: markov/core.html shows

class quantecon.markov.core.MarkovChain(P, state_values=None)

but MarkovChain is re-exported at the package level (quantecon/markov/__init__.py), so ideally it should read

class quantecon.markov.MarkovChain(P, state_values=None)

The same applies across game_theory.*, optimize.*, random.*, and util.*, which the generator documents via automodule:: quantecon.<pkg>.<file>.

Proposed fix

Apply the same treatment qe_apidoc.py now uses for the base-level pages, one level down: for each subpackage page use .. currentmodule:: quantecon.<pkg> plus explicit autoclass / autofunction directives for the objects that file defines and that are re-exported at quantecon.<pkg>. Page structure can stay as-is (one page per internal file); only the directive/heading changes.

Scope

Roughly 30 file-pages and ~66 objects across five subpackages:

Package Re-exported at quantecon.<pkg>.* Defined in files but not re-exported
markov 15 2
game_theory 38 3
optimize 13 1
random (small)
util (small)

Dependency on #853

The "not re-exported" objects in the right column are the same class of problem as #853 (objects reachable only via an internal module, not the public package namespace). This work should be gated on the #853 decision (promote to the package namespace / document via the internal module / omit) so the same rule is applied consistently across the whole API reference, rather than converting the subpackages under a different policy.

Priority

Non-blocking (per @oyamad on #850). Best done as a dedicated follow-up PR once #853 is resolved. Related: #850, #853.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading qe_apidoc.py and resolving the namespace policy in #853, then inspect the subpackage init.py files and the existing automodule pages for markov, game_theory, optimize, random, and util. Apply the agreed rule to the roughly 30 pages, preserving the page structure. Done means re-exported objects render under quantecon. and non-re-exported objects follow the #853 decision consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.