Skip to content
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

[wish] LB String to Object / Object to String component #307

Open
BingWangUS opened this issue Jun 16, 2022 · 5 comments
Open

[wish] LB String to Object / Object to String component #307

BingWangUS opened this issue Jun 16, 2022 · 5 comments
Labels
wish New feature or request which is not critical to continued development at this point

Comments

@BingWangUS
Copy link

Hi LBT team,

We think a component to convert LB Object to JSON string as well as the other way around will be helpful, in addition to save to file component. Similar functionality are available for HB objects, where we have both options to save as string and save as files.

We have been creating custom LB objects in the same json format and it will be great if we can have this component to enable us using the great visualization functions of LBT.

Thanks.
Bing

@mostaphaRoudsari
Copy link
Member

Hi @BingWangUS, have you seen the ladybug-chars library? I'm not sure what you are trying to do for visualization, but this library might do it already -> https://github.com/ladybug-tools/ladybug-charts

@BingWangUS
Copy link
Author

Thanks @mostaphaRoudsari for sharing. I haven't but will check it out.

To clarify what we are trying to do - we have created some custom json string that follows the same format of LB objects, and would like to convert it back to a LB object in the grasshopper environment, so that most people can use it the same way as how they typically use LBT.

I'm aware that we can create LB objects via LB construct data component, or use a customize ghpython script like below ladybug.datacollection import HourlyContinuousCollection
import json
d = json.loads(jsonDataCollection)
data = HourlyContinuousCollection.from_dict(d)

Just feel it could save a few clicks if we have such a component similar to HB string to Object.

Or maybe just allow the LB Load Data component to take json string input?

@mostaphaRoudsari
Copy link
Member

Hi @BingWangUS! Thank you for the explanation.

To do what you are asking for we basically need to develop a schema for the Ladybug objects similar to what we have done for Honeybee: https://github.com/ladybug-tools/honeybee-schema/wiki, https://www.ladybug.tools/honeybee-schema/model.html

It will take some time before we can find the time to do this.

@mostaphaRoudsari mostaphaRoudsari added the wish New feature or request which is not critical to continued development at this point label Jun 20, 2022
@chriswmackey
Copy link
Member

Hey @BingWangUS ,

I'm sorry that I forgot to read through this all when you first posted it. If you can clarify which objects you are hoping to be able to serialize, that would make things quicker to implement on our end. Is it just the data collections? If so, this is pretty straightforward.

@BingWangUS
Copy link
Author

Hey @BingWangUS ,

I'm sorry that I forgot to read through this all when you first posted it. If you can clarify which objects you are hoping to be able to serialize, that would make things quicker to implement on our end. Is it just the data collections? If so, this is pretty straightforward.

Hi Chris, no worries and thanks for getting back. Yes it is the data collections I was referring to. We already have LB Dump Data component, but in my case I was hoping to convert json string directly created within GH to LB objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish New feature or request which is not critical to continued development at this point
Projects
None yet
Development

No branches or pull requests

3 participants