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

Wrong Input/Output names and descriptions #319

Closed
deKlerk opened this issue Mar 24, 2021 · 13 comments · Fixed by #321
Closed

Wrong Input/Output names and descriptions #319

deKlerk opened this issue Mar 24, 2021 · 13 comments · Fixed by #321
Labels
Hops Hops Grasshopper Component

Comments

@deKlerk
Copy link

deKlerk commented Mar 24, 2021

Hi everyone,

I'm getting an incorrect representation of the component's input and outputs:

  • input is presented with the correct nickname and description, but doesn't show the full name;
  • the outputs are shown as "Path" instead of reading the corresponding parameters.

Besides that, all should be rendering their full names, according to the settings of the display.

Below is the snippet of code for the endpoint, which can be accessed here: https://hops-online.herokuapp.com/owldemo

from owlready2 import *

#-- OWLREADY2 Demo --#
@hops.component(
    "/owldemo",
    name="OwlDemo",
    description="Demo using Owlready2",
    inputs=[hs.HopsString("Url", "U", "Url to ontology")],
    outputs=[
        hs.HopsString("Classes", "Cls", "Classes in the ontology"),
        hs.HopsString("Properties", "Prop", "Properties in the ontology"),
        hs.HopsString("Individuals", "Ind", "Individuals in the ontology")
    ]
)
def owlDemo(owlurl: str):
    
    onto = get_ontology(owlurl).load()
    owl_class = list(onto.classes())
    owl_prop = list(onto.properties())
    owl_ind = list(onto.individuals())

    return (str(owl_class), str(owl_prop), str(owl_ind))

Tests using local and remote endpoints:
owldemo_local-remote

@mcneel-build
Copy link

Linked with COMPUTE-218

@seghier
Copy link

seghier commented Mar 24, 2021

Hi deKlerk , can you please make a tutorial how you used heroku to create the script and use it online?
i tried alot without success

@deKlerk
Copy link
Author

deKlerk commented Mar 24, 2021

Hi @seghier,

I'll need to find some spare time to do it; maybe over the weekend.
In the meantime, try this tutorial - it should be enough to help you deploy your app:

https://www.jcchouinard.com/deploy-a-flask-app-on-heroku/

@sbaer
Copy link
Member

sbaer commented Mar 25, 2021

This is a bug in how Hops is dynamically creating input and output params. Need to set the IGH_Param Name and Nickname properties at creation time.

@seghier
Copy link

seghier commented Mar 25, 2021

Thank you @deKlerk , everything work fine except this error, i will contact their support about that
image

@sbaer sbaer mentioned this issue Mar 25, 2021
@sbaer
Copy link
Member

sbaer commented Mar 25, 2021

Fix is in Hops 0.4.7

@deKlerk
Copy link
Author

deKlerk commented Mar 25, 2021

@seghier , that is probably happening because you aren't forcing Heroku to install the correct Python version.

Just add a file called runtime.txt to the root of your app with this in its content:

python-3.9.2

Make sure you replace the version number to match the one you're using (Hops-Server requires Python 3.8 or above).

@seghier
Copy link

seghier commented Mar 25, 2021

@deKlerk , yes i did that by use runtime.txt and python-3.9.2 , but i think the problem because i use a module which is not available in pypi and i don't know how to include it, still waiting the answer of their support

@deKlerk
Copy link
Author

deKlerk commented Mar 25, 2021

Hi @sbaer

Fix is in Hops 0.4.7

Just updated both Hops to 0.4.7 and GHHops-Server to 1.2.0 but the problem persists:

input_output

@sbaer sbaer reopened this Mar 25, 2021
@sbaer
Copy link
Member

sbaer commented Mar 25, 2021

I’m not sure what the bug is based on that screenshot

@deKlerk
Copy link
Author

deKlerk commented Mar 25, 2021

Hi @sbaer,

With Grasshopper display options set to "Draw full names", I was expecting to see the long names of the inputs and outputs, according to the code snippet below:

@hops.component(
    "/plevels",
    name="ProfileLevels",
    description="Creates a series of levels from a profile",
    inputs=[
        hs.HopsCurve("Curve", "C", "Curve to replicate"),
        hs.HopsNumber("Dist", "D", "Distance between levels"),
        hs.HopsInteger("Num", "N", "Number of levels")
    ],
    outputs=[hs.HopsCurve("Curves", "Cs", "Series of profile curves")]
)

Instead, it is only showing their nicknames.
It's not a big deal, just pointing this out ;)

@sbaer
Copy link
Member

sbaer commented Mar 25, 2021

I see this too, thanks.

@pearswj pearswj added the Hops Hops Grasshopper Component label Apr 12, 2021
@sbaer
Copy link
Member

sbaer commented Apr 13, 2021

Closing this issue as draw full names is now split to a new issue

@sbaer sbaer closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hops Hops Grasshopper Component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants