Skip to content

Commit

Permalink
Revert optimization for toolformer mode (#4361)
Browse files Browse the repository at this point in the history
Revert the file change [made
here](https://github.com/datacommonsorg/website/pull/4334/files#diff-b38c715733aef19dda2dc8ab747d0932400008645deb5052f96c479dc7afdac5)
to reduce the number of charts returned. It doesn't work quite well and
fixing it further regresses the temperature-projections query.

Instead, let it for now return more charts (the nodejs FE has settings
to limit the number of charts returned there), and the toolformer client
only consumes the top chart.
  • Loading branch information
pradh committed Jun 18, 2024
1 parent 887b80e commit 56336aa
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,36 @@
],
"title": "Count of Mortality Event: 1 Years or Less, Male (As Fraction of Count Birth Event Male)"
},
{
"columns": [
{
"tiles": [
{
"statVarKey": [
"Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod"
],
"title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Massachusetts",
"type": "LINE"
}
]
},
{
"tiles": [
{
"description": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Massachusetts",
"statVarKey": [
"Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod"
],
"title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Massachusetts",
"type": "HIGHLIGHT"
}
]
}
],
"denom": "Count_Person",
"startWithDenom": true,
"title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period)"
},
{
"columns": [
{
Expand All @@ -100,6 +130,21 @@
"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",
Expand Down
6 changes: 2 additions & 4 deletions server/lib/nl/fulfillment/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ 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 or
params.is_toolformer_mode(state.uttr.mode)):
if chart_vars.source_topic == PROJECTED_TEMP_TOPIC:
# PROJECTED_TEMP_TOPIC has some very custom handling in config-builder,
# that needs to be deprecated.
# For toolformer mode, where we return focussed charts based
# on query, additional charts are not very useful.
# TODO: Deprecate this flow completely!
return _populate_specific(state, chart_vars, places, chart_origin, rank)
else:
return _populate_explore(state, chart_vars, places, chart_origin, rank)
Expand Down

0 comments on commit 56336aa

Please sign in to comment.