Construct Discontinuous Data Collection

Hi,

First off, the new release is great! However, I have found an issue. I’m not sure if i’m missing something so thought I would post the problem and my solution.

First Issue
The issue is with the LB Construct Data component. I’m trying to construct a discontinuous data collection, however the component appears to only allow for a continuous data collection. To recreate, i’m using Direct Sun Hours with an Analysis Period between 8am to 2pm full year. The following is the error i get when creating the data collection with LB Construct Data;

1. Solution exception:analysis_period start hour of HourlyContinuousCollection must be 0. Got 8

I notice when I open the component (thanks open source) that the component only attempts to create a continuous data collection;

if all_required_inputs(ghenv.Component):
    data = HourlyContinuousCollection(_header, _values)

So, through using the API and python imports (thanks again) I managed to create a discontinuous data collection that works;

from ladybug.datacollection import HourlyDiscontinuousCollection
data = HourlyDiscontinuousCollection(header, values, datetimes)

Hopefully that makes sense.

1 Like

Hi @jordanmathers ,

I was wondering when someone would get to this level of skill with the Ladybug Tools SDK but less than 2 weeks after the release is a lot sooner than I expected. You are exactly right that we didn’t expose the ability to create discontinuous collections with the current Ladybug Grasshopper components but everything exists in the ladybug-core SDK to do so and your code is the correct way to make it. For anyone else interested in understanding @jordanmathers 's code, here are the docs for the HourlyDiscontinuousCollection class that is being initialized in the code sample:

2 Likes

This is the one and only thing I have done with the SDK so far, but I have noticed a couple of other things that I will post about when I explore the solutions more.

1 Like