Skip to content

Commit

Permalink
fix(interim): step to fix local incompatibility with nasu1719pr.xlsx
Browse files Browse the repository at this point in the history
  • Loading branch information
spool committed Jul 24, 2023
1 parent 7e74506 commit 0845f48
Show file tree
Hide file tree
Showing 7 changed files with 719 additions and 612 deletions.
6 changes: 3 additions & 3 deletions estios/input_output_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
CPA_TOTAL_INTERMEDIATE_AT_PURCHASERS_PRICE: Final[
str
] = "Total intermediate/final use at purchaser's prices"
CPA_TOTAL_INTERMEDIATE_AT_PURCHASERS_PRICE_FIXED: Final[
str
] = "Total intermediate use at purchaser's prices"
# CPA_TOTAL_INTERMEDIATE_AT_PURCHASERS_PRICE_FIXED: Final[
# str
# ] = "Total intermediate use at purchaser's prices"


DEFAULT_DOG_LEG_ROWS: Final[tuple[str, ...]] = (
Expand Down
4 changes: 2 additions & 2 deletions estios/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def region_names(self) -> list[str]:

@property
def sectors(self) -> list[str]:
"""A list of sectors used in the model
"""List of sectors used in the model.
Todo:
* Manage disambiguation between sectors and sector_names.
Expand Down Expand Up @@ -463,7 +463,7 @@ def F_i_m_national(self) -> Series:

@property
def F_i_m_full(self) -> DataFrame:
"""Return the final demand of sector $m$ in region $i$ in all categories
"""Return final demand of all sectors $m$ in regions $i$.
$F_i^{(m)} = F_*^{(m)} * P_i/P_*$
"""
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion estios/uk/ons_IO_2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
GROSS_VALUE_ADDED_ROW_NAME: Final[str] = "Gross Value Added"
NET_SUBSIDIES_ROW_NAME: Final[str] = "Net subsidies"

INTERMEDIATE_ROW_NAME: Final[str] = "Intermediate/final use w/purchaser's prices"
# INTERMEDIATE_ROW_NAME: Final[str] = "Intermediate/final use w/purchaser's prices"
INTERMEDIATE_ROW_NAME: Final[str] = "Total intermediate/final use at purchaser's prices"

UK_FINAL_DEMAND_HOUSEHOLD_PURCHASE_CODE: Final[str] = "P3 S14"
UK_FINAL_DEMAND_GOVERNMENT_PURCHASE_CODE: Final[str] = "P3 S13"
Expand Down
10 changes: 9 additions & 1 deletion estios/uk/populations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from copy import deepcopy
from logging import getLogger
from pathlib import Path
from typing import Callable, Sequence

Expand Down Expand Up @@ -60,6 +61,8 @@
# )
# )

logger = getLogger(__name__)


def get_regional_mid_year_populations(
year: int = 2017,
Expand Down Expand Up @@ -140,7 +143,12 @@ def get_employment_by_region_by_sector(
assert isinstance(nomis_employment_df, DataFrame)
if not sector_codes:
sector_codes = nomis_employment_df[NOMIS_INDUSTRY_CODE_COLUMN_NAME].unique()
assert isinstance(sector_codes, Sequence)
try:
assert isinstance(sector_codes, Sequence)
except AssertionError:
logger.warning(
f"`sector_codes` is of type: {type(Sequence)} in `get_nation_employment_by_sector`"
)
if not regions_manager:
regions_manager = get_working_cities_puas_manager()
assert isinstance(regions_manager, PUASManager)
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ plugins:
options:
separate_signature: true
show_signature_annotations: true
annotations_path: brief
# - bibtex:
# bib_file: !ENV ZOTERO_BIBTEX_URL
# csl_file: https://raw.githubusercontent.com/citation-style-language/styles/master/environment-and-planning.csl
Expand Down
1,307 changes: 702 additions & 605 deletions poetry.lock

Large diffs are not rendered by default.

0 comments on commit 0845f48

Please sign in to comment.