-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Click #595
Click #595
Conversation
moved generatetemplate into its own function decorate function changed the input axes, so I now store the original ids
…masked missing data, adding tets for merge fucntion
@doutriaux1 I'll try to take her for a spin tomorrow... is there an example somewhere? |
@doutriaux1 below is error message I am getting when I tried with this update.
I don't know why it complains it cannot find Error coming from here: pcmdi_metrics/pcmdi_metrics/io/base.py Line 645 in 607baae
|
@doutriaux1 I think I nailed the cause of my error.
|
Below and attached (please remove .TXT at the end of file name) are a toy code that I wrote to flatten list of lists. Hope this help. import itertools
def flatten(list0):
"""
NOTE: Flatten given list of lists to list
input
- list0: list, string, list of lists, etc.
output
- list2: flat list
"""
if isinstance(list0, list):
list1 = [([x] if isinstance(x, str) else x) for x in list0]
list2 = list(itertools.chain(*list1))
else:
list2 = [list0]
return list2 merge1 = [["model", "realization"], ["mode", "season"]] # WORK
merge2 = ["model", "realization"] # WORK
merge3 = [["model", "realization"], ["mode", "season"], 'test'] # WORK
merge4 = [["realization"], ["mode", "season"], 'test0', ['test1', 'test2']] # WORK
merge5 = 'model' # WORK
merge6 = [[['model', 'realization'], ['mode', 'season']], 'test0'] # NOT WORK
print(flatten(merge1))
print(flatten(merge2))
print(flatten(merge3))
print(flatten(merge4))
print(flatten(merge5))
print(flatten(merge6))
flatten_list_of_list.ipynb.TXT |
@lee1043 always a list of list. |
@doutriaux1 good to learn, thanks for confirming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doutriaux1 it fixed the x-axis combination error problem, as shown at PCMDI/click#7. Thank you for the update. I confirm the PR is ready to be merged.
… was set back too early
No description provided.