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

Improve write_report, compat using @singledispatch #108

Merged
merged 18 commits into from
Nov 28, 2023
Merged

Conversation

khaeru
Copy link
Owner

@khaeru khaeru commented Nov 28, 2023

Use @functools.singledispatch() to simplify these operators and make them more easily extensible.

Housekeeping

  • Set nitpicky = True in Sphinx configuration and address most nitpicks.
    • Includes downstream nitpicks in ixmp and message_ix docs where genno docstrings/signatures are picked up in autosummaries. Thus supersedes and closes Update intersphinx links #94.
  • Add missing items to API documentation: exceptions.
  • Update mypy to 1.7.0.

PR checklist

  • Checks all ✅
  • Update documentation
  • Update doc/whatsnew.rst

- Cache return values; discard cache when .modules changes.
- Don't use a result if getattr(…) triggers a warning.
- Make a single-dispatch function for easier overloading.
- Pass through keyword arguments; set index=False by default.
- Add "header_comment" keyword argument.
Simplify these functions by removing the need to chain the basic
operator.
Also address nitpicks where docstrings are reused downstream via
intersphinx.
@khaeru khaeru added the enh New feature or request label Nov 28, 2023
@khaeru khaeru self-assigned this Nov 28, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4812c64) to head (409f29a).
Report is 173 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #108   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           48        48           
  Lines         4043      4102   +59     
=========================================
+ Hits          4043      4102   +59     
Files Coverage Δ
genno/caching.py 100.00% <ø> (ø)
genno/compat/graphviz.py 100.00% <ø> (ø)
genno/compat/plotnine/plot.py 100.00% <100.00%> (ø)
genno/compat/pyam/operator.py 100.00% <100.00%> (ø)
genno/compat/sdmx.py 100.00% <100.00%> (ø)
genno/compat/xarray.py 100.00% <ø> (ø)
genno/config.py 100.00% <ø> (ø)
genno/core/attrseries.py 100.00% <ø> (ø)
genno/core/computer.py 100.00% <100.00%> (ø)
genno/core/describe.py 100.00% <ø> (ø)
... and 11 more

khaeru added a commit that referenced this pull request Nov 28, 2023
@khaeru khaeru merged commit 866d3b6 into main Nov 28, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants