robintw / Py6S

A Python interface to the 6S Radiative Transfer Model
GNU Lesser General Public License v3.0
191 stars 105 forks source link

Make SixS.test() compatible with the documentation #22

Closed iannis-b closed 8 years ago

iannis-b commented 8 years ago

The documentation states that you can pass the path argument in the SixS.test() method. This is not possible, at least in the 1.6.1 version.

The current code:

def test(self):
        """Runs a simple test to ensure that 6S and Py6S are installed correctly."""
        test = SixS()

should be changes to something like:

def test(cls, path=None):
        """Runs a simple test to ensure that 6S and Py6S are installed correctly."""
        test = cls(path)

Also note, that by using the cls name you avoid hard coding the class name, and you are also compatible with PEP8 (https://www.python.org/dev/peps/pep-0008/#function-and-method-arguments).