# Loaded assets look like numbers but are a different type

**URL:** <https://discourse.pollination.solutions/t/loaded-assets-look-like-numbers-but-are-a-different-type/531>\
**Category:** Grasshopper Plugin\
**Created:** [July 13, 2021, 6:06am UTC](https://discourse.pollination.solutions/t/loaded-assets-look-like-numbers-but-are-a-different-type/531 "2021-07-13T06:06:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![max](https://discourse.pollination.solutions/letter_avatar_proxy/v4/letter/m/e5b9ba/32.png) [@max](https://discourse.pollination.solutions/u/max)\
**Post date:** [July 13, 2021, 6:06am UTC](https://discourse.pollination.solutions/t/loaded-assets-look-like-numbers-but-are-a-different-type/531/1 "2021-07-13T06:06:17Z")

</div>

Hi @mostapha,

I’ve noticed that some of the downloaded outputs look like numbers but are some other type, which means I need to run them through a Number parameter component first. Is there a reason for this?

Grasshopper’s native Average component throws an error but the native Multiply component doesn’t, so I didn’t notice at first that I was getting the wrong results:

 ![image](https://discourse.pollination.cloud/uploads/default/original/1X/a7729a87c9587eef3321b69ac9e1b3e46afe1c3d.jpeg)

---

<div class="post-metadata">

**Author:** ![mostapha](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mostapha/32/5761_2.png) [@mostapha](https://discourse.pollination.solutions/u/mostapha)\
**Post date:** [July 13, 2021, 1:19pm UTC](https://discourse.pollination.solutions/t/loaded-assets-look-like-numbers-but-are-a-different-type/531/2 "2021-07-13T13:19:01Z")

</div>

Technically it should show up as numbers. I checked the handler that loads the results and it converts them to numbers:

> <https://github.com/pollination/handlers-python/blob/8ceadd03edf057c067b7d3548106258916039e7f/pollination_handlers/outputs/helper.py#L40-L47>

@mingbo, is this the behavior of the Grasshopper component to change the type to text if it doesn’t know the type? Or does it use the type of the output alias?

@chris, can you confirm that I’m checking the correct function for parsing the results?

---

<div class="post-metadata">

**Author:** ![mingbo](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mingbo/32/5682_2.png) [@mingbo](https://discourse.pollination.solutions/u/mingbo)\
**Post date:** [July 13, 2021, 4:32pm UTC](https://discourse.pollination.solutions/t/loaded-assets-look-like-numbers-but-are-a-different-type/531/3 "2021-07-13T16:32:39Z")

</div>

I can confirm here I can recrate this issue.  
It is because I used a generic GH\_ObjectWrapper for all output data for constructing the GH\_DataTree, instead of trying to guess what each of the real types are.

 ![image](https://discourse.pollination.cloud/uploads/default/original/1X/e17d38fbfd7fac3745b5c28ec59cbf6b2b156d6b.png)

I will try to find a better solution here.

---

<div class="post-metadata">

**Author:** ![chriswmackey](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/chriswmackey/32/6207_2.png) [@chriswmackey](https://discourse.pollination.solutions/u/chriswmackey)\
**Post date:** [July 20, 2021, 5:49pm UTC](https://discourse.pollination.solutions/t/loaded-assets-look-like-numbers-but-are-a-different-type/531/4 "2021-07-20T17:49:48Z")

</div>

I know I’m incredibly late here but I thought it was still worth confirming that @mostapha has found the correct handler function there. The issue is in regards to the GH\_ObjectWrapper that is being used. In case it’s helpful, @mingbo , this is how we construct the DataTree in IronPython:

> <https://github.com/ladybug-tools/ladybug-rhino/blob/master/ladybug_rhino/grasshopper.py#L238-L262>

I think we get away with using the `s_type=object` in IronPython because GHPython does type-checking on everything that is output from the component. On the C# end, if you were to use a different `s_type` when constructing the data tree, I think you can get everything imported as a float instead of the generic object type.
