Skip to content

Commit 7560ac9

Browse files
authored
DOC: various documentation enhancements (#64)
* DOC: various documentation enhancements * turn on notebook execution
1 parent 072e68a commit 7560ac9

File tree

11 files changed

+872
-658
lines changed

11 files changed

+872
-658
lines changed

CONTRIBUTING.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Contributing to gwlearn
2+
3+
First off, thanks for taking the time to contribute! ❤️
4+
5+
All types of contributions are encouraged and valued. See the this document for
6+
different ways to help and details about how this project handles them. Please make sure
7+
to read the relevant section before making your contribution. It will make it a lot
8+
easier for us maintainers and smooth out the experience for all involved. The community
9+
looks forward to your contributions. 🎉
10+
11+
> And if you like the project, but just don't have time to contribute, that's fine.
12+
> There are other easy ways to support the project and show your appreciation, which we
13+
> would also be very happy about: - Star the project - Tweet about it - Refer this
14+
> project in your project's readme - Mention the project at local meetups and tell your
15+
> friends/colleagues
16+
17+
## I Have a Question
18+
19+
> If you want to ask a question, we assume that you have read the available
20+
> [Documentation](https://pysal.org/gwlearn).
21+
22+
Before you ask a question, it is best to search for existing
23+
[Issues](https:/github.com/pysal/gwlearn/issues) that might help you. In case you have
24+
found a suitable issue and still need clarification, you can write your question in this
25+
issue. It is also advisable to search the internet for answers first.
26+
27+
If you then still feel the need to ask a question and need clarification, we recommend
28+
the following:
29+
30+
- Open an [Issue](https:/github.com/pysal/gwlearn/issues/new).
31+
- Provide as much context as you can about what you're running into.
32+
- Provide project and platform versions, depending on what seems relevant.
33+
34+
We will then take care of the issue as soon as possible.
35+
36+
### Discord
37+
38+
You may also want to join [PySAL Discord server](https://discord.gg/BxFTEPFFZn) and ask
39+
your question there. Just note, that Discord is primarily for ephemeral developer
40+
discussion and every question others may benefit from shall be asked publicly on GitHub.
41+
42+
### Reporting Bugs
43+
44+
<!-- omit in toc -->
45+
#### Before Submitting a Bug Report
46+
47+
A good bug report shouldn't leave others needing to chase you up for more information.
48+
Therefore, we ask you to investigate carefully, collect information and describe the
49+
issue in detail in your report. Please complete the following steps in advance to help
50+
us fix any potential bug as fast as possible.
51+
52+
- Make sure that you are using the latest version.
53+
- Determine if your bug is really a bug and not an error on your side e.g. using
54+
incompatible environment components/versions (Make sure that you have read the
55+
[documentation](https://pysal.org/gwlearn).)
56+
- To see if other users have experienced (and potentially already solved) the same issue
57+
you are having, check if there is not already a bug report existing for your bug or
58+
error in the [bug tracker](https:/github.com/pysal/gwlearn/issues?q=label%3Abug).
59+
- Also make sure to search the internet (including Stack Overflow) to see if users
60+
outside of the GitHub community have discussed the issue.
61+
- Collect information about the bug:
62+
- Stack trace (Traceback)
63+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
64+
- Version of the Python and all the dependencies.
65+
- Possibly your input and the output
66+
- Can you reliably reproduce the issue? And can you also reproduce it with older
67+
versions?
68+
69+
<!-- omit in toc -->
70+
#### How Do I Submit a Good Bug Report?
71+
72+
We use GitHub issues to track bugs and errors. If you run into an issue with the
73+
project:
74+
75+
- Open an [Issue](https:/github.com/pysal/gwlearn/issues/new). (Since we can't be sure
76+
at this point whether it is a bug or not, we ask you not to talk about a bug yet and
77+
not to label the issue.)
78+
- Explain the behavior you would expect and the actual behavior.
79+
- Please provide as much context as possible and describe the *reproduction steps* that
80+
someone else can follow to recreate the issue on their own. This usually includes your
81+
code. For good bug reports you should isolate the problem and create a reduced test
82+
case.
83+
- Provide the information you collected in the previous section.
84+
85+
Once it's filed:
86+
87+
- The project team will label the issue accordingly.
88+
- A team member will try to reproduce the issue with your provided steps. If there are
89+
no reproduction steps or no obvious way to reproduce the issue, the team will ask you
90+
for those steps. Bugs that cannot be reproduced will not be addressed until they are
91+
reproduced.
92+
- If the team is able to reproduce the issue, it will be marked, and the issue will be
93+
left to be implemented by someone.
94+
95+
### Suggesting Enhancements
96+
97+
This section guides you through submitting an enhancement suggestion for gwlearn,
98+
**including completely new features and minor improvements to existing functionality**.
99+
Following these guidelines will help maintainers and the community to understand your
100+
suggestion and find related suggestions.
101+
102+
<!-- omit in toc -->
103+
#### Before Submitting an Enhancement
104+
105+
- Make sure that you are using the latest version.
106+
- Read the [documentation](https://pysal.org/gwlearn) carefully and find out if the
107+
functionality is already covered, maybe by an individual configuration.
108+
- Perform a [search](https:/github.com/pysal/gwlearn/issues) to see if the enhancement
109+
has already been suggested. If it has, add a comment to the existing issue instead of
110+
opening a new one.
111+
- Find out whether your idea fits with the scope and aims of the project. It's up to you
112+
to make a strong case to convince the project's developers of the merits of this
113+
feature. Keep in mind that we want features that will be useful to the majority of our
114+
users and not just a small subset. If you're just targeting a minority of users,
115+
consider writing an add-on/plugin library.
116+
117+
<!-- omit in toc -->
118+
#### How Do I Submit a Good Enhancement Suggestion?
119+
120+
Enhancement suggestions are tracked as
121+
[GitHub issues](https:/github.com/pysal/gwlearn/issues).
122+
123+
- Use a **clear and descriptive title** for the issue to identify the suggestion.
124+
- Provide a **step-by-step description of the suggested enhancement** in as many details
125+
as possible.
126+
- **Describe the current behavior** and **explain which behavior you expected to see
127+
instead** and why. At this point you can also tell which alternatives do not work for
128+
you.
129+
- **Explain why this enhancement would be useful** to most gwlearn users. You may also
130+
want to point out the other projects that solved it better and which could serve as
131+
inspiration.
132+
133+
### Code Contribution
134+
135+
You can create a development environment using [Pixi](https://pixi.sh):
136+
137+
```sh
138+
pixi install
139+
```
140+
141+
Or with conda using the environment files with `latest` in the `ci` folder:
142+
143+
```sh
144+
conda env create -f ci/py313_latest.yaml -n gwlearn
145+
```
146+
147+
To install `gwlearn` to the Conda environment in an editable form, clone the repository,
148+
navigate to the main directory and install it with pip:
149+
150+
```sh
151+
pip install -e .
152+
```
153+
154+
When submitting a pull request:
155+
156+
- All existing tests should pass. Please make sure that the test suite passes, both
157+
locally and on GitHub Actions. Status on GHA will be visible on a pull request. GHA
158+
are automatically enabled on your own fork as well. To trigger a check, make a PR to
159+
your own fork.
160+
- Ensure that documentation has built correctly. It will be automatically built after
161+
merging your commit to main.
162+
- New functionality ***must*** include tests. Please write reasonable tests for your
163+
code and make sure that they pass on your pull request.
164+
- Classes, methods, functions, etc. should have docstrings. The first line of a
165+
docstring should be a standalone summary. Parameters and return values should be
166+
documented explicitly.
167+
- Follow PEP 8 when possible. We use `ruff` for linting and formatting to ensure
168+
robustness & consistency in code throughout the project and `ty` for type hint
169+
checking. Ruff is included in the `pre-commit` hook and both style and type hints will
170+
be checked on every PR.
171+
- `gwlearn` supports Python versions according to
172+
[SPEC0](https://scientific-python.org/specs/spec-0000/). When possible, do not
173+
introduce additional dependencies. If that is necessary, make sure they can be treated
174+
as optional.
175+
176+
#### Procedure
177+
178+
1. *After* opening an issue and discussing with the development team, create a PR with
179+
the proposed changes.
180+
181+
<!-- omit in toc -->
182+
## Attribution
183+
184+
This guide is based on the **contributing-gen**.
185+
[Make your own](https://github.com/bttger/contributing-gen)!

README.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ Geographically weighted modeling based on `scikit-learn`.
1212

1313
The aim of the package is to provide implementations of spatially-explicit modelling.
1414

15-
## Status
16-
17-
Current development status is early beta. API of the package can change without a
18-
warning. Use with caution.
19-
2015
## Features
2116

2217
`gwlearn` provides a framework for prototyping geographically weighted extensions of
@@ -47,9 +42,15 @@ adaptive.fit(
4742

4843
For details, see the [documentation](https://pysal.org/gwlearn).
4944

45+
## Status
46+
47+
Current development status is beta. The core API of the package should not change
48+
without a warning and a proper deprecation cycle. However, minor breaking changes may
49+
still occur.
50+
5051
## Installation
5152

52-
You can install neatnet from PyPI or from conda-forge using the tool of your choice:
53+
You can install gwlearn from PyPI or from conda-forge using the tool of your choice:
5354

5455
```sh
5556
pip install gwlearn
@@ -61,34 +62,6 @@ Or from conda-forge:
6162
conda install gwlearn -c conda-forge
6263
```
6364

64-
### Installing development version
65-
66-
You can either clone the repository:
67-
68-
```sh
69-
git clone https://github.com/pysal/gwlearn.git
70-
cd gwlearn
71-
pip install .
72-
```
73-
74-
Or install directly from Github:
75-
76-
```sh
77-
pip install git+https://github.com/pysal/gwlearn.git
78-
```
79-
80-
The package depends on:
81-
82-
```yaml
83-
geopandas>=1.0.0
84-
joblib>=1.4.0
85-
libpysal>=4.12
86-
numpy>=1.26.0
87-
scipy>=1.12.0
88-
scikit-learn>=1.4.0
89-
pandas>=2.1.0
90-
```
91-
9265
## Bug reports
9366

9467
To search for or report bugs, please see the

docs/source/api.rst

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,51 @@ The API reference provides an overview of all public functions in ``gwlearn``.
88
Base classes
99
------------
1010

11+
Base classes allow creation of geographically weighted versions of scikit-learn
12+
estimators.
13+
1114
.. currentmodule:: gwlearn.base
1215
.. autosummary::
1316
:toctree: generated/
1417

1518
BaseClassifier
1619
BaseRegressor
1720

18-
Regression modelling
19-
--------------------
21+
Linear models
22+
-------------
2023

21-
Linear models:
24+
Implementation of linear models with access to relevant attributes (e.g. local
25+
coefficients).
2226

2327
.. currentmodule:: gwlearn.linear_model
2428
.. autosummary::
2529
:toctree: generated/
2630

2731
GWLinearRegression
32+
GWLogisticRegression
2833

29-
Ensembles:
30-
31-
.. currentmodule:: gwlearn.ensemble
32-
.. autosummary::
33-
:toctree: generated/
34-
35-
GWRandomForestRegressor
36-
GWGradientBoostingRegressor
37-
38-
39-
Classification modelling
40-
------------------------
41-
42-
Linear models:
43-
44-
.. currentmodule:: gwlearn.linear_model
45-
.. autosummary::
46-
:toctree: generated/
34+
Ensemble models
35+
---------------
4736

48-
GWLogisticRegression
37+
Implementation of linear models with access to relevant attributes (e.g. local
38+
feature importance).
4939

50-
Ensembles:
5140

5241
.. currentmodule:: gwlearn.ensemble
5342
.. autosummary::
5443
:toctree: generated/
5544

56-
GWRandomForestClassifier
5745
GWGradientBoostingClassifier
46+
GWGradientBoostingRegressor
47+
GWRandomForestClassifier
48+
GWRandomForestRegressor
49+
5850

5951
Bandwidth search
6052
----------------
6153

54+
Tooling to determine the optimal bandwidths of geographically weighted models.
55+
6256
.. currentmodule:: gwlearn.search
6357
.. autosummary::
6458
:toctree: generated/

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
# "navigation.instant",
100100
# "header.autohide",
101101
"navigation.top",
102-
"navigation.footer",
102+
# "navigation.footer",
103103
# "navigation.tracking",
104104
# "search.highlight",
105105
"search.share",

docs/source/contributing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../../CONTRIBUTING.md
2+
```

0 commit comments

Comments
 (0)