Skip to content

Commit a8c803e

Browse files
Jorge Fernandez Hernandezbsipocz
authored andcommitted
EUCLIDMNGT-1275 Update variable names
1 parent 068080a commit a8c803e

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

astroquery/esa/euclid/core.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,17 +1585,16 @@ def get_scientific_data_product_list(self, *, observation_id=None, tile_index=No
15851585
if group is not None:
15861586

15871587
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]
15891590
except KeyError:
15901591
raise ValueError(
15911592
f"Invalid combination of parameters: category={category}; group={group}. Valid "
15921593
f"values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}")
15931594

1594-
product_type_for_category_list = conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS[category][group]
1595-
15961595
if product_type is not None:
15971596

1598-
if product_type not in product_type_for_category_list:
1597+
if product_type not in product_type_for_category_group_list:
15991598
raise ValueError(
16001599
f"Invalid combination of parameters: category={category}; group={group}; "
16011600
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
16041603
query_extra_condition = query_extra_condition + f" AND product_type ='{product_type}' "
16051604
else:
16061605

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)
16081607
query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) "
16091608
else: # category is not None and group is None
16101609

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]
16141613
if product_type is not None:
16151614

1616-
if product_type not in product_type_for_category_list:
1615+
if product_type not in product_type_for_category_group_list:
16171616
raise ValueError(
16181617
f"Invalid combination of parameters: category={category}; product_type={product_type}."
16191618
f" Valid values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}")
16201619

16211620
query_extra_condition = query_extra_condition + f" AND product_type = '{product_type}' "
16221621

16231622
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)
16251624
query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) "
16261625
else: # category is None
16271626

1628-
category_group_dict = {}
1627+
all_groups_dict = {}
16291628
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])
16311630

16321631
if group is not None:
16331632

16341633
try:
1635-
_ = category_group_dict[group]
1634+
_ = all_groups_dict[group]
16361635
except KeyError:
16371636
raise ValueError(
16381637
f"Invalid combination of parameters: group={group}. Valid values:\n "
16391638
f"{pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}")
16401639

16411640
if product_type is not None:
16421641

1643-
if product_type not in category_group_dict[group]:
1642+
if product_type not in all_groups_dict[group]:
16441643
raise ValueError(
16451644
f"Invalid combination of parameters: group={group}; product_type={product_type}. Valid "
16461645
f"values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}")
16471646

16481647
query_extra_condition = query_extra_condition + f" AND product_type = '{product_type}' "
16491648
else: # product_type is None
16501649

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)
16541653
query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) "
16551654

16561655
else: # category is None and group is None
16571656

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]
16601659

16611660
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:
16631662
raise ValueError(
16641663
f"Invalid combination of parameters: product_type={product_type}. Valid values:\n "
16651664
f"{pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}")

0 commit comments

Comments
 (0)