khaeru / genno

Efficient, transparent computation on labelled, N-dimensional data
https://genno.rtfd.io
GNU General Public License v3.0
1 stars 2 forks source link

Improve write_report, compat using @singledispatch #108

Closed khaeru closed 1 year ago

khaeru commented 1 year ago

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

Housekeeping

PR checklist

codecov-commenter commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #108 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 48 48 Lines 4043 4102 +59 ========================================= + Hits 4043 4102 +59 ``` | [Files](https://app.codecov.io/gh/khaeru/genno/pull/108?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto) | Coverage Δ | | |---|---|---| | [genno/caching.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcaching.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY2FjaGluZy5weQ==) | `100.00% <ø> (ø)` | | | [genno/compat/graphviz.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcompat%2Fgraphviz.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29tcGF0L2dyYXBodml6LnB5) | `100.00% <ø> (ø)` | | | [genno/compat/plotnine/plot.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcompat%2Fplotnine%2Fplot.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29tcGF0L3Bsb3RuaW5lL3Bsb3QucHk=) | `100.00% <100.00%> (ø)` | | | [genno/compat/pyam/operator.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcompat%2Fpyam%2Foperator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29tcGF0L3B5YW0vb3BlcmF0b3IucHk=) | `100.00% <100.00%> (ø)` | | | [genno/compat/sdmx.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcompat%2Fsdmx.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29tcGF0L3NkbXgucHk=) | `100.00% <100.00%> (ø)` | | | [genno/compat/xarray.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcompat%2Fxarray.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29tcGF0L3hhcnJheS5weQ==) | `100.00% <ø> (ø)` | | | [genno/config.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fconfig.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29uZmlnLnB5) | `100.00% <ø> (ø)` | | | [genno/core/attrseries.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcore%2Fattrseries.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29yZS9hdHRyc2VyaWVzLnB5) | `100.00% <ø> (ø)` | | | [genno/core/computer.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcore%2Fcomputer.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29yZS9jb21wdXRlci5weQ==) | `100.00% <100.00%> (ø)` | | | [genno/core/describe.py](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree&filepath=genno%2Fcore%2Fdescribe.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto#diff-Z2Vubm8vY29yZS9kZXNjcmliZS5weQ==) | `100.00% <ø> (ø)` | | | ... and [11 more](https://app.codecov.io/gh/khaeru/genno/pull/108?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Paul+Natsuo+Kishimoto) | |