@@ -1585,17 +1585,16 @@ def get_scientific_data_product_list(self, *, observation_id=None, tile_index=No
1585
1585
if group is not None :
1586
1586
1587
1587
try :
1588
- _ = conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [category ][group ]
1588
+ product_type_for_category_group_list = conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [category ][
1589
+ group ]
1589
1590
except KeyError :
1590
1591
raise ValueError (
1591
1592
f"Invalid combination of parameters: category={ category } ; group={ group } . Valid "
1592
1593
f"values:\n { pprint .pformat (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS )} " )
1593
1594
1594
- product_type_for_category_list = conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [category ][group ]
1595
-
1596
1595
if product_type is not None :
1597
1596
1598
- if product_type not in product_type_for_category_list :
1597
+ if product_type not in product_type_for_category_group_list :
1599
1598
raise ValueError (
1600
1599
f"Invalid combination of parameters: category={ category } ; group={ group } ; "
1601
1600
f"product_type={ product_type } . Valid values:\n "
@@ -1604,62 +1603,62 @@ def get_scientific_data_product_list(self, *, observation_id=None, tile_index=No
1604
1603
query_extra_condition = query_extra_condition + f" AND product_type ='{ product_type } ' "
1605
1604
else :
1606
1605
1607
- final_products = ', ' .join (f"'{ w } '" for w in product_type_for_category_list )
1606
+ final_products = ', ' .join (f"'{ w } '" for w in product_type_for_category_group_list )
1608
1607
query_extra_condition = query_extra_condition + f" AND product_type IN ({ final_products } ) "
1609
1608
else : # category is not None and group is None
1610
1609
1611
- product_type_for_category_list = [item for row in
1612
- conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [category ]. values ()
1613
- for item in row ]
1610
+ product_type_for_category_group_list = [item for row in
1611
+ conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [category ]
1612
+ . values () for item in row ]
1614
1613
if product_type is not None :
1615
1614
1616
- if product_type not in product_type_for_category_list :
1615
+ if product_type not in product_type_for_category_group_list :
1617
1616
raise ValueError (
1618
1617
f"Invalid combination of parameters: category={ category } ; product_type={ product_type } ."
1619
1618
f" Valid values:\n { pprint .pformat (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS )} " )
1620
1619
1621
1620
query_extra_condition = query_extra_condition + f" AND product_type = '{ product_type } ' "
1622
1621
1623
1622
else : # category is not None and group is None and product_type is None
1624
- final_products = ', ' .join (f"'{ w } '" for w in product_type_for_category_list )
1623
+ final_products = ', ' .join (f"'{ w } '" for w in product_type_for_category_group_list )
1625
1624
query_extra_condition = query_extra_condition + f" AND product_type IN ({ final_products } ) "
1626
1625
else : # category is None
1627
1626
1628
- category_group_dict = {}
1627
+ all_groups_dict = {}
1629
1628
for i in conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS .keys ():
1630
- category_group_dict .update (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [i ])
1629
+ all_groups_dict .update (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS [i ])
1631
1630
1632
1631
if group is not None :
1633
1632
1634
1633
try :
1635
- _ = category_group_dict [group ]
1634
+ _ = all_groups_dict [group ]
1636
1635
except KeyError :
1637
1636
raise ValueError (
1638
1637
f"Invalid combination of parameters: group={ group } . Valid values:\n "
1639
1638
f"{ pprint .pformat (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS )} " )
1640
1639
1641
1640
if product_type is not None :
1642
1641
1643
- if product_type not in category_group_dict [group ]:
1642
+ if product_type not in all_groups_dict [group ]:
1644
1643
raise ValueError (
1645
1644
f"Invalid combination of parameters: group={ group } ; product_type={ product_type } . Valid "
1646
1645
f"values:\n { pprint .pformat (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS )} " )
1647
1646
1648
1647
query_extra_condition = query_extra_condition + f" AND product_type = '{ product_type } ' "
1649
1648
else : # product_type is None
1650
1649
1651
- product_type_for_category_list = [element for sublist in category_group_dict .values () for element in
1652
- sublist ]
1653
- final_products = ', ' .join (f"'{ w } '" for w in product_type_for_category_list )
1650
+ product_type_for_category_group_list = [element for sublist in all_groups_dict .values () for element
1651
+ in sublist ]
1652
+ final_products = ', ' .join (f"'{ w } '" for w in product_type_for_category_group_list )
1654
1653
query_extra_condition = query_extra_condition + f" AND product_type IN ({ final_products } ) "
1655
1654
1656
1655
else : # category is None and group is None
1657
1656
1658
- product_type_for_category_list = [element for sublist in category_group_dict .values () for element in
1659
- sublist ]
1657
+ product_type_for_category_group_list = [element for sublist in all_groups_dict .values () for element
1658
+ in sublist ]
1660
1659
1661
1660
if product_type is not None :
1662
- if product_type not in product_type_for_category_list :
1661
+ if product_type not in product_type_for_category_group_list :
1663
1662
raise ValueError (
1664
1663
f"Invalid combination of parameters: product_type={ product_type } . Valid values:\n "
1665
1664
f"{ pprint .pformat (conf .VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS )} " )
0 commit comments