Skip to content

Commit

Permalink
🔨 Add pre-commit hooks and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtralka committed Oct 25, 2021
1 parent 1789419 commit 5cb5a4f
Show file tree
Hide file tree
Showing 9 changed files with 487 additions and 288 deletions.
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-json
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: pretty-format-json
args: [--autofix]
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=auto]
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910-1'
hooks:
- id: mypy
args: [--strict, --ignore-missing-imports, --allow-untyped-decorators]
53 changes: 28 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

## About

*eoplatform* is a Python package that aims to simplify Remote Sensing Earth Observation by providing actionable information on a wide swath of RS platforms and provide a simple API for downloading and visualizing RS imagery. Made for scientsits, educators, and hobbiests alike.
*eoplatform* is a Python package that aims to simplify Remote Sensing Earth Observation by providing actionable information on a wide swath of RS platforms and provide a simple API for downloading and visualizing RS imagery. Made for scientsits, educators, and hobbiests alike.

* Easy to access **information** on RS platforms
* Band information
* Orbit regimes
* Scene statistics
* Band information
* Orbit regimes
* Scene statistics
* Accessible data downloading (in-progress)
* Landsat 8
* Sentinel-2
Expand All @@ -41,13 +41,9 @@ If you want to install the latest version from git you can run
pip install git+git://github.com/mtralka/eoplatform
```


### Example


<img src="images/eoplatform-info-landsat8.PNG" alt="Landsat8 Info" width="600">



## Usage

Expand All @@ -56,10 +52,12 @@ pip install git+git://github.com/mtralka/eoplatform
### CLI

Commands:

* `info` - find platform info
* `download` - download platform scenes

#### Querying platform info
#### Querying platform info (cli)

```sh
Usage: eoplatform info [OPTIONS] PLATFORM

Expand All @@ -71,17 +69,22 @@ Options:
[default: description]
--help Show this message and exit.
```

EX:

$ eoplatform info Landsat8
```sh
eoplatform info Landsat8
```

show all info *eoplatform* has on `Landsat8`

$ eoplatform info Landsat8 -b

```sh
eoplatform info Landsat8 -b
```

shows only `Landsat8`'s bands

#### Downloading platform scenes
#### Downloading platform scenes (cli)

in-progress

Expand All @@ -97,43 +100,41 @@ Options:

### Module import

#### Querying platform info (import)

#### Querying platform info
You can import your desired platform


You can import your desired platform
```
```python
from eoplatform import Landsat8

Landsat8.info() # OR print(Landsat8)
```

or search from the *eoplatform* module itself

```
```python
import eoplatform as eop

eop.info("Landsat8")
```
#### Downloading platform scenes

#### Downloading platform scenes (import)

in-progress

```python
from eoplatform import Landsat8

Landsat8.download()
```

```python
import eoplatform as eop

eop.download("Landsat8")
```

both methods accept the full range of search keword arguments

both methods accept the full range of search keword arguments

## Roadmap

Expand All @@ -145,8 +146,10 @@ See the [open issues](https://github.com/mtralka/EOPlatform/issues) for a list o
## Contributing

Contributions are welcome. Any contributions you make are appreciated.

* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/mtralka/EOPlatform/issues/new) to discuss it, or directly create a pull request with the proposed changes.
* Create individual PR for each suggestion.
* Use pre-commit hooks - `pre-commit install`
* Code style is `black`, `mypy --strict`

## License
Expand Down
1 change: 0 additions & 1 deletion eoplatform/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from eoplatform.cli import app


app(prog_name="eoplatform")
1 change: 0 additions & 1 deletion eoplatform/console.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from rich.console import Console


console = Console()
10 changes: 5 additions & 5 deletions eoplatform/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
from eoplatform.baseClasses import Platform


# if sys.version_info >= (3, 8, 0):
# from typing import Final # type: ignore
# else:
# from typing_extensions import Final
if sys.version_info >= (3, 8, 0):
from typing import Final # type: ignore
else:
from typing_extensions import Final

PLATFORM_PATH: Path = Path("eoplatform/platforms")
PLATFORM_PATH: Final[Path] = Path("eoplatform/platforms")


class EOPlatformFactory:
Expand Down
Loading

0 comments on commit 5cb5a4f

Please sign in to comment.