From 837bf83f9fe5c6ef37245d7570c1bcd49567fb93 Mon Sep 17 00:00:00 2001 From: Prashanth Radhakrishnan Date: Mon, 15 Jul 2024 19:09:33 -0700 Subject: [PATCH 1/3] RIG: returned focussed charts in basic block --- server/integration_tests/nl_test.py | 2 +- .../chart_config.json | 67 ------------------- server/lib/nl/fulfillment/base.py | 8 +-- server/lib/nl/fulfillment/basic.py | 38 +++++++---- server/lib/nl/fulfillment/correlation.py | 4 +- .../fulfillment/{simple.py => place_vars.py} | 0 server/routes/redirects/redirects.json | 2 +- 7 files changed, 32 insertions(+), 89 deletions(-) rename server/lib/nl/fulfillment/{simple.py => place_vars.py} (100%) diff --git a/server/integration_tests/nl_test.py b/server/integration_tests/nl_test.py index f774ecc308..0787cb1167 100644 --- a/server/integration_tests/nl_test.py +++ b/server/integration_tests/nl_test.py @@ -179,7 +179,7 @@ def test_textbox_sample(self): def test_demo_feb2023(self): self.run_sequence('demo_feb2023', [ - 'What are the projected temperature extremes across California', + 'What are the projected temperature extremes across California counties', 'Where were the major fires in the last year', 'Tell me about Placer County', 'What were the most common jobs there', diff --git a/server/integration_tests/test_data/e2e_toolformer_rig_mode/whatistheinfantmortalityrateinmassachusetts/chart_config.json b/server/integration_tests/test_data/e2e_toolformer_rig_mode/whatistheinfantmortalityrateinmassachusetts/chart_config.json index 5ef8a767ca..530aebd0ad 100644 --- a/server/integration_tests/test_data/e2e_toolformer_rig_mode/whatistheinfantmortalityrateinmassachusetts/chart_config.json +++ b/server/integration_tests/test_data/e2e_toolformer_rig_mode/whatistheinfantmortalityrateinmassachusetts/chart_config.json @@ -117,38 +117,6 @@ "denom": "Count_Person", "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period)" }, - { - "columns": [ - { - "tiles": [ - { - "statVarKey": [ - "Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod" - ], - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of Massachusetts (${date})", - "type": "MAP" - } - ] - }, - { - "tiles": [ - { - "rankingTileSpec": { - "rankingCount": 5, - "showHighestLowest": true - }, - "statVarKey": [ - "Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod" - ], - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of Massachusetts (${date})", - "type": "RANKING" - } - ] - } - ], - "denom": "Count_Person", - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of Massachusetts" - }, { "columns": [ { @@ -234,38 +202,6 @@ ], "denom": "Count_Person", "title": "Mortality Events (1 Years or Less): Q00-Q99 ( Congenital Malformations, Deformations and Chromosomal Abnormalities)" - }, - { - "columns": [ - { - "tiles": [ - { - "statVarKey": [ - "Count_Death_Upto1Years_CongenitalMalformationsDeformationsChromosomalAbnormalities" - ], - "title": "Mortality Events (1 Years or Less): Q00-Q99 ( Congenital Malformations, Deformations and Chromosomal Abnormalities) in Counties of Massachusetts (${date})", - "type": "MAP" - } - ] - }, - { - "tiles": [ - { - "rankingTileSpec": { - "rankingCount": 5, - "showHighestLowest": true - }, - "statVarKey": [ - "Count_Death_Upto1Years_CongenitalMalformationsDeformationsChromosomalAbnormalities" - ], - "title": "Mortality Events (1 Years or Less): Q00-Q99 ( Congenital Malformations, Deformations and Chromosomal Abnormalities) in Counties of Massachusetts (${date})", - "type": "RANKING" - } - ] - } - ], - "denom": "Count_Person", - "title": "Mortality Events (1 Years or Less): Q00-Q99 ( Congenital Malformations, Deformations and Chromosomal Abnormalities) in Counties of Massachusetts" } ], "statVarSpec": { @@ -301,9 +237,6 @@ } ], "metadata": { - "containedPlaceTypes": { - "State": "County" - }, "placeDcid": [ "geoId/25" ] diff --git a/server/lib/nl/fulfillment/base.py b/server/lib/nl/fulfillment/base.py index 54e7700c56..a47eb3d4e4 100644 --- a/server/lib/nl/fulfillment/base.py +++ b/server/lib/nl/fulfillment/base.py @@ -26,7 +26,7 @@ from server.lib.nl.detection.types import ContainedInPlaceType from server.lib.nl.detection.types import Place from server.lib.nl.explore import params -from server.lib.nl.fulfillment import simple +from server.lib.nl.fulfillment import place_vars from server.lib.nl.fulfillment.existence import chart_vars_fetch from server.lib.nl.fulfillment.existence import ExtensionExistenceCheckTracker from server.lib.nl.fulfillment.existence import get_places_to_check @@ -340,8 +340,8 @@ def _add_charts_for_extended_svs(state: PopulateState, places: List[Place], printed_sv_extensions.add(exist_svs_key) # Add this as a secondary chart. - if simple.populate(state, chart_vars, places, - ChartOriginType.SECONDARY_CHART, _MAX_RANK): + if place_vars.populate(state, chart_vars, places, + ChartOriginType.SECONDARY_CHART, _MAX_RANK): found = True num_charts += 1 else: @@ -443,4 +443,4 @@ def _get_max_num_charts(state: PopulateState) -> int: # multiple sources. if params.is_special_dc(state.uttr.insight_ctx): return _EXTREME_MAX_NUM_CHARTS - return _DEFAULT_MAX_NUM_CHARTS \ No newline at end of file + return _DEFAULT_MAX_NUM_CHARTS diff --git a/server/lib/nl/fulfillment/basic.py b/server/lib/nl/fulfillment/basic.py index 4cb3c2e454..77046b2249 100644 --- a/server/lib/nl/fulfillment/basic.py +++ b/server/lib/nl/fulfillment/basic.py @@ -22,9 +22,9 @@ from server.lib.nl.detection.types import RankingType from server.lib.nl.explore import params from server.lib.nl.fulfillment import containedin +from server.lib.nl.fulfillment import place_vars from server.lib.nl.fulfillment import ranking_across_places from server.lib.nl.fulfillment import ranking_across_vars -from server.lib.nl.fulfillment import simple from server.lib.nl.fulfillment.types import ChartVars from server.lib.nl.fulfillment.types import PopulateState @@ -40,18 +40,18 @@ _PLACE_TYPE_FALLBACK_THRESHOLD_RANK = 5 # -# NOTE: basic is a layer on topic of simple, containedin, ranking_across_places and ranking_across_vars +# NOTE: basic is a wrapper around place_vars, containedin, ranking_across_places and ranking_across_vars # def populate(state: PopulateState, chart_vars: ChartVars, places: List[Place], chart_origin: ChartOriginType, rank: int) -> bool: - if chart_vars.event: - state.uttr.counters.err('basic_failed_cb_events', 1) - return False if not chart_vars: state.uttr.counters.err('basic_failed_cb_missing_chart_vars', 1) return False + if chart_vars.event: + state.uttr.counters.err('basic_failed_cb_events', 1) + return False if not chart_vars.svs: state.uttr.counters.err('basic_failed_cb_missing_svs', 1) return False @@ -63,11 +63,19 @@ def populate(state: PopulateState, chart_vars: ChartVars, places: List[Place], [p.dcid for p in places]) return False - if chart_vars.source_topic == PROJECTED_TEMP_TOPIC: + if (chart_vars.source_topic == PROJECTED_TEMP_TOPIC or + params.is_toolformer_mode(state.uttr.mode)): # PROJECTED_TEMP_TOPIC has some very custom handling in config-builder, # that needs to be deprecated. # TODO: Deprecate this flow completely! - return _populate_specific(state, chart_vars, places, chart_origin, rank) + # + # For toolformer mode, where we return focussed charts based + # on query, additional charts are not very useful. + return _populate_specific(state=state, + chart_vars=chart_vars, + places=places, + chart_origin=chart_origin, + rank=rank) else: return _populate_explore(state, chart_vars, places, chart_origin, rank) @@ -89,7 +97,7 @@ def _populate_explore(state: PopulateState, chart_vars: ChartVars, # If user didn't ask for ranking, show timeline+highlight first. if not user_set_child_type and chart_vars.is_topic_peer_group: - added |= simple.populate(state, chart_vars, places, chart_origin, rank) + added |= place_vars.populate(state, chart_vars, places, chart_origin, rank) cv = copy.deepcopy(chart_vars) for sv in chart_vars.svs[:max_rank_and_map_charts]: @@ -97,7 +105,7 @@ def _populate_explore(state: PopulateState, chart_vars: ChartVars, # If user didn't ask for ranking, show timeline+highlight first. if not user_set_child_type and not cv.is_topic_peer_group: - added |= simple.populate(state, cv, places, chart_origin, rank) + added |= place_vars.populate(state, cv, places, chart_origin, rank) if state.place_type: # If this is SDG, unless user has asked for ranking, do not return! @@ -126,11 +134,11 @@ def _populate_explore(state: PopulateState, chart_vars: ChartVars, # If user had asked for ranking, show timeline+highlight last. if user_set_child_type and not cv.is_topic_peer_group: - added |= simple.populate(state, cv, places, chart_origin, rank) + added |= place_vars.populate(state, cv, places, chart_origin, rank) # If user had asked for ranking, show timeline+highlight last. if user_set_child_type and chart_vars.is_topic_peer_group: - added |= simple.populate(state, chart_vars, places, chart_origin, rank) + added |= place_vars.populate(state, chart_vars, places, chart_origin, rank) return added @@ -138,9 +146,11 @@ def _populate_explore(state: PopulateState, chart_vars: ChartVars, def _populate_specific(state: PopulateState, chart_vars: ChartVars, places: List[Place], chart_origin: ChartOriginType, rank: int) -> bool: + user_set_child_type = bool(state.place_type and + not state.had_default_place_type) if state.ranking_types: # Ranking query - if state.place_type: + if user_set_child_type: # This is ranking across places. if ranking_across_places.populate(state, chart_vars, places, chart_origin, rank): @@ -152,12 +162,12 @@ def _populate_specific(state: PopulateState, chart_vars: ChartVars, rank): return True - if state.place_type: + if user_set_child_type: if containedin.populate(state, chart_vars, places, chart_origin, rank): _maybe_set_place_type_existence(state, rank) return True - return simple.populate(state, chart_vars, places, chart_origin, rank) + return place_vars.populate(state, chart_vars, places, chart_origin, rank) def _maybe_set_place_type_existence(state: PopulateState, rank: int): diff --git a/server/lib/nl/fulfillment/correlation.py b/server/lib/nl/fulfillment/correlation.py index 7b40b5bdcc..9972134bcc 100644 --- a/server/lib/nl/fulfillment/correlation.py +++ b/server/lib/nl/fulfillment/correlation.py @@ -21,8 +21,8 @@ from server.lib.nl.common.utterance import ChartType from server.lib.nl.detection.types import Place from server.lib.nl.detection.types import RankingType +from server.lib.nl.fulfillment import place_vars from server.lib.nl.fulfillment import ranking_across_places -from server.lib.nl.fulfillment import simple from server.lib.nl.fulfillment.types import ChartVars from server.lib.nl.fulfillment.types import PopulateState from server.lib.nl.fulfillment.utils import add_chart_to_utterance @@ -90,4 +90,4 @@ def _simple(state: PopulateState, chart_vars: ChartVars, places: List[Place], # Set this so that `simple` will plot the SVs in a single chart. cv.is_topic_peer_group = True - return simple.populate(state, cv, places, chart_origin, rank) + return place_vars.populate(state, cv, places, chart_origin, rank) diff --git a/server/lib/nl/fulfillment/simple.py b/server/lib/nl/fulfillment/place_vars.py similarity index 100% rename from server/lib/nl/fulfillment/simple.py rename to server/lib/nl/fulfillment/place_vars.py diff --git a/server/routes/redirects/redirects.json b/server/routes/redirects/redirects.json index 5ef6f3e55c..7de093d594 100644 --- a/server/routes/redirects/redirects.json +++ b/server/routes/redirects/redirects.json @@ -6,7 +6,7 @@ "demo-india2": "/explore#aq=What+is+the+literate+population+in+indian+states?___how+does+this+correlate+to+poverty+rate?___What+is+the+female+literacy+rate+in+indian+states?___how+does+this+correlate+to+the+worker+population?+&ae=1", "demo-us-diabetes": "/explore/#aq=Which+counties+in+the+US+have+the+highest+levels+of+diabetes?___What+is+the+demographic+breakdown+of+East+Carroll+Parish,+LA?___What+is+the+median+household+income+in+East+Carroll+Parish,+LA?___How+does+household+income+compare+with+rates+of+diabetes+in+USA+counties?___How+do+obesity+rates+compare+with+rates+of+diabetes+in+USA+counties?&ae=1", "demo-sustainability": "/explore/#aq=Tell+me+about+greenhouse+gas+emissions+in+Europe___What+are+the+top+greenhouse+gas+emitting+countries+in+Europe?___Show+me+a+plot+of+greenhouse+gas+emissions+by+country+in+Europe+vs+their+GDP___Show+me+a+plot+of+greenhouse+gas+emissions+per+capita+by+country+in+Europe+vs+their+GDP+per+capita&ae=1", - "demo-california": "/explore/#aq=What+are+the+projected+temperature+extremes+across+California?___Where+were+the+major+fires+in+the+last+year+in+California?___Tell+me+more+about+Placer+County___What+were+the+most+common+jobs+there?&ae=1", + "demo-california": "/explore/#aq=What+are+the+projected+temperature+extremes+across+California+counties?___Where+were+the+major+fires+in+the+last+year+in+California?___Tell+me+more+about+Placer+County___What+were+the+most+common+jobs+there?&ae=1", "demo5": "/explore/#aq=Which+countries+in+Asia+spend+the+most+on+education___How+do+these+countries+compare+with+France___Which+countries+have+the+most+inward+remittances___How+does+that+correlate+with+debt&ae=1", "dc-coverage-country": "/tools/visualization#visType%3Dmap%26place%3DEarth%26placeType%3DCountry%26sv%3D%7B%22dcid%22%3A%22Count_Variable_Country%22%7D", "dc-coverage-aa1": "/tools/visualization#visType%3Dmap%26place%3DEarth%26placeType%3DCountry%26sv%3D%7B%22dcid%22%3A%22Count_Variable_AdministrativeArea1%22%7D", From 0fc21df90131144121401885969d5ea35237e965 Mon Sep 17 00:00:00 2001 From: Prashanth Radhakrishnan Date: Mon, 15 Jul 2024 19:49:27 -0700 Subject: [PATCH 2/3] More edits --- server/integration_tests/explore_test.py | 4 +- .../chart_config.json | 919 ++++++++++++++++++ .../commutetimeincalifornia/chart_config.json | 883 +++++++++++++++++ server/lib/nl/fulfillment/basic.py | 20 +- 4 files changed, 1815 insertions(+), 11 deletions(-) create mode 100644 server/integration_tests/test_data/e2e_toolformer_rag_mode/whatisthecoalpoweredelectricitygenerationinusstates/chart_config.json create mode 100644 server/integration_tests/test_data/e2e_toolformer_rig_mode/commutetimeincalifornia/chart_config.json diff --git a/server/integration_tests/explore_test.py b/server/integration_tests/explore_test.py index dd8094f936..16480a077e 100644 --- a/server/integration_tests/explore_test.py +++ b/server/integration_tests/explore_test.py @@ -723,6 +723,7 @@ def test_e2e_toolformer_rig_mode(self): 'what is the infant mortality rate in massachusetts', 'how many construction workers are in Orlando, Florida?', 'what is the poverty rate in Seattle?', + 'Commute time in california', ], mode='toolformer_rig') @@ -736,7 +737,8 @@ def test_e2e_toolformer_rag_mode(self): # variables in a topic that match immediately after the topic should # show up before the topic (i.e., Count_Worker_NAICSAccommodationFoodServices # should show up first) - 'How has employment in hospitality changed over time in New Jersey counties?' + 'How has employment in hospitality changed over time in New Jersey counties?', + 'What is the coal powered electricity generation in US states?', ], mode='toolformer_rag') diff --git a/server/integration_tests/test_data/e2e_toolformer_rag_mode/whatisthecoalpoweredelectricitygenerationinusstates/chart_config.json b/server/integration_tests/test_data/e2e_toolformer_rag_mode/whatisthecoalpoweredelectricitygenerationinusstates/chart_config.json new file mode 100644 index 0000000000..978ba35ff5 --- /dev/null +++ b/server/integration_tests/test_data/e2e_toolformer_rag_mode/whatisthecoalpoweredelectricitygenerationinusstates/chart_config.json @@ -0,0 +1,919 @@ +{ + "client": "test_detect-and-fulfill", + "config": { + "categories": [ + { + "blocks": [ + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_Coal" + ], + "title": "Net Generation, Coal, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, Coal, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Consumption_Fuel_ForElectricityGeneration_Coal" + ], + "title": "Consumption for Electricity Generation, Coal, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Consumption for Electricity Generation, Coal, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Consumption_Fuel_ForElectricityGenerationAndThermalOutput_Coal" + ], + "title": "Total Consumption (Btu), Coal, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Total Consumption (Btu), Coal, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity" + ], + "title": "Annual Energy Generation (All Fuels, All Sectors) in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Annual Energy Generation (All Fuels, All Sectors) in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_RenewableEnergy" + ], + "title": "Net Generation, Other Renewables (Total), All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, Other Renewables (Total), All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_Wind" + ], + "title": "Net Generation, Wind, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, Wind, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_Industrial" + ], + "title": "Net Generation, All Fuels, All Industrial (Total), Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, All Fuels, All Industrial (Total), Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_Commercial" + ], + "title": "Net Generation, All Fuels, All Commercial (Total), Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, All Fuels, All Commercial (Total), Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Emissions_GreenhouseGas_ElectricityGeneration_NonBiogenic" + ], + "title": "Annual Amount of Emissions: Electricity Generation, Non Biogenic Emission Source in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Annual Amount of Emissions: Electricity Generation, Non Biogenic Emission Source in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_NaturalGas" + ], + "title": "Net Generation, Natural Gas, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, Natural Gas, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_Solar" + ], + "title": "Net Generation, All Solar, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, All Solar, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_UtilityScaleSolar" + ], + "title": "Net Generation, All Utility-Scale Solar, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, All Utility-Scale Solar, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Consumption_Fuel_ForElectricityGeneration_PetroleumLiquids" + ], + "title": "Consumption for Electricity Generation (Btu), Petroleum Liquids, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Consumption for Electricity Generation (Btu), Petroleum Liquids, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Consumption_Fuel_ForElectricityGeneration_NaturalGas" + ], + "title": "Consumption for Electricity Generation (Btu), Natural Gas, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Consumption for Electricity Generation (Btu), Natural Gas, All Sectors, Annual in States of United States" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Annual_Generation_Electricity_PetroleumLiquids" + ], + "title": "Net Generation, Petroleum Liquids, All Sectors, Annual in States of United States (${date})", + "type": "MAP" + } + ] + } + ], + "denom": "Count_Person", + "title": "Net Generation, Petroleum Liquids, All Sectors, Annual in States of United States" + } + ], + "statVarSpec": { + "Annual_Consumption_Fuel_ForElectricityGenerationAndThermalOutput_Coal": { + "name": "Total consumption (Btu), coal, all sectors, annual", + "statVar": "Annual_Consumption_Fuel_ForElectricityGenerationAndThermalOutput_Coal" + }, + "Annual_Consumption_Fuel_ForElectricityGeneration_Coal": { + "name": "Consumption for electricity generation, coal, all sectors, annual", + "statVar": "Annual_Consumption_Fuel_ForElectricityGeneration_Coal" + }, + "Annual_Consumption_Fuel_ForElectricityGeneration_NaturalGas": { + "name": "Consumption for electricity generation (Btu), natural gas, all sectors, annual", + "statVar": "Annual_Consumption_Fuel_ForElectricityGeneration_NaturalGas" + }, + "Annual_Consumption_Fuel_ForElectricityGeneration_PetroleumLiquids": { + "name": "Consumption for electricity generation (Btu), petroleum liquids, all sectors, annual", + "statVar": "Annual_Consumption_Fuel_ForElectricityGeneration_PetroleumLiquids" + }, + "Annual_Emissions_GreenhouseGas_ElectricityGeneration_NonBiogenic": { + "name": "Annual Amount of Emissions: Electricity Generation, Non Biogenic Emission Source", + "statVar": "Annual_Emissions_GreenhouseGas_ElectricityGeneration_NonBiogenic" + }, + "Annual_Generation_Electricity": { + "name": "Annual Energy Generation (All Fuels, All Sectors)", + "statVar": "Annual_Generation_Electricity" + }, + "Annual_Generation_Electricity_Coal": { + "name": "Net generation, coal, all sectors, annual", + "statVar": "Annual_Generation_Electricity_Coal" + }, + "Annual_Generation_Electricity_Commercial": { + "name": "Net generation, all fuels, all commercial (total), annual", + "statVar": "Annual_Generation_Electricity_Commercial" + }, + "Annual_Generation_Electricity_Industrial": { + "name": "Net generation, all fuels, all industrial (total), annual", + "statVar": "Annual_Generation_Electricity_Industrial" + }, + "Annual_Generation_Electricity_NaturalGas": { + "name": "Net generation, natural gas, all sectors, annual", + "statVar": "Annual_Generation_Electricity_NaturalGas" + }, + "Annual_Generation_Electricity_PetroleumLiquids": { + "name": "Net generation, petroleum liquids, all sectors, annual", + "statVar": "Annual_Generation_Electricity_PetroleumLiquids" + }, + "Annual_Generation_Electricity_RenewableEnergy": { + "name": "Net generation, other renewables (total), all sectors, annual", + "statVar": "Annual_Generation_Electricity_RenewableEnergy" + }, + "Annual_Generation_Electricity_Solar": { + "name": "Net generation, all solar, all sectors, annual", + "statVar": "Annual_Generation_Electricity_Solar" + }, + "Annual_Generation_Electricity_UtilityScaleSolar": { + "name": "Net generation, all utility-scale solar, all sectors, annual", + "statVar": "Annual_Generation_Electricity_UtilityScaleSolar" + }, + "Annual_Generation_Electricity_Wind": { + "name": "Net generation, wind, all sectors, annual", + "statVar": "Annual_Generation_Electricity_Wind" + } + } + } + ], + "metadata": { + "containedPlaceTypes": { + "Country": "State" + }, + "placeDcid": [ + "country/USA" + ] + } + }, + "context": {}, + "debug": {}, + "entities": [], + "pastSourceContext": "", + "place": { + "dcid": "country/USA", + "name": "United States", + "place_type": "Country" + }, + "placeFallback": {}, + "placeSource": "CURRENT_QUERY", + "places": [ + { + "dcid": "country/USA", + "name": "United States", + "place_type": "Country" + } + ], + "relatedThings": { + "childPlaces": { + "State": [ + { + "dcid": "geoId/01", + "name": "Alabama", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/02", + "name": "Alaska", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/04", + "name": "Arizona", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/05", + "name": "Arkansas", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/06", + "name": "California", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/08", + "name": "Colorado", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/09", + "name": "Connecticut", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/10", + "name": "Delaware", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/11", + "name": "District of Columbia", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/12", + "name": "Florida", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/13", + "name": "Georgia", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/15", + "name": "Hawaii", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/16", + "name": "Idaho", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/17", + "name": "Illinois", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/18", + "name": "Indiana", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/19", + "name": "Iowa", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/20", + "name": "Kansas", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/21", + "name": "Kentucky", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/22", + "name": "Louisiana", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/23", + "name": "Maine", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/24", + "name": "Maryland", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/25", + "name": "Massachusetts", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/26", + "name": "Michigan", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/27", + "name": "Minnesota", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/28", + "name": "Mississippi", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/29", + "name": "Missouri", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/30", + "name": "Montana", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/31", + "name": "Nebraska", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/32", + "name": "Nevada", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/33", + "name": "New Hampshire", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/34", + "name": "New Jersey", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/35", + "name": "New Mexico", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/36", + "name": "New York", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/37", + "name": "North Carolina", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/38", + "name": "North Dakota", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/39", + "name": "Ohio", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/40", + "name": "Oklahoma", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/41", + "name": "Oregon", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/42", + "name": "Pennsylvania", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/44", + "name": "Rhode Island", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/45", + "name": "South Carolina", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/46", + "name": "South Dakota", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/47", + "name": "Tennessee", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/48", + "name": "Texas", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/49", + "name": "Utah", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/50", + "name": "Vermont", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/51", + "name": "Virginia", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/53", + "name": "Washington", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/54", + "name": "West Virginia", + "types": [ + "State" + ] + }, + { + "dcid": "geoId/55", + "name": "Wisconsin", + "types": [ + "State" + ] + } + ] + }, + "childTopics": [], + "exploreMore": { + "Annual_Generation_Electricity": { + "energySource": [ + "Annual_Generation_Electricity_Coal", + "Annual_Generation_Electricity_ConventionalHydroelectric", + "Annual_Generation_Electricity_Geothermal", + "Annual_Generation_Electricity_HydroelectricPumpedStorage", + "Annual_Generation_Electricity_NaturalGas", + "Annual_Generation_Electricity_Nuclear", + "Annual_Generation_Electricity_Other", + "Annual_Generation_Electricity_OtherBiomass", + "Annual_Generation_Electricity_OtherGases", + "Annual_Generation_Electricity_PetroleumLiquids", + "Annual_Generation_Electricity_RenewableEnergy", + "Annual_Generation_Electricity_Solar", + "Annual_Generation_Electricity_UtilityScaleSolar", + "Annual_Generation_Electricity_Wind" + ], + "producingSector": [ + "Annual_Generation_Electricity_Commercial", + "Annual_Generation_Electricity_Industrial" + ] + }, + "Annual_Generation_Electricity_Coal": { + "producingSector": [ + "Annual_Generation_Electricity_Coal_Commercial", + "Annual_Generation_Electricity_Coal_CommercialCogen", + "Annual_Generation_Electricity_Coal_CommercialNonCogen", + "Annual_Generation_Electricity_Coal_ElectricPower", + "Annual_Generation_Electricity_Coal_ElectricUtility", + "Annual_Generation_Electricity_Coal_ElectricUtilityCogen", + "Annual_Generation_Electricity_Coal_ElectricUtilityNonCogen", + "Annual_Generation_Electricity_Coal_IndependentPowerProducers", + "Annual_Generation_Electricity_Coal_Industrial", + "Annual_Generation_Electricity_Coal_IndustrialCogen", + "Annual_Generation_Electricity_Coal_IndustrialNonCogen" + ] + }, + "Annual_Generation_Electricity_Commercial": { + "energySource": [ + "Annual_Generation_Electricity_Coal_Commercial", + "Annual_Generation_Electricity_ConventionalHydroelectric_Commercial", + "Annual_Generation_Electricity_Geothermal_Commercial", + "Annual_Generation_Electricity_NaturalGas_Commercial", + "Annual_Generation_Electricity_OtherBiomass_Commercial", + "Annual_Generation_Electricity_Other_Commercial", + "Annual_Generation_Electricity_RenewableEnergy_Commercial" + ] + }, + "Annual_Generation_Electricity_Industrial": { + "energySource": [ + "Annual_Generation_Electricity_Coal_Industrial", + "Annual_Generation_Electricity_ConventionalHydroelectric_Industrial", + "Annual_Generation_Electricity_NaturalGas_Industrial", + "Annual_Generation_Electricity_OtherBiomass_Industrial" + ] + }, + "Annual_Generation_Electricity_NaturalGas": { + "producingSector": [ + "Annual_Generation_Electricity_NaturalGas_Commercial", + "Annual_Generation_Electricity_NaturalGas_CommercialCogen", + "Annual_Generation_Electricity_NaturalGas_CommercialNonCogen", + "Annual_Generation_Electricity_NaturalGas_ElectricPower", + "Annual_Generation_Electricity_NaturalGas_ElectricUtility", + "Annual_Generation_Electricity_NaturalGas_ElectricUtilityCogen", + "Annual_Generation_Electricity_NaturalGas_ElectricUtilityNonCogen", + "Annual_Generation_Electricity_NaturalGas_IndependentPowerProducers", + "Annual_Generation_Electricity_NaturalGas_Industrial", + "Annual_Generation_Electricity_NaturalGas_IndustrialCogen", + "Annual_Generation_Electricity_NaturalGas_IndustrialNonCogen" + ] + }, + "Annual_Generation_Electricity_RenewableEnergy": { + "producingSector": [ + "Annual_Generation_Electricity_RenewableEnergy_Commercial", + "Annual_Generation_Electricity_RenewableEnergy_ElectricPower", + "Annual_Generation_Electricity_RenewableEnergy_ElectricUtility", + "Annual_Generation_Electricity_RenewableEnergy_ElectricUtilityCogen", + "Annual_Generation_Electricity_RenewableEnergy_ElectricUtilityNonCogen", + "Annual_Generation_Electricity_RenewableEnergy_IndependentPowerProducers" + ] + }, + "Annual_Generation_Electricity_Solar": { + "powerPlantSector": [ + "Annual_Generation_Electricity_Solar_AutoProducer", + "Annual_Generation_Electricity_Solar_MainActivityProducer" + ] + }, + "Annual_Generation_Electricity_UtilityScaleSolar": { + "producingSector": [ + "Annual_Generation_Electricity_UtilityScaleSolar_ElectricUtilityCogen", + "Annual_Generation_Electricity_UtilityScaleSolar_IndustrialCogen" + ] + }, + "Annual_Generation_Electricity_Wind": { + "powerPlantSector": [ + "Annual_Generation_Electricity_Wind_AutoProducer", + "Annual_Generation_Electricity_Wind_MainActivityProducer" + ] + } + }, + "mainTopics": [], + "parentPlaces": [], + "parentTopics": [], + "peerPlaces": [ + { + "dcid": "country/BRA", + "name": "Brazil", + "types": [ + "Country" + ] + }, + { + "dcid": "country/CAN", + "name": "Canada", + "types": [ + "Country" + ] + }, + { + "dcid": "country/CHN", + "name": "China", + "types": [ + "Country" + ] + }, + { + "dcid": "country/EGY", + "name": "Egypt", + "types": [ + "Country" + ] + }, + { + "dcid": "country/FRA", + "name": "France", + "types": [ + "Country" + ] + }, + { + "dcid": "country/DEU", + "name": "Germany", + "types": [ + "Country" + ] + }, + { + "dcid": "country/IND", + "name": "India", + "types": [ + "Country" + ] + }, + { + "dcid": "country/JPN", + "name": "Japan", + "types": [ + "Country" + ] + }, + { + "dcid": "country/MYS", + "name": "Malaysia", + "types": [ + "Country" + ] + }, + { + "dcid": "country/NZL", + "name": "New Zealand", + "types": [ + "Country" + ] + }, + { + "dcid": "country/NGA", + "name": "Nigeria", + "types": [ + "Country" + ] + }, + { + "dcid": "country/PER", + "name": "Peru", + "types": [ + "Country" + ] + }, + { + "dcid": "country/RUS", + "name": "Russia", + "types": [ + "Country" + ] + }, + { + "dcid": "country/GBR", + "name": "United Kingdom", + "types": [ + "Country" + ] + } + ], + "peerTopics": [] + }, + "svSource": "CURRENT_QUERY", + "userMessage": "", + "userMessages": [] +} \ No newline at end of file diff --git a/server/integration_tests/test_data/e2e_toolformer_rig_mode/commutetimeincalifornia/chart_config.json b/server/integration_tests/test_data/e2e_toolformer_rig_mode/commutetimeincalifornia/chart_config.json new file mode 100644 index 0000000000..2940bf16fe --- /dev/null +++ b/server/integration_tests/test_data/e2e_toolformer_rig_mode/commutetimeincalifornia/chart_config.json @@ -0,0 +1,883 @@ +{ + "client": "test_detect-and-fulfill", + "config": { + "categories": [ + { + "blocks": [ + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "Mean_CommuteTime_Person_Years16Onwards_WorkCommute_Employed_WorkedOutsideOfHome" + ], + "title": "Mean Commute Time: 16 Years or More, Work Commute, Employed, Worked Outside of Home in California", + "type": "LINE" + } + ] + }, + { + "tiles": [ + { + "description": "Mean Commute Time: 16 Years or More, Work Commute, Employed, Worked Outside of Home in California", + "statVarKey": [ + "Mean_CommuteTime_Person_Years16Onwards_WorkCommute_Employed_WorkedOutsideOfHome" + ], + "title": "Mean Commute Time: 16 Years or More, Work Commute, Employed, Worked Outside of Home in California", + "type": "HIGHLIGHT" + } + ] + } + ], + "title": "Mean Commute Time: 16 Years or More, Work Commute, Employed, Worked Outside of Home" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "dc/hbkh95kc7pkb6" + ], + "title": "Public Transit in California", + "type": "LINE" + } + ] + }, + { + "tiles": [ + { + "description": "Public Transit in California", + "statVarKey": [ + "dc/hbkh95kc7pkb6" + ], + "title": "Public Transit in California", + "type": "HIGHLIGHT" + } + ] + } + ], + "denom": "Count_Person", + "title": "Public Transit" + }, + { + "columns": [ + { + "tiles": [ + { + "statVarKey": [ + "dc/wc8q05drd74bd" + ], + "title": "Carpool in California", + "type": "LINE" + } + ] + }, + { + "tiles": [ + { + "description": "Carpool in California", + "statVarKey": [ + "dc/wc8q05drd74bd" + ], + "title": "Carpool in California", + "type": "HIGHLIGHT" + } + ] + } + ], + "denom": "Count_Person", + "title": "Carpool" + } + ], + "statVarSpec": { + "Mean_CommuteTime_Person_Years16Onwards_WorkCommute_Employed_WorkedOutsideOfHome": { + "name": "Mean Commute Time: 16 Years or More, Work Commute, Employed, Worked Outside of Home", + "statVar": "Mean_CommuteTime_Person_Years16Onwards_WorkCommute_Employed_WorkedOutsideOfHome" + }, + "dc/hbkh95kc7pkb6": { + "name": "Public Transit", + "statVar": "dc/hbkh95kc7pkb6" + }, + "dc/wc8q05drd74bd": { + "name": "Carpool", + "statVar": "dc/wc8q05drd74bd" + } + } + } + ], + "metadata": { + "placeDcid": [ + "geoId/06" + ] + } + }, + "context": {}, + "debug": {}, + "entities": [], + "pastSourceContext": "", + "place": { + "dcid": "geoId/06", + "name": "California", + "place_type": "State" + }, + "placeFallback": {}, + "placeSource": "CURRENT_QUERY", + "places": [ + { + "dcid": "geoId/06", + "name": "California", + "place_type": "State" + } + ], + "relatedThings": { + "childPlaces": { + "County": [ + { + "dcid": "geoId/06001", + "name": "Alameda", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06003", + "name": "Alpine", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06005", + "name": "Amador", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06007", + "name": "Butte", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06009", + "name": "Calaveras", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06011", + "name": "Colusa", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06013", + "name": "Contra Costa", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06015", + "name": "Del Norte", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06017", + "name": "El Dorado", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06019", + "name": "Fresno", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06021", + "name": "Glenn", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06023", + "name": "Humboldt", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06025", + "name": "Imperial", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06027", + "name": "Inyo", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06029", + "name": "Kern", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06031", + "name": "Kings", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06033", + "name": "Lake", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06035", + "name": "Lassen", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06037", + "name": "Los Angeles", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06039", + "name": "Madera", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06041", + "name": "Marin", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06043", + "name": "Mariposa", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06045", + "name": "Mendocino", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06047", + "name": "Merced", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06049", + "name": "Modoc", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06051", + "name": "Mono", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06053", + "name": "Monterey", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06055", + "name": "Napa", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06057", + "name": "Nevada", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06059", + "name": "Orange", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06061", + "name": "Placer", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06063", + "name": "Plumas", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06065", + "name": "Riverside", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06067", + "name": "Sacramento", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06069", + "name": "San Benito", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06071", + "name": "San Bernardino", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06073", + "name": "San Diego", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06075", + "name": "San Francisco", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06077", + "name": "San Joaquin", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06079", + "name": "San Luis Obispo", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06081", + "name": "San Mateo", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06083", + "name": "Santa Barbara", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06085", + "name": "Santa Clara", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06087", + "name": "Santa Cruz", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06089", + "name": "Shasta", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06091", + "name": "Sierra", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06093", + "name": "Siskiyou", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06095", + "name": "Solano", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06097", + "name": "Sonoma", + "types": [ + "County" + ] + }, + { + "dcid": "geoId/06099", + "name": "Stanislaus", + "types": [ + "County" + ] + } + ] + }, + "childTopics": [], + "exploreMore": { + "Mean_CommuteTime_Person_Years16Onwards_WorkCommute_Employed_WorkedOutsideOfHome": { + "commuteMode": [ + "Mean_CommuteTime_Person_Years16Onwards_CarTruckOrVanCarpooled_WorkCommute_Employed_WorkedOutsideOfHome", + "Mean_CommuteTime_Person_Years16Onwards_CarTruckOrVanDroveAlone_WorkCommute_Employed_WorkedOutsideOfHome", + "Mean_CommuteTime_Person_Years16Onwards_PublicTransportationExcludingTaxicab_WorkCommute_Employed_WorkedOutsideOfHome" + ] + } + }, + "mainTopics": [ + { + "dcid": "dc/topic/CommuteTime", + "name": "Commute Time", + "types": [ + "Topic" + ] + } + ], + "parentPlaces": [], + "parentTopics": [ + { + "dcid": "dc/topic/WorkCommute", + "name": "Commute", + "types": [ + "Topic" + ] + } + ], + "peerPlaces": [ + { + "dcid": "geoId/01", + "name": "Alabama", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/02", + "name": "Alaska", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/04", + "name": "Arizona", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/05", + "name": "Arkansas", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/08", + "name": "Colorado", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/09", + "name": "Connecticut", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/10", + "name": "Delaware", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/11", + "name": "District of Columbia", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/12", + "name": "Florida", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/13", + "name": "Georgia", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/15", + "name": "Hawaii", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/16", + "name": "Idaho", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/17", + "name": "Illinois", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/18", + "name": "Indiana", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/19", + "name": "Iowa", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/20", + "name": "Kansas", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/21", + "name": "Kentucky", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/22", + "name": "Louisiana", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/23", + "name": "Maine", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/24", + "name": "Maryland", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/25", + "name": "Massachusetts", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/26", + "name": "Michigan", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/27", + "name": "Minnesota", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/28", + "name": "Mississippi", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/29", + "name": "Missouri", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/30", + "name": "Montana", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/31", + "name": "Nebraska", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/32", + "name": "Nevada", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/33", + "name": "New Hampshire", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/34", + "name": "New Jersey", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/35", + "name": "New Mexico", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/36", + "name": "New York", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/37", + "name": "North Carolina", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/38", + "name": "North Dakota", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/39", + "name": "Ohio", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/40", + "name": "Oklahoma", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/41", + "name": "Oregon", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/42", + "name": "Pennsylvania", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/72", + "name": "Puerto Rico", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/44", + "name": "Rhode Island", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/45", + "name": "South Carolina", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/46", + "name": "South Dakota", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/47", + "name": "Tennessee", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/48", + "name": "Texas", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/49", + "name": "Utah", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/50", + "name": "Vermont", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/51", + "name": "Virginia", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/53", + "name": "Washington", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/54", + "name": "West Virginia", + "types": [ + "AdministrativeArea1" + ] + }, + { + "dcid": "geoId/55", + "name": "Wisconsin", + "types": [ + "AdministrativeArea1" + ] + } + ], + "peerTopics": [ + { + "dcid": "dc/topic/CommuteMode", + "name": "Commute Mode", + "types": [ + "Topic" + ] + } + ] + }, + "svSource": "CURRENT_QUERY", + "userMessage": "", + "userMessages": [] +} \ No newline at end of file diff --git a/server/lib/nl/fulfillment/basic.py b/server/lib/nl/fulfillment/basic.py index 77046b2249..e5e2079a15 100644 --- a/server/lib/nl/fulfillment/basic.py +++ b/server/lib/nl/fulfillment/basic.py @@ -152,20 +152,20 @@ def _populate_specific(state: PopulateState, chart_vars: ChartVars, # Ranking query if user_set_child_type: # This is ranking across places. - if ranking_across_places.populate(state, chart_vars, places, chart_origin, - rank): - _maybe_set_place_type_existence(state, rank) - return True + added = ranking_across_places.populate(state, chart_vars, places, chart_origin, + rank) + _maybe_set_place_type_existence(state, rank) + return added else: # This is ranking across vars. - if ranking_across_vars.populate(state, chart_vars, places, chart_origin, - rank): - return True + added = ranking_across_vars.populate(state, chart_vars, places, chart_origin, + rank) + return added if user_set_child_type: - if containedin.populate(state, chart_vars, places, chart_origin, rank): - _maybe_set_place_type_existence(state, rank) - return True + added = containedin.populate(state, chart_vars, places, chart_origin, rank) + _maybe_set_place_type_existence(state, rank) + return added return place_vars.populate(state, chart_vars, places, chart_origin, rank) From 53618e95a3a5deb1f392e167b0febdd4ed110ed2 Mon Sep 17 00:00:00 2001 From: Prashanth Radhakrishnan Date: Mon, 15 Jul 2024 19:49:55 -0700 Subject: [PATCH 3/3] lint --- server/lib/nl/fulfillment/basic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/lib/nl/fulfillment/basic.py b/server/lib/nl/fulfillment/basic.py index e5e2079a15..8b26dc3254 100644 --- a/server/lib/nl/fulfillment/basic.py +++ b/server/lib/nl/fulfillment/basic.py @@ -152,14 +152,14 @@ def _populate_specific(state: PopulateState, chart_vars: ChartVars, # Ranking query if user_set_child_type: # This is ranking across places. - added = ranking_across_places.populate(state, chart_vars, places, chart_origin, - rank) + added = ranking_across_places.populate(state, chart_vars, places, + chart_origin, rank) _maybe_set_place_type_existence(state, rank) return added else: # This is ranking across vars. - added = ranking_across_vars.populate(state, chart_vars, places, chart_origin, - rank) + added = ranking_across_vars.populate(state, chart_vars, places, + chart_origin, rank) return added if user_set_child_type: