[Git][debian-gis-team/asf-search][master] 4 commits: New upstream version 7.1.2

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Jun 1 16:35:52 BST 2024



Antonio Valentino pushed to branch master at Debian GIS Project / asf-search


Commits:
2a968647 by Antonio Valentino at 2024-06-01T15:21:10+00:00
New upstream version 7.1.2
- - - - -
6349261f by Antonio Valentino at 2024-06-01T15:21:15+00:00
Update upstream source from tag 'upstream/7.1.2'

Update to upstream version '7.1.2'
with Debian dir 04bf3f8884c388aa9f9c8840bd6a00623298075f
- - - - -
ad8b0252 by Antonio Valentino at 2024-06-01T15:22:05+00:00
New upstream release

- - - - -
bae5996d by Antonio Valentino at 2024-06-01T15:22:32+00:00
Set distribution to unstable

- - - - -


7 changed files:

- CHANGELOG.md
- asf_search/ASFProduct.py
- asf_search/Products/ARIAS1GUNWProduct.py
- asf_search/Products/OPERAS1Product.py
- asf_search/search/baseline_search.py
- asf_search/search/search_generator.py
- debian/changelog


Changes:

=====================================
CHANGELOG.md
=====================================
@@ -25,6 +25,13 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 -
 
 -->
+------
+## [v7.1.2](https://github.com/asfadmin/Discovery-asf_search/compare/v7.1.1...v7.1.2)
+### Fixed
+- `OPERAS1Product` subclass now properly assigned to PGE v2.0.1 results
+### Changed
+- `ARIAS1GUNWProduct.is_ARIAS1GUNWProduct()` removed, replaced with `ASFProduct._is_subclass()` implementation
+
 ------
 ## [v7.1.1](https://github.com/asfadmin/Discovery-asf_search/compare/v7.1.0...v7.1.1)
 ### Changed


=====================================
asf_search/ASFProduct.py
=====================================
@@ -424,3 +424,14 @@ class ASFProduct:
             return f(v)
         except TypeError:
             return None
+
+    @staticmethod
+    def _is_subclass(item: Dict) -> bool:
+        """
+        Used to determine which subclass to use for specific edge-cases when parsing results in search methods
+        (Currently implemented for ARIA and OPERA subclasses).
+
+        params:
+        - item (dict): the CMR UMM-G item to read from
+        """
+        raise NotImplementedError()


=====================================
asf_search/Products/ARIAS1GUNWProduct.py
=====================================
@@ -58,7 +58,7 @@ class ARIAS1GUNWProduct(S1Product):
         return None
 
     @staticmethod
-    def is_ARIAS1GUNWProduct(item: Dict) -> bool:
+    def _is_subclass(item: Dict) -> bool:
         platform = ASFProduct.umm_get(item['umm'], 'Platforms', 0, 'ShortName')
         if platform in ['SENTINEL-1A', 'SENTINEL-1B']:
             asf_platform = ASFProduct.umm_get(item['umm'], 'AdditionalAttributes', ('Name', 'ASF_PLATFORM'), 'Values', 0)


=====================================
asf_search/Products/OPERAS1Product.py
=====================================
@@ -19,6 +19,8 @@ class OPERAS1Product(S1Product):
         'polarization': {'path': ['AdditionalAttributes', ('Name', 'POLARIZATION'), 'Values']} # dual polarization is in list rather than a 'VV+VH' style format
     }
 
+    _subclass_concept_ids = { 'C1257995185-ASF', 'C1257995186-ASF', 'C1258354200-ASF', 'C1258354201-ASF', 'C1259974840-ASF', 'C1259976861-ASF', 'C1259981910-ASF', 'C1259982010-ASF', 'C2777436413-ASF', 'C2777443834-ASF', 'C2795135174-ASF', 'C2795135668-ASF','C1260721853-ASF', 'C1260721945-ASF', 'C2803501097-ASF', 'C2803501758-ASF' }
+
     def __init__(self, args: Dict = {}, session: ASFSession = ASFSession()):
         super().__init__(args, session)
 
@@ -78,3 +80,10 @@ class OPERAS1Product(S1Product):
             return (self._read_property('validityStartDate', ''), keys[1])
 
         return keys
+
+    @staticmethod
+    def _is_subclass(item: Dict) -> bool:
+        # not all umm products have this field set, 
+        # but when it's available it's convenient for fast matching
+        concept_id = item['meta'].get('collection-concept-id')
+        return concept_id in OPERAS1Product._subclass_concept_ids


=====================================
asf_search/search/baseline_search.py
=====================================
@@ -52,7 +52,7 @@ def stack_from_product(
     stack.sort(key=lambda product: product.properties['temporalBaseline'])
 
     for warning in warnings:
-        ASF_LOGGER.warn(f'{warning}')
+        ASF_LOGGER.warning(f'{warning}')
     
     return stack
 


=====================================
asf_search/search/search_generator.py
=====================================
@@ -266,6 +266,9 @@ def as_ASFProduct(item: Dict, session: ASFSession) -> ASFProduct:
 
     :returns the granule as an object of type ASFProduct
     """
+    if ASFProductType.OPERAS1Product._is_subclass(item):
+        return ASFProductType.OPERAS1Product(item, session=session)
+
     product_type_key = _get_product_type_key(item)
 
     # if there's a direct entry in our dataset to product type dict
@@ -283,7 +286,7 @@ def as_ASFProduct(item: Dict, session: ASFSession) -> ASFProduct:
 
     # If the platform exists, try to match it
     platform = _get_platform(item=item)
-    if ASFProductType.ARIAS1GUNWProduct.is_ARIAS1GUNWProduct(item=item):
+    if ASFProductType.ARIAS1GUNWProduct._is_subclass(item=item):
         return dataset_to_product_types.get('ARIA S1 GUNW')(item, session=session)
     elif (subclass := dataset_to_product_types.get(platform)) is not None:
         return subclass(item, session=session)
@@ -306,10 +309,10 @@ def _get_product_type_key(item: Dict) -> str:
     collection_shortName = ASFProduct.umm_get(item['umm'], 'CollectionReference', 'ShortName')
 
     if collection_shortName is None:
-        platform = _get_platform(item=item)
-        if ASFProductType.ARIAS1GUNWProduct.is_ARIAS1GUNWProduct(item=item):
+        if ASFProductType.ARIAS1GUNWProduct._is_subclass(item=item):
             return 'ARIA S1 GUNW'
 
+        platform = _get_platform(item=item)
         return platform
 
     return collection_shortName


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+asf-search (7.1.2-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Sat, 01 Jun 2024 15:22:12 +0000
+
 asf-search (7.1.1-1) unstable; urgency=medium
 
   * New upstream release.



View it on GitLab: https://salsa.debian.org/debian-gis-team/asf-search/-/compare/59931e8048a814d1fb6cc7ada297c0a63e2a72ab...bae5996dfd9427121ab79aeac2a1bf833fe13fa7

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/debian-gis-team/asf-search/-/compare/59931e8048a814d1fb6cc7ada297c0a63e2a72ab...bae5996dfd9427121ab79aeac2a1bf833fe13fa7
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240601/0cd14f23/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list