Skip to content

Commit

Permalink
Merge pull request #58 from raphaelrpl/master
Browse files Browse the repository at this point in the history
🎨 move bdc-catalog dependency as an extra (close #57) and prepare to release 0.6.0
  • Loading branch information
raphaelrpl authored Mar 25, 2022
2 parents 6f93e5e + add2aca commit b1e7aff
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ Changes
=======


Version 0.6.0 (2022-03-25)
--------------------------

- Remove dependency bdc-catalog and move as `extras` `57 <https://github.com/brazil-data-cube/bdc-collectors/issues/57>`_.
- Add support to download Landsat-9 scenes `55 <https://github.com/brazil-data-cube/bdc-collectors/issues/55>`_.
- Improve way to deal with parallel download in Sentinel-2 `53 <https://github.com/brazil-data-cube/bdc-collectors/issues/53>`_.
- Improve error handling for MODIS download `52 <https://github.com/brazil-data-cube/bdc-collectors/issues/52>`_.
- Fix path for Landsat-8 SR collections `50 <https://github.com/brazil-data-cube/bdc-collectors/issues/50>`_.
- Review path for Sentinel-2 SR collections `46 <https://github.com/brazil-data-cube/bdc-collectors/issues/46>`_.


Version 0.4.1 (2021-07-20)
--------------------------

Expand Down
16 changes: 8 additions & 8 deletions bdc_collectors/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
import logging
import warnings
from threading import Lock
from typing import Dict, List, Type
from typing import Any, Dict, List, Type

import pkg_resources
from bdc_catalog.models import Collection, CollectionsProviders, Provider, db
from flask import Flask

from .base import BaseProvider
Expand Down Expand Up @@ -48,11 +47,11 @@ def get_provider(self, provider: str) -> Type[BaseProvider]:
class DataCollector:
"""Data wrapper to store the given instance `bdc_catalog.models.Provider` and the data collector factory."""

_db_provider: Provider
_db_provider: Any
_provider: BaseProvider
_collection_provider: CollectionsProviders
_collection_provider: Any

def __init__(self, instance: Provider, provider: Type[BaseProvider], collection_provider: CollectionsProviders, **kwargs):
def __init__(self, instance, provider: Type[BaseProvider], collection_provider: Any, **kwargs):
"""Create a data collector instance."""
self._db_provider = instance

Expand Down Expand Up @@ -81,7 +80,7 @@ def priority(self) -> bool:
return self._collection_provider.priority

@property
def instance(self) -> Provider:
def instance(self):
"""Retrieve the database instance of bdc_catalog.models.Provider."""
return self._db_provider

Expand Down Expand Up @@ -179,7 +178,7 @@ def get_provider(self, provider: str) -> Type[BaseProvider]:
"""Retrieve a provider class."""
return self.state.get_provider(provider)

def get_provider_order(self, collection: Collection, include_inactive=False, **kwargs) -> List[DataCollector]:
def get_provider_order(self, collection: Any, include_inactive=False, **kwargs) -> List[DataCollector]:
"""Retrieve a list of providers which the bdc_catalog.models.Collection is associated.
Note:
Expand All @@ -190,13 +189,14 @@ def get_provider_order(self, collection: Collection, include_inactive=False, **k
look for provider supported in the entry point `bdc_collectors.providers`.
Args:
collection - A collection instance
collection - An instance of bdc_catalog.models.Collection
include_inactive - List also the inactive providers. Default=False
**kwargs - Extra parameters to pass to the Provider instance.
Returns:
A list of DataCollector, ordered by priority.
"""
from bdc_catalog.models import CollectionsProviders, Provider, db
where = []

if not include_inactive:
Expand Down
2 changes: 1 addition & 1 deletion bdc_collectors/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

"""Version information for BDC-Collectors."""

__version__ = '0.4.1'
__version__ = '0.6.0'

6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
'tests': tests_require,
'modis': [
'pymodis>=2.1,<2.2'
],
'catalog': [
'bdc-catalog @ git+https://github.com/brazil-data-cube/[email protected]',
]
}

Expand All @@ -49,12 +52,11 @@
]

install_requires = [
'bdc-catalog @ git+git://github.com/brazil-data-cube/[email protected]',
'python-dateutil>=2',
'Flask>=1.1.0',
'google-cloud-storage>=1.28,<2',
'beautifulsoup4>=4.9,<5',
'rasterio>=1.1,<1.2',
'rasterio>=1.1,<1.3',
'redis>=3.5,<4',
'sentinelsat>=0.14,<1',
'Shapely>=1.7,<2',
Expand Down

0 comments on commit b1e7aff

Please sign in to comment.