Skip to content

Latest commit

 

History

History
executable file
·
88 lines (60 loc) · 3.47 KB

CONTRIBUTING.rst

File metadata and controls

executable file
·
88 lines (60 loc) · 3.47 KB

Contributing

Contributions to eemont are welcome! Here you will find how to do it:

  • Bugs: If you find a bug, please report it by opening an issue. if possible, please attach the error, code, version, and other details.
  • Fixing Issues: If you want to contributte by fixing an issue, please check the eemont issues: contributions are welcome for open issues with labels bug and help wanted.
  • Enhancement: New features and modules are welcome! You can check the eemont issues: contributions are welcome for open issues with labels enhancement and help wanted.
  • Documentation: You can add examples, notes and references to the eemont documentation by using the NumPy Docstrings of the eemont documentation, or by creating blogs, tutorials or papers.

Contribution Steps

First, fork the eemont repository and clone it to your local machine. Then, create a development branch:

git checkout -b name-of-dev-branch

eemont is divided according to Earth Engine classes, and you will find a module for each class (e.g. imagecollection.py). Look for the required class as follows:

  • ee.Feature: feature.py
  • ee.FeatureCollection: featurecollection.py
  • ee.Geometry: geometry.py
  • ee.Image: image.py
  • ee.ImageCollection: imagecollection.py

The common.py is used for methods that can be used for more than one Earth Engine class.

When creating new features, please start with the self argument and add the corresponding decorator ( @extend() from the extending module). Check this example:

from .extending import extend

@extend(ee.image.Image, static = False)
def my_new_method(self,other):
     '''Returns the addition of and image and a float.

     Parameters
     ----------
     self : ee.Image [this]
         Image to add.
     other : float
         Float to add.

     Returns
     -------
     ee.Image
         Addition of an ee.Image and a float.

     Examples
     --------
     >>> import ee, eemont
     >>> ee.Initialize()
     >>> img = ee.Image(0).my_new_method(other = 3.14)
     '''
     return self.add(other)

By using the @extend() decorator, the my_new_method() method is added to the ee.Image class. If you want to add a static method, please set the static argument to False. Look for the required class as follows:

  • ee.Feature: ee.feature.Feature
  • ee.FeatureCollection: ee.featurecollection.FeatureCollection
  • ee.Geometry: ee.geometry.Geometry
  • ee.Image: ee.image.Image
  • ee.ImageCollection: ee.imagecollection.ImageCollection
  • ee.List: ee.ee_list.List
  • ee.Number: ee.ee_number.Number

Remember to use Black!

In order to test additions, you can use pytest over the tests folder:

pytest tests

This will automatically test all modules for the available satellite platforms through eemont. If you have added a new feature, please include it in the tests.

To test across different Python versions, please use tox.

Now it's time to commit your changes and push your development branch:

git add .
git commit -m "Description of your work"
git push origin name-of-dev-branch

And finally, submit a pull request.