Skip to content

Commit

Permalink
updates in CONTRIBUTING and README, changed how they are parsed into …
Browse files Browse the repository at this point in the history
…documentation
  • Loading branch information
AleksMat committed Jan 24, 2019
1 parent a88e828 commit 6cee5cf
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 127 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -108,6 +108,7 @@ ENV/

# Files that Sphinx generates
/docs/source/examples
/docs/source/markdowns
/docs/source/eotasks.rst

# pytest
Expand Down
37 changes: 17 additions & 20 deletions CONTRIBUTING.md
Expand Up @@ -5,28 +5,29 @@ to the library is very much appreciated.

Here is how you can contribute:

* [Bug Reports][bug-reports]
* [Feature Requests][feature-requests]
* [Pull Requests][pull-requests]
* [Bug Reports](#bug-reports)
* [Feature Requests](#feature-requests)
* [Pull Requests](#pull-requests)

All contributors agree to follow our [Code of Conduct](code-of-conduct).
All contributors agree to follow our [Code of Conduct][code-of-conduct].

**eo-learn** is distributed under the [MIT license](LICENSE). When contributing
**eo-learn** is distributed under the [MIT license][license]. When contributing
code to the library, you agree to its terms and conditions. If you would like to
keep parts of your contribution private, you can contact us to discuss about
the best solution.

For any question, feel free to contact us at _eoresearch@sinergise.com_ or through our [Forum][sh-forum].
For any question, feel free to contact us at [eoresearch@sinergise.com](eoresearch@sinergise.com) or through our [Forum][sh-forum].

[code-of-conduct]: https://github.com/sentinel-hub/eo-learn/blob/master/CODE_OF_CONDUCT.md
[license]: https://github.com/sentinel-hub/eo-learn/blob/master/LICENSE
[sh-forum]: https://forum.sentinel-hub.com/

## Bug Reports
[bug-reports]: #bug-reports

We strive to provide high-quality working code, but bugs happen nevertheless.

When reporting a bug, please check [here][open-bug-list] whether
the bug was already reported. If not, open an issue with the **_bug_** label and
the bug was already reported. If not, open an issue with the **bug** label and
report the following information:

* Issue description
Expand All @@ -43,19 +44,17 @@ an issue and clarify.
[open-bug-list]: https://github.com/sentinel-hub/eo-learn/issues?q=state:open+type:issue+label:"bug"

## Feature Requests
[feature-requests]: #feature-requests

Existing feature requests can be found [here][existing-feature-requests].

A new feature request can be created by opening a new issue with the **_enhancement_** label,
A new feature request can be created by opening a new issue with the **enhancement** label,
and describing how the feature would benefit the **eo-learn** community.
Providing an example use-case would help assessing the scope of the
feature request.

[existing-feature-requests]: https://github.com/sentinel-hub/eo-learn/issues?q=state:open+type:issue+label:"enhancement"

## Pull Requests
[pull-requests]: #pull-requests

The GitHub Pull Request (PR) mechanism is the best option to contribute code
to the library. Users can fork the repository, make their contribution to their
Expand All @@ -67,7 +66,7 @@ Existing PRs can be found [here][existing-prs]. Before creating new PRs, you sho
whether someone else has contributed a similar feature, and if so, you can add your
input to the existing code review.

The follwoing guidelines should be observed when creating a PR.
The following guidelines should be observed when creating a PR.

[fork-and-pull]: https://help.github.com/articles/creating-a-pull-request-from-a-fork
[create-pr]: https://help.github.com/articles/creating-a-pull-request/
Expand All @@ -80,16 +79,16 @@ The follwoing guidelines should be observed when creating a PR.
completion of the code review, the branch will be merged into `develop` and, at
the next package release, into `master`.

* Document your PR to help mantainers understand and review your contribution. The PR
* Document your PR to help maintainers understand and review your contribution. The PR
should include:

* Description of contribution;
* Required testing;
* Link to issue/feature request.

* Your contribution should include unit tests, to test correct behaviour of the new feature
and to lower the mantainance effort. Bug fixes as well as new features should include unit tests.
When submitting the PR, check whether the travis CI testing returns any errors, and if it does,
and to lower the maintenance effort. Bug fixes as well as new features should include unit tests.
When submitting the PR, check whether the Travis CI testing returns any errors, and if it does,
please try to fix the issues causing failure. A test `EOPatch` is made available [here][test-eo-patch]
with data for each `FeatureType`. Unit tests evaluating the correctness of new tasks should use data
available in this `EOPatch`. New fields useful for testing purposes can be added, but should
Expand All @@ -108,8 +107,7 @@ The follwoing guidelines should be observed when creating a PR.
Therefore please run `pylint` from the the main folder, which contains the `pylintrc` file, to make sure your
contribution is scored `10.0/10.0`.

#### Contribute an `EOTask`
[create-eo-task]: #create-eo-task
### Contribute an `EOTask`

`EOTask`s allow to apply **eo-learn** workflows to different use-cases, adapting to imaging sources and
processing chain. If you think a task is general enough to be useful to the community, then we would
Expand Down Expand Up @@ -141,14 +139,13 @@ When creating a new task, bear in mind the following:
and pass task parameters as arguments, either in the constructor, or at run-time.
* If in doubt on whether a task is general enough to be of interest to the community, or you are not
sure to which sub-package to contribute your task to, send us an email or open a
[feature request][feature-requests].
[feature request](#feature-requests).

Looking forward to include your contributions into **eo-learn**.


[pypi]: https://pypi.org/
[pypi]: https://pypi.org/project/eo-learn/
[pep-8]: https://www.python.org/dev/peps/pep-0008/
[pylint]: https://www.pylint.org/
[existing-eo-tasks]: https://eo-learn.readthedocs.io/en/latest/eotasks.html
[code-of-conduct][https://github.com/sentinel-hub/eo-learn/blob/master/CODE_OF_CONDUCT.md]
[test-eo-patch]: https://github.com/sentinel-hub/eo-learn/tree/master/example_data/TestEOPatch
26 changes: 19 additions & 7 deletions README.md
Expand Up @@ -2,11 +2,13 @@
[![Build Status](https://travis-ci.org/sentinel-hub/eo-learn.svg?branch=master)](https://travis-ci.org/sentinel-hub/eo-learn)
[![Docs status](https://readthedocs.org/projects/eo-learn/badge/?version=latest)](https://eo-learn.readthedocs.io)
[![License](https://img.shields.io/pypi/l/eo-learn.svg)](https://github.com/sentinel-hub/eo-learn/blob/master/LICENSE)
<img align="right" src="docs/source/figures/eo-learn-logo.png" alt="drawing" width="300"/>
[![Overall downloads](http://pepy.tech/badge/eo-learn)](https://pepy.tech/project/eo-learn)
[![Last month downloads](https://pepy.tech/badge/eo-learn/month)](https://pepy.tech/project/eo-learn)
<img align="right" src="docs/source/figures/eo-learn-logo.png" alt="" width="300"/>


# eo-learn
**`eo-learn` makes extraction of valuable information from satellite imagery easy.**
**eo-learn makes extraction of valuable information from satellite imagery easy.**

The availability of open Earth observation (EO) data through the Copernicus and Landsat programs represents an
unprecedented resource for many EO applications, ranging from ocean and land use and land cover monitoring,
Expand Down Expand Up @@ -42,14 +44,13 @@ At the moment there are the following subpackages:

## Installation

The package requires Python version `>=3.5`. It can be installed with:
The package requires Python version **>=3.5** . It can be installed with:

```bash
pip install eo-learn
```

however it is also possible to install each subpackage separately:

In order to avoid heavy package dependencies it is possible to install each subpackage separately:
```bash
pip install eo-learn-core
pip install eo-learn-coregistration
Expand All @@ -60,12 +61,23 @@ pip install eo-learn-mask
pip install eo-learn-ml-tools
```

Before installing `eo-learn` on **Windows** it is recommended to install the following packages from [Unofficial Windows wheels repository](https://www.lfd.uci.edu/~gohlke/pythonlibs/):

```bash
gdal
rasterio
shapely
fiona
```

One of dependecies of `eo-learn-mask` subpackage is `lightgbm` package. If having problems during installation please check [LightGBM installation guide](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html).

## Documentation

For more information on the package content, visit [readthedocs](https://eo-learn.readthedocs.io/).


# Blog posts
## Blog posts

* [Introducing eo-learn](https://medium.com/sentinel-hub/introducing-eo-learn-ab37f2869f5c)
* [Land Cover Classification with eo-learn: Part 1 - Mastering Satellite Image Data in an Open-Source Python Environment](https://medium.com/sentinel-hub/land-cover-classification-with-eo-learn-part-1-2471e8098195)
Expand All @@ -75,4 +87,4 @@ For more information on the package content, visit [readthedocs](https://eo-lear

## License

See [LICENSE](LICENSE).
See [LICENSE](https://github.com/sentinel-hub/eo-learn/blob/master/LICENSE).
67 changes: 0 additions & 67 deletions docs/source/README.md

This file was deleted.

45 changes: 43 additions & 2 deletions docs/source/conf.py
Expand Up @@ -202,15 +202,56 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/3.6/': None}


EXAMPLES_FOLDER = './examples'
MARKDOWNS_FOLDER = './markdowns'

# copy examples
shutil.rmtree('./examples', ignore_errors=True)
shutil.rmtree(EXAMPLES_FOLDER, ignore_errors=True)
shutil.rmtree(MARKDOWNS_FOLDER, ignore_errors=True)

try:
shutil.copytree('../../examples', './examples')
shutil.copytree('../../examples', EXAMPLES_FOLDER)
os.mkdir(MARKDOWNS_FOLDER)
shutil.copyfile('../../CONTRIBUTING.md', os.path.join(MARKDOWNS_FOLDER, 'CONTRIBUTING.md'))
except FileExistsError:
pass


def process_readme():
""" Function which will process README.md file and divide it into INTRO.md and INSTALL.md, which will be used in
documentation
"""
with open('../../README.md', 'r') as file:
readme = file.read()

readme = readme.replace('# eo-learn', '# Introduction').replace('docs/source/', '')
readme = readme.replace('**`', '**').replace('`**', '**')

chapters = [[]]
for line in readme.split('\n'):
if line.strip().startswith('## '):
chapters.append([])
if line.startswith('<img'):
line = '<p></p>'

chapters[-1].append(line)

chapters = ['\n'.join(chapter) for chapter in chapters]

intro = '\n'.join([chapter for chapter in chapters if not (chapter.startswith('## Install') or
chapter.startswith('## Documentation'))])
install = '\n'.join([chapter for chapter in chapters if chapter.startswith('## Install')])

with open(os.path.join(MARKDOWNS_FOLDER, 'INTRO.md'), 'w') as file:
file.write(intro)
with open(os.path.join(MARKDOWNS_FOLDER, 'INSTALL.md'), 'w') as file:
file.write(install)


process_readme()


# Create a list of all EOTasks
def get_subclasses(cls):
direct_subclasses = cls.__subclasses__()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contribute.rst
@@ -1 +1 @@
.. mdinclude:: CONTRIBUTING.md
.. mdinclude:: markdowns/CONTRIBUTING.md
14 changes: 1 addition & 13 deletions docs/source/index.rst
@@ -1,12 +1,7 @@
.. eo-learn documentation master file, created by
sphinx-quickstart on Wed Jul 11 10:54:53 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Introduction
============

.. mdinclude:: README.md
.. mdinclude:: markdowns/INTRO.md

.. toctree::
:maxdepth: 1
Expand All @@ -20,10 +15,3 @@ Introduction
examples
eolearn
contribute

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
18 changes: 1 addition & 17 deletions docs/source/install.rst
@@ -1,17 +1 @@
************
Installation
************

The package requires Python version `>=3.5`. It can be installed with::

$ pip install eo-learn

however it is also possible to install each subpackage separately::

$ pip install eo-learn-core
$ pip install eo-learn-coregistration
$ pip install eo-learn-features
$ pip install eo-learn-geometry
$ pip install eo-learn-io
$ pip install eo-learn-mask
$ pip install eo-learn-ml-tools
.. mdinclude:: markdowns/INSTALL.md

0 comments on commit 6cee5cf

Please sign in to comment.