Skip to content

Commit

Permalink
Modifying tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed May 28, 2024
1 parent f7e3a61 commit 53a420a
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docsrc/articles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Articles
:maxdepth: 1

notebooks/get_started/get_started.ipynb
notebooks/large_country/large_country
notebooks/large_countries/large_countries

13 changes: 2 additions & 11 deletions docsrc/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
.. include:: ../README.rst

Table of contents
=================

.. toctree::
:hidden:
:maxdepth: 2

Home <self>
notebooks/get_started/get_started
articles
reference
python_api
indices
changelog
license

Indices and tables
------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

1 change: 0 additions & 1 deletion docsrc/indices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
File renamed without changes
7 changes: 7 additions & 0 deletions docsrc/python_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Python API
**********

.. toctree::
:maxdepth: 2

python_api/functions.rst
3 changes: 3 additions & 0 deletions docsrc/python_api/functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. autofunction:: geefcc.get_fcc
.. autofunction:: geefcc.sum_raster_bands
.. autofunction:: geefcc.make_dir
12 changes: 0 additions & 12 deletions docsrc/reference.rst

This file was deleted.

2 changes: 1 addition & 1 deletion geefcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .ee_initialize import ee_initialize
from .get_fcc import get_fcc
from .sum_raster_bands import sum_raster_bands
from . import misc
from .misc import make_dir

# GDAL exceptions
gdal.UseExceptions()
Expand Down
8 changes: 4 additions & 4 deletions test/test_get_fcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Import
import os

from geefcc import get_fcc, ee_initialize
import geefcc as gf

# "EARTHENGINE_TOKEN" for GitHub actions
# https://github.com/gee-community/geemap/discussions/1341
Expand All @@ -13,15 +13,15 @@
# with the name EARTHENGINE_TOKEN.

# Initialize GEE
ee_initialize(
gf.ee_initialize(
token_name="EARTHENGINE_TOKEN",
project="forestatrisk",
opt_url="https://earthengine-highvolume.googleapis.com")


def test_get_fcc_extent_tmf():
"""Testing get_fcc()."""
get_fcc(
gf.get_fcc(
# Extent for Reunion Island
aoi=(55.21625137, -21.38986015, 55.83736038, -20.87180519),
buff=0.08983152841195216,
Expand All @@ -35,7 +35,7 @@ def test_get_fcc_extent_tmf():

def test_get_fcc_extent_gfc():
"""Testing get_fcc()."""
get_fcc(
gf.get_fcc(
# Extent for Reunion Island
aoi=(55.21625137, -21.38986015, 55.83736038, -20.87180519),
buff=0.08983152841195216,
Expand Down
24 changes: 24 additions & 0 deletions test/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# ==============================================================================
# author :Ghislain Vieilledent
# email :[email protected], [email protected]
# web :https://ecology.ghislainv.fr
# python_version :>=2.7
# license :GPLv3
# ==============================================================================


# test_import
def test_import():
"""Test import."""
imp = True
try:
import geefcc
except ImportError:
imp = False
assert imp is True


# End

0 comments on commit 53a420a

Please sign in to comment.