Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

At most two positional arguments in the public API; the rest keyword-only

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start by reading the public APIs named in the issue: metrics, Comparer and ComparerCollection, SkillTable, Quantity, DummyModelResult, and the plotting entry points. Check their existing signatures and call sites to understand the scope of positional argument changes and whether compatibility warnings are needed. Done means the listed APIs enforce the positional argument policy, with the chosen compatibility approach applied consistently.

Written by the indexing model from the issue text.

Description

Public functions should take at most two positional arguments; everything after is keyword-only. scikit-learn does this for its metrics, e.g. mean_squared_error(y_true, y_pred, *, sample_weight=None, ...). A keyword call says what each value means, and a misplaced positional value then fails at the call instead of being used for the wrong thing.

The constructors, match() and from_matched() already do this. These do not:

function positional parameters
metrics.rmse, mae, urmse, cc, c_rmse, c_mae, c_urmse and their long-name aliases obs, model, weights (rmse: also unbiased)
metrics.hit_ratio, lin_slope, peak_ratio/pr obs, model, a / reg_method / inter_event_level, AAP, inter_event_time
metrics.metric (decorator) best, has_units, display_name
Quantity name, unit, is_directional
DummyModelResult name, data, strategy; also the only model result where data is not first
*.trim start_time, end_time, buffer, no_overlap
Comparer.sel, ComparerCollection.sel model, (observation, quantity,) start, end, time, area, z
Comparer.gridded_skill, ComparerCollection.gridded_skill bins, binsize, by, metrics, n_min
ComparerCollection.skill by, metrics, observed
SkillTable.style decimals, metrics, cmap, show_best
Comparer.from_matched_data 14 parameters
cmp.plot.kde, residual_hist; cc.plot.residual_hist, spatial_overview, temporal_coverage; SkillArray.plot.grid ax, title, figsize, …
ms.plotting.spatial_overview, taylor_diagram, TaylorPoint 5–7 each

skill() deserves keyword-only from the start, even though it has two parameters: cmp.skill("rmse") passes "rmse" as by and fails with KeyError: 'rmse'. The same goes for sel(), where only model is an obvious first argument.

Positional calls past the second argument will break. Either do it in the next major release, or first emit a FutureWarning for one minor release when a positional argument is passed where the keyword will be required.

Dominant language
Python
Stars
58
Forks
10
Avg merge
28m
Merged PRs (30d)
1

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from DHI/modelskill

All issues in DHI/modelskill

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.