You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -26,22 +26,14 @@ If you are reporting a bug, please include:
26
26
## Creating pull requests
27
27
28
28
1. Fork the repo in Github or go to https://github.com/thinkingmachines/geowrangler/fork
29
-
2.Install and enable `pre-commit` and `poetry`
29
+
2.Set up the development environment following the instructions in [DEVELOPMENT](https://github.com/thinkingmachines/geowrangler/blob/master/DEVELOPMENT.md)
30
30
31
-
```
32
-
pip install poetry>=1.2.0 pre-commit
33
-
pre-commit install
34
-
poetry install
35
-
poetry run pip install pip --upgrade
36
-
poetry run pip install -e .
37
-
```
38
-
39
-
3. Make the necessary changes. See [Developing with nbdev](#developing-with-nbdev) for more info.
31
+
3. Make the necessary contributions. See [Developing with nbdev](#developing-with-nbdev) for more info.
40
32
41
33
4. Run the tests and ensure they all pass before submitting a PR. Also add tests whenever adding a new feature. Finally, clean up tests that are longer applicable.
42
34
43
35
```
44
-
poetry run pytest --cov --cov-config=.coveragerc --cov-fail-under=80 -n auto
36
+
pytest --cov --cov-config=.coveragerc --cov-fail-under=80 -n auto
45
37
```
46
38
47
39
5. Commit and Submit PR for review
@@ -59,10 +51,18 @@ poetry run pytest --cov --cov-config=.coveragerc --cov-fail-under=80 -n auto
59
51
Once the necessary changes are made, run the following to generate the python code.
60
52
61
53
```
62
-
poetry run nbdev_export
63
-
poetry run pre-commit run -a
64
-
poetry run pre-commit run -a
54
+
nbdev_export
65
55
```
66
-
> Note: we are running `pre-commit` twice so that it reformats the modules to comply with the project's formatting/linting standards and the next run checks if it is already compliant.
67
56
57
+
## View contributions on documentation site and edit as needed
58
+
59
+
1. Run nbdev_docs to create the HTML files via Quarto (can verify locally with some port: nbdev_preview --port 4327)
60
+
- Doc site automatically updates once a PR is merged (in Settings > Pages need to make sure [geowrangler.thinkingmachin.es](http://geowrangler.thinkingmachin.es/) is the domain as it defaults to [thinkingmachines.github.io](http://thinkingmachines.github.io/) after merges)
61
+
2. Edit [notebooks/index.ipynb](https://github.com/thinkingmachines/geowrangler/blob/master/notebooks/index.ipynb) to edit the [doc homepage](https://geowrangler.thinkingmachin.es/)
62
+
3. Edit [notebooks/sidebar.yml](https://github.com/thinkingmachines/geowrangler/blob/master/notebooks/sidebar.yml) to edit the left sidebar
68
63
64
+
## Updating Google Colab links in notebooks
65
+
- In notebooks such as tutorial notebooks you may want to add a Google Colab link at the beginning of the notebook for easy accessibility.
66
+
- There is no automatic way yet to update this so it's a manual update of a markdown cell. Since the link points to a notebook in master, testing the Colab button is done after merging. Follow the sample below and replace the notebook name with your contributed notebook name.
67
+
- Sample for notebooks/14_datasets_nightlights.ipynb:
68
+
[](https://colab.research.google.com/github/thinkingmachines/geowrangler/blob/master/notebooks/14_datasets_nightlights.ipynb)
Copy file name to clipboardExpand all lines: mkdocs/docs/README.md
+1-149Lines changed: 1 addition & 149 deletions
Original file line number
Diff line number
Diff line change
@@ -49,152 +49,4 @@ The documentation for [the package is available here](https://geowrangler.thinki
49
49
50
50
If you want to learn more about **Geowrangler** and explore its inner workings, you can setup a local development environment. You can run geowrangler's jupyter notebooks to see how the different modules are built and how they work.
51
51
52
-
53
-
#### Pre-requisites
54
-
55
-
* OS: Linux, MacOS, Windows Subsystem for Linux (WSL) on Windows
56
-
57
-
* Requirements:
58
-
- python 3.7 or higher
59
-
- virtualenv, venv or conda for python environment virtualization
60
-
- poetry for dependency management
61
-
62
-
#### Github Repo Fork
63
-
64
-
If you plan to make contributions to geowrangler, we encourage you to
65
-
[create your fork](https://github.com/thinkingmachines/geowrangler/fork) of the Geowrangler repo.
66
-
67
-
This will then allow you to push commits to your forked repo and
68
-
then create a Pull Request (PR) from your repo to the main geowrangler
69
-
repo for approval by geowrangler's maintainers.
70
-
71
-
#### Development Installation
72
-
73
-
We recommend creating a virtual python environment via [virtualenv](https://pypi.org/project/virtualenv/) or [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html) for your development environment. Please see the relevant documentation for more details on installing these python environment managers. Afterward, continue the geowrangler setup instructions below.
74
-
75
-
76
-
**Set-up with virtualenv**
77
-
78
-
First, install `libgeos` ( version >=3.8 required for building pygeos/shapely) through the ff. commands.
79
-
80
-
*See [libgeos documentation](https://libgeos.org/usage/install/) for installation details on other systems.*
81
-
82
-
```
83
-
sudo apt update # updates package info
84
-
sudo apt install build-essential # installs GCC
85
-
sudo apt install libgeos-dev
86
-
```
87
-
88
-
Next, set-up your Python env with `virtualenv` and install pre-commits and the necessary python libs by running the following commands.
89
-
90
-
Remember to replace `<your-github-id>` in the github url below with your GitHub ID to clone from your fork.
You're all set! [Run the tests](#running-tests) to make sure everything was installed properly.
104
-
105
-
Whenever you open a new terminal, you can `cd <your-local-geowrangler-folder>`
106
-
and run `poetry shell` to activate the geowrangler environment.
107
-
108
-
**Set-up with conda**
109
-
110
-
Run the following commands to set-up a conda env and install geos.
111
-
112
-
```
113
-
conda create -y -n geowrangler-env python=3.9 # replace geowrangler-env if you prefer a different env name
114
-
conda deactivate # important to ensure libs from other envs aren't used
115
-
conda activate geowrangler-env
116
-
conda install -y geos
117
-
```
118
-
119
-
Then run the following to install the pre-commits and python libs.
120
-
```
121
-
cd geowrangler # cd into your geowrangler local directory
122
-
pip install pre-commit poetry>=1.2.0
123
-
pre-commit install
124
-
poetry install
125
-
```
126
-
127
-
You're all set! [Run the tests](#running-tests) to make sure everything was installed properly.
128
-
129
-
Whenever you open a new terminal, run `conda deactivate && conda activate geowrangler-env` to deactivate any conda env, and then activate the geowrangler environment.
130
-
131
-
### Jupyter Notebook Development
132
-
133
-
The code for the **geowrangler** python package resides in Jupyter notebooks located in the `notebooks` folder.
134
-
135
-
Using [nbdev](https://nbdev.fast.ai), we generate the python modules residing in the `geowrangler` folder from code cells in jupyter notebooks marked with an `#export` comment. A `#default_exp <module_name>` comment at the first code cell of each notebook directs `nbdev` to put the code in a module named `<module_name>` in the `geowrangler` folder.
136
-
137
-
See the [nbdev cli](https://nbdev.fast.ai/cli.html) documentation for more details on the commands to generate the package as well as the documentation.
138
-
### Running notebooks
139
-
140
-
Run the following to view the jupyter notebooks in the `notebooks` folder
141
-
142
-
```
143
-
poetry run jupyter lab
144
-
```
145
-
### Generating and viewing the documentation site
146
-
147
-
To generate and view the documentation site on your local machine, the quickest way is to setup [Docker](https://docs.docker.com/get-started/). The following assumes that you have setup docker on your system.
148
-
```
149
-
poetry run nbdev_docs --mk_readme False --force_all True
150
-
docker-compose up jekyll
151
-
```
152
-
153
-
As an alternative if you don't want to use _Docker_ you can [install jekyll](https://jekyllrb.com/docs/installation/) to view the documentation site locally.
154
-
155
-
`nbdev` converts notebooks within the `notebooks/` folder into a jekyll site.
156
-
157
-
From this jekyll site, you can then create a static site.
158
-
159
-
To generate the docs, run the following
160
-
161
-
```
162
-
163
-
poetry run nbdev_docs -mk_readme False --force_all True
164
-
cd docs && bundle i && cd ..
165
-
166
-
```
167
-
168
-
To run the jekyll site, run the following
169
-
170
-
```
171
-
cd docs
172
-
bundle exec jekyll serve
173
-
```
174
-
175
-
### Running tests
176
-
177
-
We are using `pytest` as our test framework. To run all tests and generate a generate a coverage report, run the following.
178
-
179
-
```
180
-
poetry run pytest --cov --cov-config=.coveragerc -n auto
181
-
```
182
-
183
-
184
-
To run a single test or test file
185
-
186
-
```shell
187
-
# for a single test function
188
-
poetry run pytest tests/test_grids.py::test_create_grids
189
-
# for a single test file
190
-
poetry run pytest tests/test_grids.py
191
-
```
192
-
### Contributing
193
-
194
-
Please read [CONTRIBUTING.md](https://github.com/thinkingmachines/geowrangler/blob/master/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/thinkingmachines/geowrangler/blob/master/CODE_OF_CONDUCT.md) before anything.
195
-
196
-
### Development Notes
197
-
198
-
For more details regarding our development standards and processes, please see [our wiki](https://github.com/thinkingmachines/geowrangler/wiki/DeveloperNotes).
199
-
200
-
52
+
Set up the development environment following the instructions in [DEVELOPMENT](https://github.com/thinkingmachines/geowrangler/blob/master/DEVELOPMENT.md)
0 commit comments