...
 
Commits (2)
# Changelog
### 0.12.9 -> 0.12.10
Non-breaking changes:
- fix series name generation
### 0.12.8 -> 0.12.9
Non-breaking changes in validation script:
......
......@@ -42,6 +42,8 @@ def generate_series_name(dimensions, dimensions_codes_order, dimensions_values_l
'M'
>>> generate_series_name({'FREQ': 'A', 'INDICATOR': 'X'}, ['FREQ', 'INDICATOR'], {'FREQ': {'A': 'Annual'}, 'INDICATOR': {'X': 'Files'}})
'Annual – Files'
>>> generate_series_name({'FREQ': 'A', 'INDICATOR': 'X'}, ['FREQ', 'INDICATOR'], {'FREQ': {'A': 'Annual'}, 'INDICATOR': {'X': 'Files', 'Y': 'Directories'}})
'Annual – Files'
# Duplicate dimensions values labels
>>> generate_series_name({'FREQ': 'A', 'INDICATOR': 'X'}, ['FREQ', 'INDICATOR'], {'FREQ': {'A': 'Annual'}, 'INDICATOR': {'X': 'Files', 'Y': 'Files'}})
......@@ -60,10 +62,13 @@ def generate_series_name(dimensions, dimensions_codes_order, dimensions_values_l
if dimension_value_label is None:
dimension_value_label = dimension_value_code
else:
dimension_value_labels = dimension_values_labels.keys()
if len(dimension_value_labels) > 1:
if len([
v for v in dimension_values_labels.values()
if v == dimension_value_label
]) > 1:
dimension_value_label += ' ({})'.format(dimension_value_code)
return dimension_value_label
series_name = " – ".join(map(get_dimension_value_label, dimensions_codes_order))
return series_name
......
......@@ -40,7 +40,7 @@ doc_lines = __doc__.split('\n')
setup(
name='dbnomics-data-model',
version='0.12.9',
version='0.12.10',
author='DBnomics Team',
author_email='contact@nomics.world',
......