Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloarosado committed Dec 4, 2024
2 parents d6a4a9f + e349737 commit c96002c
Show file tree
Hide file tree
Showing 190 changed files with 12,169 additions and 708 deletions.
12 changes: 9 additions & 3 deletions apps/pr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def bake_branch_name(repo, pr_title, no_llm, remote_branches):
category = pr_title.category

# Get input title (without emoji, scope, etc.)
title = _extract_relevant_title_for_branch_name(pr_title.title, not no_llm)
title = _extract_relevant_title_for_branch_name(pr_title.title, category, not no_llm)

# Bake complete PR branch name
# name = f"{user}-{category}-{title}"
Expand All @@ -383,13 +383,14 @@ def bake_branch_name(repo, pr_title, no_llm, remote_branches):
# if name in remote_branches:
# log.info("Generating a hash for this branch name to prevent name collisions.")
# name = f"{name}-{user}"
if name in remote_branches:
local_branches = [branch.name for branch in repo.branches]
if (name in remote_branches) or (name in local_branches):
log.info("Generating a hash for this branch name to prevent name collisions.")
name = f"{name}-{generate_short_hash()}"
return name


def _extract_relevant_title_for_branch_name(text_in: str, use_llm) -> str:
def _extract_relevant_title_for_branch_name(text_in: str, category: str, use_llm) -> str:
"""
Process the input string by:
1. Removing all symbols, keeping only letters and numbers.
Expand All @@ -411,8 +412,13 @@ def _extract_relevant_title_for_branch_name(text_in: str, use_llm) -> str:

# Split into tokens/words
tokens = cleaned_text.split()

# Clean if there is word included in category
tokens = [t for t in tokens if t.lower() != category]

# Keep only the first 3 tokens
tokens = tokens[:3]

# Combine tokens with '-'
name = "-".join(tokens).lower()

Expand Down
6 changes: 5 additions & 1 deletion apps/wizard/app_pages/anomalist/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ def show_anomaly_compact(index, df):
config = bake_chart_config(variable_id=indicator_id, selected_entities=entities)
config["hideAnnotationFieldsInTitle"]["time"] = True
config["hideFacetControl"] = False
config["hideShareButton"] = True
config["hideExploreTheDataButton"] = True
# config["isSocialMediaExport"] = False

# Actually plot
grapher_chart(chart_config=config, owid_env=OWID_ENV)
Expand Down Expand Up @@ -816,6 +819,7 @@ def _score_table(df: pd.DataFrame) -> pd.DataFrame:
# Show controls only if needed
if len(items) > items_per_page:
pagination.show_controls(mode="bar")

else:
st.success("Ha! We did not find any no anomalies in the selected datasets! What were the odds of that?")
# Reset state
set_states({"anomalist_datasets_submitted": False})
62 changes: 61 additions & 1 deletion dag/archive/demography.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,69 @@ steps:
data-private://grapher/un/2024-07-11/un_wpp_full:
- data-private://garden/un/2024-07-11/un_wpp

# Population density
# Population density
data://garden/demography/2023-06-12/population_density:
- data://garden/demography/2023-03-31/population
- data://garden/faostat/2024-03-14/faostat_rl
data://grapher/demography/2023-06-12/population_density:
- data://garden/demography/2023-06-12/population_density

# HMD
data://meadow/hmd/2022-12-07/life_tables:
- snapshot://hmd/2022-12-07/hmd.zip
data://garden/hmd/2022-12-07/life_tables:
- data://meadow/hmd/2022-12-07/life_tables

# Survivorship ages (HMD-derived)
data://garden/demography/2023-09-27/survivor_percentiles:
- data://garden/hmd/2023-09-19/hmd
data://grapher/demography/2023-09-27/survivor_percentiles:
- data://garden/demography/2023-09-27/survivor_percentiles

# Phi-gender life expectancy inequality
data://garden/demography/2023-10-03/phi_gender_le:
- data://garden/demography/2023-10-03/life_tables
data://grapher/demography/2023-10-03/phi_gender_le:
- data://garden/demography/2023-10-03/phi_gender_le

# Broken limits of Life Expectancy
data://garden/demography/2023-10-20/broken_limits_le:
- data://garden/demography/2023-10-03/life_tables
- data://garden/hmd/2023-09-19/hmd
data://grapher/demography/2023-10-20/broken_limits_le:
- data://garden/demography/2023-10-20/broken_limits_le

# Gini Life Expectancy Inequality
data://garden/demography/2023-10-04/gini_le:
- data://garden/demography/2023-10-03/life_tables
data://grapher/demography/2023-10-04/gini_le:
- data://garden/demography/2023-10-04/gini_le

# HMD
data://meadow/hmd/2023-09-19/hmd:
- snapshot://hmd/2023-09-18/hmd.zip
data://garden/hmd/2023-09-19/hmd:
- data://meadow/hmd/2023-09-19/hmd
data://grapher/hmd/2023-09-19/hmd:
- data://garden/hmd/2023-09-19/hmd
# UN WPP Life Tables
data://meadow/un/2023-10-02/un_wpp_lt:
- snapshot://un/2023-10-02/un_wpp_lt_all.zip
- snapshot://un/2023-10-02/un_wpp_lt_f.zip
- snapshot://un/2023-10-02/un_wpp_lt_m.zip
data://garden/un/2023-10-02/un_wpp_lt:
- data://meadow/un/2023-10-02/un_wpp_lt
# UN WPP + HMD Life Tables
data://garden/demography/2023-10-03/life_tables:
- data://garden/hmd/2023-09-19/hmd
- data://garden/un/2023-10-02/un_wpp_lt
data://grapher/demography/2023-10-04/life_tables:
- data://garden/demography/2023-10-03/life_tables
# OMM: Life Expectancy
data://garden/demography/2023-10-09/life_expectancy:
- data://garden/demography/2023-10-03/life_tables
- data://garden/demography/2023-10-10/zijdeman_et_al_2015
- data://garden/demography/2023-10-10/riley_2005
- data://garden/un/2022-07-11/un_wpp
data://grapher/demography/2023-10-10/life_expectancy:
- data://garden/demography/2023-10-09/life_expectancy
4 changes: 2 additions & 2 deletions dag/archive/fasttrack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
data://grapher/fasttrack/2023-06-19/world_population_comparison:
- snapshot://fasttrack/2023-06-19/world_population_comparison.csv
data://grapher/fasttrack/latest/democracy_lexical_index:
- snapshot://fasttrack/latest/democracy_lexical_index.csv
data://grapher/fasttrack/latest/mineral_prices_usgs:
- snapshot://fasttrack/latest/mineral_prices_usgs.csv
3 changes: 1 addition & 2 deletions dag/covid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:
- data://garden/regions/2023-01-01/regions
# Demography
- data://garden/demography/2024-07-15/population
- data://garden/demography/2023-10-09/life_expectancy
- data://garden/demography/2024-12-03/life_expectancy
- data://garden/un/2024-07-12/un_wpp
# Econ
- data://garden/wb/2024-10-07/world_bank_pip
Expand Down Expand Up @@ -325,4 +325,3 @@ steps:
- grapher://grapher/covid/latest/covax
- grapher://grapher/covid/latest/infections_model
- grapher://grapher/covid/latest/xm_who

Loading

0 comments on commit c96002c

Please sign in to comment.