forked from TopoToolbox/pytopotoolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Documentation and add CONTRIBUTING (TopoToolbox#40)
* Add introduction and first badges * Add CONTRIBUTING.md * Add badges and introduction * Add Contributing to docs * Rephrase License reference * Change tutorial to Jupyter Notebook * Streamline docs build process * Fix structure and grammar * Add notebook tutorial
- Loading branch information
Showing
11 changed files
with
240 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Contribution Guidelines | ||
|
||
First off, thanks for taking the time to contribute! | ||
|
||
The following is a set of guidelines for contributing to the TopoToolbox Python Library. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. | ||
|
||
## How Can I Contribute? | ||
|
||
### Reporting Bugs | ||
|
||
If you find a bug, please report it by opening an issue. Please include: | ||
|
||
- A clear and descriptive title. | ||
- A detailed description of the problem. | ||
- Steps to reproduce the issue. | ||
- Any error messages you encountered. | ||
|
||
### Suggesting Enhancements | ||
|
||
If you have an idea for an enhancement or new feature, please open an issue to discuss it. Please include: | ||
|
||
- A clear and descriptive title. | ||
- A detailed description of the proposed enhancement. | ||
- Any relevant examples or screenshots. | ||
|
||
### Submitting Pull Requests | ||
|
||
If you have a patch or new feature that you would like to contribute, please submit a [pull request (PR)](https://guides.github.com/introduction/flow/). Before you do, please ensure the following: | ||
|
||
1. Fork the repository and create your branch from `main`. | ||
2. If you have added code that should be tested, add tests. | ||
3. If you have changed APIs, update the documentation. | ||
4. Ensure the test suite passes. | ||
5. Make sure your code lints. | ||
|
||
### Code Style | ||
|
||
Please follow the [PEP 8](https://pep8.org/) style guide for Python code. | ||
|
||
### Commit Messages | ||
|
||
Use [clear and descriptive commit messages](https://cbea.ms/git-commit/). Follow these conventions: | ||
|
||
- Use the present tense ("Analyze terrain" not "Analyzed terrain"). | ||
- Use the imperative mood ("Generate contour map" not "Generates contour map"). | ||
- Limit the first line to 50 characters or less. All other lines should not be longer than 72 characters. | ||
- Reference issues and pull requests liberally. | ||
|
||
### Documentation | ||
|
||
Improvements to the documentation are always welcome. Please ensure that your changes are clear and concise. | ||
|
||
Thank you for contributing! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ Sphinx==7.3.7 | |
sphinx-book-theme==1.1.2 | ||
nbsphinx==0.9.4 | ||
notebook==7.0.5 | ||
jupyter==1.0.0 | ||
myst_parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Tutorial\n", | ||
"\n", | ||
"This tutorial will guide you through the first steps of getting started with the topotoolbox for python. For further examples regarding the functionality and use cases of different functions/classes refer to the provided examples.\n", | ||
"\n", | ||
"## Installation\n", | ||
"\n", | ||
"Before you can use this tutorial the make sure to have the topotoolbox installed as per the installation guide.\n", | ||
"\n", | ||
"## Working with this file\n", | ||
"\n", | ||
"Feel free to [download this notebook](https://github.com/TopoToolbox/pytopotoolbox/blob/main/docs/tutorial.ipynb) so can follow these first steps in an interactive way.\n", | ||
"\n", | ||
"- Downloading the notebook: ```curl -o tutorial.ipynb https://raw.githubusercontent.com/topotoolbox/pytopotoolbox/main/docs/tutorial.ipynb``` or ```wget -O tutorial.ipynb https://raw.githubusercontent.com/topotoolbox/pytopotoolbox/main/docs/tutorial.ipynb```\n", | ||
"\n", | ||
"- You’ll need to install Jupyter Notebook to run this file: pip install notebook\n", | ||
"\n", | ||
"- To plot the DEMs you’ll also need matplotlib installed: pip install matplotlib\n", | ||
"\n", | ||
"- To run the notebook: jupyter notebook\n", | ||
"\n", | ||
"## Working on a first DEM\n", | ||
"\n", | ||
"Before you can actually use the topotoolbox package, it has to be imported. Since we want to plot the DEMs we will also import `matplotlib.pyplot`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import topotoolbox as topo\n", | ||
"import matplotlib.pyplot as plt" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"To automatically download one of the example files, the function `load_dem()` is used. To find out which files are available, use `get_dem_names()`. After the DEM has been created, you can view it’s attributes by using `GridObject.info()`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"print(topo.get_dem_names())\n", | ||
"\n", | ||
"dem = topo.load_dem('taiwan')\n", | ||
"\n", | ||
"print('\\nAttributes of the dem:')\n", | ||
"dem.info()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"When plotting with matplotlib, the DEM behaves like a `np.ndarray`. So you’ll just have to pass it as an argument.\n", | ||
"\n", | ||
"If you want to increase the resolution of the plot, increase the `dpi` value" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fig, ax = plt.subplots(figsize=(10, 10), dpi=100)\n", | ||
"\n", | ||
"ax.imshow(dem, cmap='terrain')\n", | ||
"plt.show()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file was deleted.
Oops, something went wrong.