Skip to content

Add CONTRIBUTING.md - #484

Merged
ThomasMBury merged 1 commit into
ThomasMBury:mainfrom
energyscholar:docs/contributing
Sep 22, 2026
Merged

ThomasMBury merged 1 commit into
ThomasMBury:mainfrom
energyscholar:docs/contributing

Conversation

@energyscholar

Copy link
Copy Markdown
Collaborator

As discussed by email — a short contribution guide, so the package has a stated scope to point at.

Three rules:

  • Scope. Code that computes, tests or visualises an EWS indicator on the package's data structures, plus simulated models that generate test data for them. General-purpose statistics belongs in SciPy, statsmodels or a geostatistics library; if an implementation already exists there, call it.
  • Issue first for anything larger than a bug fix, so fit is settled before the work is done rather than after.
  • Shape. Indicator maths in pure functions over NumPy arrays, classes orchestrating them. Existing methods in core.py predate this and the file says so, rather than describing an architecture that isn't there yet.

Plus the pre-PR checklist that has been informal until now — a test with a known answer, a docstring citing the method, the __init__ export and the docs/source/ewstools.rst entry, and a CHANGELOG line.

Docs only; no code touched. The README's one-line invitation now points here.

Happy to reword any of it — it's your package's policy, I've just written it down.

Guidance so far has been one line in the README: "Contributions are welcome!
Feel free to reach out or submit a pull request." That is welcoming, and it
leaves both sides without a shared reference. Substantial contributions have
arrived fully implemented, which puts a maintainer in the position of either
accepting something outside the package's purpose or declining work that is
already finished -- a decision that would have been much cheaper for everyone
before it was written.

Scope, stated so that a decline can point at a rule rather than a judgement.
The line is drawn around what an indicator IS, not around whether the
underlying statistic is novel: variance, autocorrelation, entropy and DFA are
all general statistics, and they belong here because the package computes them
over a rolling window as resilience indicators. What does not belong is
statistical machinery that is not itself an indicator.

Issue first for anything larger than a bug fix, with a stated timescale and a
fallback. An unbounded "open an issue and wait" fails invisibly: there is no
abandoned pull request to notice, just an issue nobody followed up. So the
section says a reply can take a couple of weeks, and says what to do if it
does not come.

Shape, with helpers.dfa + TimeSeries.compute_dfa + tests/test_dfa.py named as
the pattern to copy, since describing an architecture is less use than pointing
at an example of it. Older methods in core.py that compute inline are noted as
staying that way, rather than described as if they already followed the rule or
promised for an unscheduled migration.

A setup section, because the checklist below it was unreachable without one.
The commands are the ones a fresh clone actually needs, and the TensorFlow
skip is called out so it does not read as a failure.

The pre-PR checklist says what is genuinely verified and what is not. The docs
build treats warnings as errors, so a malformed docstring fails the PR -- but
nothing notices a module missing from docs/source/ewstools.rst, and a new
function in an existing module needs no docs edit at all, because automodule
already picks it up. The CHANGELOG instruction says to create the Unreleased
heading, which has never existed in this repository.

Small fixes are exempted in the second paragraph, so none of the above stands
between someone and a typo correction.

The README line now points here.

@ThomasMBury ThomasMBury left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good.

@ThomasMBury
ThomasMBury merged commit 557ca87 into ThomasMBury:main Sep 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants