How to convert ladybug.dt.DateTime into list or tuple?

I tried to follow the instruction of this post and modified my ‘LB construct Data’ and got an error report when I connected ‘datetimes’ input to the ‘dates’ output of the ‘Analysis Period’ component.

1. Solution exception:datetimes should be a list or tuple. Got <class 'ladybug.dt.DateTime'>

how to generate the ‘datetimes’ as was mentioned above?

problem about datetimes.gh (22.0 KB)

BTW merry Christmas eve to you all!

Can anybody give me a clue about this question and I’ll search for the answer.

Done, just use the list item. I was so DUMB, @chris sorry but can you delete this topic?

1 Like

And I really should learn to code

This is all good, @Zed . There’s no need to delete the topic. Also, FYI, I just added support for creating discontinuous data collections with the “LB Construct Data” component:

It only works for the case that the _values align perfectly with the _a_period_ so you’ll still need to input datetimes if the number of hoys in the analysis period doesn’t match the number of values. However, it will address your specific case here since you are taking the dates from the analysis period component.

1 Like