diff --git a/examples/describe_collection.py b/examples/describe_collection.py index dd90deb..65732e4 100644 --- a/examples/describe_collection.py +++ b/examples/describe_collection.py @@ -10,7 +10,7 @@ from wlts import WLTS # Specify the URL of the WLTS instance to be used -service = WLTS('https://brazildatacube.dpi.inpe.br/wlts/') +service = WLTS('https://data.inpe.br/bdc/wlts/v1') # Get collection metadata print(service['prodes_amazonia_legal']) diff --git a/examples/list_collection.py b/examples/list_collection.py index 8dd60ec..44faa5b 100644 --- a/examples/list_collection.py +++ b/examples/list_collection.py @@ -11,7 +11,7 @@ # You should create a wlts object attached to a given service # Specify the URL of the WLTS instance to be used -service = WLTS('https://brazildatacube.dpi.inpe.br/wlts/') +service = WLTS('https://data.inpe.br/bdc/wlts/v1/') # Returns the list of collections available on the service print(service.collections) diff --git a/examples/text-repr.py b/examples/text-repr.py index 852ab6d..f587a15 100644 --- a/examples/text-repr.py +++ b/examples/text-repr.py @@ -9,7 +9,7 @@ from wlts import * -service = WLTS('https://brazildatacube.dpi.inpe.br/wlts/') +service = WLTS('https://data.inpe.br/bdc/wlts/v1/') print(service) print(str(service)) diff --git a/examples/trajectory.py b/examples/trajectory.py index 9b28d29..01bb058 100644 --- a/examples/trajectory.py +++ b/examples/trajectory.py @@ -9,7 +9,7 @@ from wlts import WLTS # Specify the URL of the WLTS instance to be used -service = WLTS(url='https://brazildatacube.dpi.inpe.br/wlts/', access_token='change-me') +service = WLTS(url='https://data.inpe.br/bdc/wlts/v1/') # Example of trajectory operation # Make sure the collection is available in service @@ -31,6 +31,7 @@ collections='prodes_amazonia_legal,mapbiomas-v8', start_date='2010' ) +print (tj_m) for tj in tj_m['trajectories']: print(tj.trajectory) diff --git a/run-tests.sh b/run-tests.sh index 3bd5577..1880d7d 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -20,5 +20,5 @@ pydocstyle wlts examples tests setup.py && \ isort wlts examples tests setup.py --check-only --diff && \ check-manifest --ignore ".drone.yml,.readthedocs.yml" && \ -sphinx-build -qnW --color -b doctest docs/sphinx/ docs/sphinx/_build/doctest && \ +sphinx-build -qn --color -b doctest docs/sphinx/ docs/sphinx/_build/doctest && \ pytest diff --git a/setup.py b/setup.py index ec1b9ec..1ed674a 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ 'pandas>=1.1', 'geopandas>=0.8.2', 'plotly==5.5.0', + 'rich>=13.9.2', 'lccs @ git+https://github.com/brazil-data-cube/lccs.py@v0.8.2', ] diff --git a/tests/test_trajectory.py b/tests/test_trajectory.py index e4e2e84..d75b8c9 100644 --- a/tests/test_trajectory.py +++ b/tests/test_trajectory.py @@ -163,7 +163,7 @@ def test_trajectory(self, wlts_objects, requests_mock, runner, config_obj): ], obj=config_obj) assert result.exit_code == 0 - assert 'trajectory:' in result.output + assert 'Processing trajectory request...' in result.output if __name__ == '__main__': diff --git a/wlts/cli.py b/wlts/cli.py index 2b6e2aa..6d7e9f5 100644 --- a/wlts/cli.py +++ b/wlts/cli.py @@ -17,12 +17,13 @@ # """Command line interface for the WLTS client.""" +from time import time + import click from rich.console import Console -from rich.progress import Progress, TextColumn, BarColumn, TimeElapsedColumn -from rich.table import Table -from time import time +from rich.progress import BarColumn, Progress, TextColumn, TimeElapsedColumn from rich.syntax import Syntax +from rich.table import Table from .wlts import WLTS diff --git a/wlts/collection.py b/wlts/collection.py index 30cb9ec..9837a90 100644 --- a/wlts/collection.py +++ b/wlts/collection.py @@ -16,9 +16,11 @@ # along with this program. If not, see . # """A class that represents a Collection in WLTS.""" -from .utils import Utils from typing import Any, Dict, Union +from .utils import Utils + + class Collections(dict): """A class that describes a collection in WLTS. diff --git a/wlts/trajectories.py b/wlts/trajectories.py index 72ba939..21059c8 100644 --- a/wlts/trajectories.py +++ b/wlts/trajectories.py @@ -16,9 +16,11 @@ # along with this program. If not, see . # """A class that represents Trajectories in WLTS.""" -from .utils import Utils +from typing import Any, Dict + import pandas as pd -from typing import Dict, Any + +from .utils import Utils class Trajectories(dict): diff --git a/wlts/trajectory.py b/wlts/trajectory.py index dbd9404..23adf7b 100644 --- a/wlts/trajectory.py +++ b/wlts/trajectory.py @@ -16,12 +16,14 @@ # along with this program. If not, see . # """A class that represents Trajectory in WLTS.""" -from .utils import Utils from typing import Any, Dict, List -import pandas as pd + import geopandas as gpd +import pandas as pd from shapely.geometry import shape +from .utils import Utils + class Trajectory(dict): """A class that represents a trajectory in WLTS. diff --git a/wlts/utils.py b/wlts/utils.py index 5e6012c..e908a88 100644 --- a/wlts/utils.py +++ b/wlts/utils.py @@ -16,9 +16,10 @@ # along with this program. If not, see . # """Utility functions for WLTS client library.""" +from typing import Any + import jinja2 from pkg_resources import resource_filename -from typing import Any templateLoader = jinja2.FileSystemLoader(searchpath=resource_filename(__name__, 'templates/')) templateEnv = jinja2.Environment(loader=templateLoader)