Brontosaurus - create unit tests inside Grasshopper

Hello :slight_smile:

I’ve created new small plugin that will help you to create unit tests inside Grasshopper, it can be helpful if you use Python or C# scripts, when you develop your own plugins or when you have complex definitions to check. Let me know what you think.
brontosaurus_components

Here is the video that shows how it works:

Download: Brontosaurus | Food4Rhino
It’s open-source (MIT License), source code: click

If you have any questions feel free to post it here :wink:

11 Likes

WOW - Thank you - that’s going to be super useful!

1 Like

This is very useful and I hope many people will use it to improve their definitions.
I also like that you have put it on Git! Great work!

1 Like

@w.radaczynski This is awesome! Super useful :slight_smile:

1 Like

great! another cool project. Thanks for sharing this :slight_smile:

1 Like

Thank you guys for your support, it really means a lot to me :slight_smile:

Here is a tutorial:

Table of contents:
0:12 - Assert: addition example (Python, C#, VB)
3:45 - Assert List: bubble sort example (Python)
5:28 - Total (test groups) and create reports with Pterodactyl
7:14 - Assert Point: find center of gravity for 3 points (Python)
7:45 - Assert Point List: testing sphere (Python)
9:19 - Assert Vector and Assert Vector List: rotate vector (Cluster)

1 Like

I have a similar project: here

Good job! I like the idea of asserting geometry.

1 Like

Wow :smiley: I was looking for such things when I started this project, but I have not seen your plugin. Great work :slight_smile:

Hello Keyu @gankeyu
Nice plugin sir. “Those who share their own GH definition with others, and want to ensure the definition is used correctly”. Can you explain me this part of with your plugin if possible show me some small demo.

for example, the following script creates a ring-shaped surface from curve(s). Imagine it’s inside a cluster.

It works when the input is only one curve.

However, it doesn’t work when there’re two input curves. The script generates 4 surfaces.

If the output surface is involved in further calculations, the entire process will be messed up.

Here you can add a contract of the input and the output must have the same length and structure, and abort the computation to avoid freezing due to exploded data tree.

Moreover, you may rename the components for a centralized notification on what goes wrong (or not).

The original intention is: I created a huge definition and share it with my teammates. Sometimes they run into issues and cannot figure out where. Getting information between steps makes debugging much easier.

It’s mostly for unit test, though.

1 Like

So if run into issues I can contact the input and output to your plugin n find the issue which causing the trouble. Like that sir.

Not quite like that.

Say you are the author of a Grasshopper script, and you want to share your script with somebody else. You know your Grasshopper script can only work in a limited circumstances, for example, only work on circles, on closed geometry, etc. Instead of describing the limitation, you can use the “Contracts” inside your Grasshopper script to show whether the input is allowed, etc, and save time for both of you.

2 Likes