Skip to content

Commit

Permalink
🐝 update pandas to 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Marigold committed Sep 30, 2024
1 parent 8194e54 commit b97985c
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 3,510 deletions.
6 changes: 5 additions & 1 deletion apps/owidbot/data_diff.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import re
import subprocess
from typing import Tuple
Expand Down Expand Up @@ -89,7 +90,10 @@ def call_etl_diff(include: str) -> list[str]:

print(" ".join(cmd))

result = subprocess.Popen(cmd, cwd=BASE_DIR, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
env = os.environ.copy()
env["PATH"] = os.path.expanduser("~/.cargo/bin") + ":" + env["PATH"]

result = subprocess.Popen(cmd, cwd=BASE_DIR, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
stdout, stderr = result.communicate()

stdout = stdout.decode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ tables:
unit: US dollars
short_unit: $
display:
name: << field >>
numDecimalPlaces: 0

investment_estimated:
Expand All @@ -88,6 +89,7 @@ tables:
unit: US dollars
short_unit: $
display:
name: << field >>
numDecimalPlaces: 0

disclosed_investment_summary:
Expand All @@ -112,6 +114,7 @@ tables:
unit: US dollars
short_unit: $
display:
name: << field >>
numDecimalPlaces: 0

estimated_investment_summary:
Expand All @@ -137,62 +140,71 @@ tables:
unit: US dollars
short_unit: $
display:
name: << field >>
numDecimalPlaces: 0

num_patent_applications:
title: Patent applications
description: Yearly total number of patent applications.
unit: applications
display:
name: << field >>
numDecimalPlaces: 0

num_patent_granted:
title: Patent applications granted
description: Yearly total number of patents granted.
unit: granted applications
display:
name: << field >>
numDecimalPlaces: 0

num_patent_applications_summary:
title: Total patent applications
description: Total number of patent applications between 2010-2020.
unit: applications
display:
name: << field >>
numDecimalPlaces: 0

num_patent_granted_summary:
title: Total patent applications granted
description: Total number of patents granted between 2010-2020.
unit: granted applications
display:
name: << field >>
numDecimalPlaces: 0

num_articles:
title: Number of articles
description: Yearly number of articles published in AI fields.
unit: articles
display:
name: << field >>
numDecimalPlaces: 0

num_citations:
title: Number of citations
description: Yearly number of citations in the AI field.
unit: citations
display:
name: << field >>
numDecimalPlaces: 0

num_articles_summary:
title: Total number of articles
description: Yearly total number of articles in the AI field between 2010-2022
unit: articles
display:
name: << field >>
numDecimalPlaces: 0

num_citations_summary:
title: Total number of citations
description: The total number of citations in the AI field between 2010-2022
unit: citations
display:
name: << field >>
numDecimalPlaces: 0

proportion_patents_granted:
Expand All @@ -201,6 +213,7 @@ tables:
unit: '%'
short_unit: '%'
display:
name: << field >>
numDecimalPlaces: 0

citations_per_article:
Expand All @@ -209,25 +222,29 @@ tables:
unit: 'citations per article'
short_unit: ''
display:
name: << field >>
numDecimalPlaces: 0

num_patent_applications_per_mil:
title: Patent applications per 1 million people
description: Yearly total number of patent applications per 1 million people.
unit: applications
display:
name: << field >>
numDecimalPlaces: 0

num_patent_granted_per_mil:
title: Patent applications granted per 1 million people
description: Yearly total number of patents granted per 1 million people.
unit: granted applications
display:
name: << field >>
numDecimalPlaces: 0

num_articles_per_mil:
title: Number of articles per 1 million people
description: Yearly number of articles published in AI fields per 1 million people
unit: articles
display:
numDecimalPlaces: 0
name: << field >>
numDecimalPlaces: 0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from owid.catalog import Dataset

from etl import grapher_helpers as gh
from etl.helpers import PathFinder, create_dataset, grapher_checks

# Get paths and naming conventions for current step.
Expand All @@ -23,20 +22,11 @@ def run(dest_dir: str) -> None:
tb = tb.reset_index()
tb.set_index(["country", "year", "field"], inplace=True)

# Expand dimensions into columns.
expanded_tb = gh.expand_dimensions(tb)

# Set display name to its `field` for each column
for col in expanded_tb.columns:
dim_filters = expanded_tb[col].metadata.additional_info["dimensions"]["filters"]
assert len(dim_filters) == 1
expanded_tb[col].metadata.display["name"] = dim_filters[0]["value"]

#
# Save outputs.
#
# Create a new grapher dataset with the same metadata as the garden dataset
ds_grapher = create_dataset(dest_dir, tables=[expanded_tb], default_metadata=ds_garden.metadata)
ds_grapher = create_dataset(dest_dir, tables=[tb], default_metadata=ds_garden.metadata)

#
# Checks.
Expand Down
2 changes: 1 addition & 1 deletion lib/catalog/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
license = "MIT"
requires-python = ">=3.9, <4.0"
dependencies = [
"pandas==2.2.1",
"pandas>=2.2.1",
"jsonschema>=3.2.0",
"pyarrow>=10.0.1",
"ipdb>=0.13.9",
Expand Down
2 changes: 1 addition & 1 deletion lib/datautils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
license = "MIT"
requires-python = ">=3.9, <4.0"
dependencies = [
"pandas==2.2.1",
"pandas>=2.2.1",
"boto3>=1.21.16",
"structlog>=21.5.0",
"colorama>=0.4.4",
Expand Down
2 changes: 1 addition & 1 deletion lib/repack/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
requires-python = ">=3.9"
dependencies = [
"numpy>=1.24.0",
"pandas==2.2.1"
"pandas>=2.2.1"
]

[tool.uv]
Expand Down
Loading

0 comments on commit b97985c

Please sign in to comment.