Skip to main content

A set of methods to emulate Sentinel-2 based on High-Resolution imagery

Project description

opensr-degradation

Python support PyPI Release Repository Releases Licence Expand your project structure from atoms of code to galactic dimensions.

Contributions Welcome Open issues Merge Requests

Poetry Bandit Pre-commit Editorconfig Code style: black isort Docstrings

Semantic versions Pipelines

A set of method to make NAIP look like Sentinel-2

Very first steps

Initialize your code

  1. Initialize git inside your repo:
cd opensr-degradation && git init
  1. 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.

  1. Initialize Poetry and install pre-commit hooks:
make install
make pre-commit-install
  1. Run the codestyle:
make codestyle
  1. 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 and README.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;
  • 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;
  • Add your project to OpenSSF Best Practices and OSSRank 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:
  • Setup a code coverage service for your tests, popular options include:
  • 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:

And here are a few articles which may help you:

:rocket: Features

Development features

Deployment features

Open source community features

  • Ready-to-use Pull Request templates and several Issue templates.
  • Files such as: LICENCE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.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

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 Expand your project structure from atoms of code to galactic dimensions.

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

opensr-degradation-0.9.3.tar.gz (35.1 MB view details)

Uploaded Source

Built Distribution

opensr_degradation-0.9.3-py3-none-any.whl (35.0 MB view details)

Uploaded Python 3

File details

Details for the file opensr-degradation-0.9.3.tar.gz.

File metadata

  • Download URL: opensr-degradation-0.9.3.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

Hashes for opensr-degradation-0.9.3.tar.gz
Algorithm Hash digest
SHA256 ca4edcf1e1504c5d2485c692ce7ca15f87ed980ab9973ffc759a38c8bd27c69c
MD5 47a3092766482ddaf1feed65ca271e88
BLAKE2b-256 c91c2c0f72b555c7578911939655be2a7c8a4fc2ad56d8758703d3a9c57960f5

See more details on using hashes here.

File details

Details for the file opensr_degradation-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: opensr_degradation-0.9.3-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

Hashes for opensr_degradation-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d4b9332bacb0f6b47626614ad534be23bbe7fe1c482997eacd231015b8b6aa7f
MD5 3d676b7da7fbc98301953cbcb172ba42
BLAKE2b-256 55bfc13dac9e059ce416cd98f7a33e760bde7a79f63c33c6b64eb4b56f0ce27c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page