Commit 04962c48 authored by Dr.李's avatar Dr.李

FEATURE: switch map industry name

parent 92502036
...@@ -5,6 +5,7 @@ Created on 2017-12-25 ...@@ -5,6 +5,7 @@ Created on 2017-12-25
@author: cheng.li @author: cheng.li
""" """
import os
from typing import Dict from typing import Dict
from typing import Iterable from typing import Iterable
...@@ -51,19 +52,32 @@ def _map_factors(factors: Iterable[str], used_factor_tables) -> Dict: ...@@ -51,19 +52,32 @@ def _map_factors(factors: Iterable[str], used_factor_tables) -> Dict:
return factor_cols return factor_cols
def _map_industry_category(category: str) -> str: if "DB_VENDOR" in os.environ and os.environ["DB_VENDOR"].lower() == "rl":
if category == 'sw': def _map_industry_category(category: str) -> str:
return '申万行业分类' if category == 'sw':
elif category == 'sw_adj': return '申万行业分类(2014)'
return '申万行业分类修订' elif category == 'zz':
elif category == 'zz': return '中证行业分类'
return '中证行业分类' elif category == 'zx':
elif category == 'dx': return '中信标普行业分类'
return '东兴行业分类' elif category == 'zjh':
elif category == 'zjh': return '证监会行业分类(2012)-证监会'
return '证监会行业V2012' else:
else: raise ValueError("No other industry is supported at the current time")
raise ValueError("No other industry is supported at the current time") else:
def _map_industry_category(category: str) -> str:
if category == 'sw':
return '申万行业分类'
elif category == 'sw_adj':
return '申万行业分类修订'
elif category == 'zz':
return '中证行业分类'
elif category == 'dx':
return '东兴行业分类'
elif category == 'zjh':
return '证监会行业V2012'
else:
raise ValueError("No other industry is supported at the current time")
def industry_list(category: str, level: int = 1) -> list: def industry_list(category: str, level: int = 1) -> list:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment