A set of methods to emulate Sentinel-2 based on High-Resolution imagery
Project description
opensr-degradation
Very first steps
Initialize your code
- Initialize
git
inside your repo:
cd opensr-degradation && git init
- If you don't have
Poetry
installed run:
make poetry-download
This installs Poetry as a standalone application. If you prefer, you can simply install it inside your virtual environment.
- Initialize Poetry and install
pre-commit
hooks:
make install
make pre-commit-install
- Run the codestyle:
make codestyle
- Upload initial code to GitHub:
git add .
git commit -m ":tada: Initial commit"
git branch -M main
git remote add origin https://github.com/csaybar/opensr-degradation.git
git push -u origin main
```### Set up bots
- Set up [Dependabot][hub1] to ensure you have the latest dependencies.
- Set up [Stale bot][hub2] for automatic issue closing.
### Poetry
Want to know more about Poetry? Check [its documentation][fs2].
<details>
<summary>Details about Poetry</summary>
<p>
Poetry's [commands][fs3] are very intuitive and easy to learn, like:
- `poetry add numpy@latest`
- `poetry run pytest`
- `poetry publish --build`
etc.
</p>
</details>
### Building and releasing your package
Building a new version of the application contains steps:
- Bump the version of your package `poetry version <version>`. You can pass the new version explicitly, or a rule such as `major`, `minor`, or `patch`. For more details, refer to the [Semantic Versions][fs4] standard;
- Make a commit to `GitHub`;
- Create a `GitHub release`;
- And... publish :slight_smile: `poetry publish --build`
## :dart: What's next
Well, that's up to you. :muscle:
For further setting up your project:
- Look for files and sections marked with `UPDATEME`, these should be updated according to the needs and characteristics of your project;
- **Tip:** If you use VS Code's [`Todo Tree`][wn1] extension, you can even set a specific tag to quickly locate these marks. Update your `settings.json` with:
```json
"todo-tree.highlights.customHighlight": {
"UPDATEME": {
"icon": "pencil",
"iconColour": "#E63946"
}
},
"todo-tree.general.tags": [
"BUG",
"HACK",
"FIXME",
"UPDATEME",
"TODO",
"XXX",
"[ ]"
]
- In order to reduce user prompts and keep things effective, the template generates files with a few assumptions:
- It assumes your main git branch is
master
. If you wish to use another branch name for development, be aware of changes you will have to make in the Issue and Merge Request templates andREADME.md
file so links won't break when you push them to your repo; - It generates a PyPI badge assuming you will be able to publish your project under
opensr-degradation
, change it otherwise;
- It assumes your main git branch is
- Make sure to create your desired Issue labels on your platform before you start tracking them so it ensures you will be able to filter them from the get-go;
- Make changes to your CI configurations to better suit your needs.
If you want to put your project on steroids, here are a few Python tools which can help you depending on what you want to achieve with your application:
Typer
is great for creating CLI applications;Rich
makes it easy to add beautiful formatting in the terminal;tqdm
is a fast, extensible progress bar for Python and CLI;Python Prompt Toolkit
allows you to create more advanced terminal applications, such as a text editor or even your own shell;orjson
, an ultra fast JSON parsing library;Pydantic
is data validation and settings management using Python type hinting;Returns
makes you function's output meaningful, typed, and safe;Loguru
makes logging (stupidly) simple;IceCream
is a little library for sweet and creamy debugging;Hydra
is a framework for elegantly configuring complex applications;FastAPI
is a type-driven asynchronous web framework.
For taking development and exposition of your project to the next level:
- Try out some more badges, not only it looks good, but it also helps people better understand some intricate details on how your project works:
- You can look at dynamic badges available at
Shields.io
; - There is a myriad of standardised static badges at
Simple Badges
; awesome-badges
provides a lot of useful resources to help you deal with badges;
- You can look at dynamic badges available at
- Add your project to
OpenSSF Best Practices
andOSSRank
indexes. If you have greater ambitions for your project and/or expects it to scale at some point, it's worth considering adding it to these trackers;- There are already badges for those set up in your
README.md
file, just waiting for you to update their URLs with your project's index in both services :beaming_face_with_smiling_eyes:
- There are already badges for those set up in your
- Setup a code coverage service for your tests, popular options include:
Coveralls
andCodecov
if you need solely test coverage;Code Climate
andCodacy
for fully-featured code analysis;
- Setup a sponsorship page and allow users and organisations who appreciate your project to help raise for its development (and add a badge in the process! :sunglasses:). Popular platforms are:
Liberapay
;Open Collective
;Ko-fi
;- You can set a Sponsors account directly integrated into GitHub;
- Of course, you can also set any kind of gateway you wish, what works best for you and your project!
And here are a few articles which may help you:
- Open Source Guides;
- A handy guide to financial support for open source;
- GitHub Actions Documentation;
- Makefile tutorial;
- A Comprehensive Look at Testing in Software Development is an article that lays out why testing is crucial for development success. Eric's blog is actually a great reference, covering topics ranging from the basics to advanced techniques and best practices;
- Maybe you would like to add gitmoji to commit names. This is really funny. :grin:
:rocket: Features
Development features
- Support for
Python 3.8
and higher; Poetry
as a dependencies manager. See configuration inpyproject.toml
;- Automatic code formatting with
black
,isort
andpyupgrade
, with ready-to-usepre-commit
hooks; - Code and docstring linting with
flake8
,pydocstyle
andpydoclint
; - Type checks with
mypy
, security checks withsafety
andbandit
; - Testing with
pytest
; - Ready-to-use
.editorconfig
and.gitignore
files. You don't have to worry about those things.
Deployment features
- Issue and Pull Request templates for easy integration with GitHub;
- Predefined CI/CD build workflow for
Github Actions
; - Everything is already set up for security checks, codestyle checks, code formatting, testing, linting etc with
Makefile
. More details in makefile-usage;- Always up-to-date dependencies withDependabot
. You will only need to enable it; - Automatic drafts of new releases with
Release Drafter
. You may see the list of labels inrelease-drafter.yml
. Works perfectly with Semantic Versions specification.
Open source community features
- Ready-to-use Pull Request templates and several Issue templates.
- Files such as:
LICENCE
,CONTRIBUTING.md
,CODE_OF_CONDUCT.md
, andSECURITY.md
are generated automatically; - Loads of predefined badges to make your project stand out, you can either keep them, remove as you wish or be welcome to add even more;
Stale bot
closes abandoned issues after a period of inactivity. Configuration is here;- Semantic Versions specification with
Release Drafter
.
Installation
pip install -U opensr-degradation
or install with Poetry
:
poetry add opensr-degradation
Makefile usage
Makefile
contains a lot of functions for faster development.
1. Download and remove Poetry
To download and install Poetry as a standalone application run:
make poetry-download
To uninstall
make poetry-remove
Or you can install it with pip
inside your virtual environment if you prefer.
2. Install all dependencies and pre-commit hooks
Install requirements with
make install
Pre-commit hooks could be installed after git init
via
make pre-commit-install
3. Codestyle
Automatic formatting uses pyupgrade
, isort
and black
, and can be run with
make codestyle
# or use synonym
make formatting
For codestyle checks only, without rewriting files:
make check-codestyle
Update all dev libraries to the latest version using one command
make update-dev-deps
4. Code security
make check-safety
This command launches Poetry
integrity checks as well as identifies security issues with Safety
and Bandit
.
make check-safety
5. Type checks
Run mypy
static type checker with
make mypy
6. Tests with coverage badges
Run pytest
with all essential parameters predefined with
make test
7. Linters
Run code and docstring linters with flake8
, pydocstyle
and pydoclint
.
make lint
8. All linters
Of course there is a command to rule run all linters in one:
make lint-all
the same as:
make test && make check-codestyle && make lint && make mypy && make check-safety
10. Cleanup
Delete pycache files
make pycache-remove
Remove package build
make build-remove
Delete .DS_STORE files
make dsstore-remove
Remove .mypycache
make mypycache-remove
Or to remove all above run:
make cleanup
:chart_with_upwards_trend: Releases
You can see the list of available releases on the GitHub Releases page.
We follow Semantic Versions specification.
We use Release Drafter
. As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can categorize pull requests in release notes using labels.
List of labels and corresponding titles
Label | Title in Releases |
---|---|
enhancement , feature |
:rocket: Features |
bug , refactoring , bugfix , fix |
:wrench: Fixes & Refactoring |
build , ci , testing |
:package: Build System & CI/CD |
breaking |
:boom: Breaking Changes |
documentation |
:memo: Documentation |
dependencies |
:arrow_up: Dependencies updates |
You can update it in release-drafter.yml . |
GitHub creates the bug
, enhancement
, and documentation
labels for you. Dependabot creates the dependencies
label. Create the remaining labels on the Issues tab of your GitHub repository, when you need them.
:shield: Licence
This project is licenced under the terms of the MIT
licence. See LICENCE for more details.
:page_with_curl: Citation
@misc{opensr-degradation,
author = {Cesar Aybar},
title = {A set of method to make NAIP look like Sentinel-2},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/csaybar/opensr-degradation}}
}
Credits
This project was generated with galactipy
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file opensr-degradation-0.9.2.tar.gz
.
File metadata
- Download URL: opensr-degradation-0.9.2.tar.gz
- Upload date:
- Size: 35.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/24.3.1 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.31.0 rfc3986/1.5.0 tqdm/4.66.1 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 529d8b627c70b28ac17f2ca89b43707d3ca588436e34ec9b1077673ebe435e72 |
|
MD5 | c4ab9514ad1ba291c39409382251e0c7 |
|
BLAKE2b-256 | 3df0382ef890e6f7bb94286074000f5e1f1061a22294b1776f9b9bab867c47a1 |
File details
Details for the file opensr_degradation-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: opensr_degradation-0.9.2-py3-none-any.whl
- Upload date:
- Size: 35.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/24.3.1 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.31.0 rfc3986/1.5.0 tqdm/4.66.1 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5a26fd5cd3bdedff938d352b0deb57d8ac86b67cb4db347244f7e32a38931dd |
|
MD5 | 00c82f9ce56c5d56eef2c43f8b9622bb |
|
BLAKE2b-256 | bf43d3f3193c6e5fee4f0b0dc28be852281f15c90fe1cd3e22ba2bdaa31f5780 |