Skip to content

Commit

Permalink
DF/93: unify data_format value format (list).
Browse files Browse the repository at this point in the history
It is better to have field value of the same type whatever happens.
Having both `str` and `list` for different cases is to invite errors
to the further data processing.
  • Loading branch information
mgolosova committed Feb 2, 2018
1 parent 4ef0e45 commit f0b7620
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Utils/Dataflow/093_datasetsFormat/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1. Description
--------------
Update dataset metadata:
* add "data_format" field (field value type: str|tuple)
* add "data_format" field (field value type: list)


2. Input
Expand Down
6 changes: 3 additions & 3 deletions Utils/Dataflow/093_datasetsFormat/datasets_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def dataset_format(datasetname):
and first part ('DAOD'), defining the general name of the data format.
:param datasetname:
:return: str|tuple
:return: list
"""
if not datasetname:
return None
ds_format = datasetname.split('.')[4]
if re.match("\w+_\w+", ds_format) is not None:
result = (ds_format, ds_format.split('_')[0])
result = [ds_format, ds_format.split('_')[0]]
else:
result = ds_format
result = [ds_format]
return result


Expand Down
Loading

0 comments on commit f0b7620

Please sign in to comment.