Hops not updating

Hi @stevebaer,

Could you please try on your side to:
image

I get this after the component initially re-connects:
image

(again both cache don’t matter)

"""Hops default HTTP server example"""
import ghhops_server as hs
import rhino3dm

hops = hs.Hops()

gdict = {}

@hops.component(
    "/comp_name",
    name="comp_title",
    nickname="comp_shortname",
    description="Component's description",
    inputs=[
        hs.HopsNumber("A", "a", "One"),
        hs.HopsString("B", "b", "Two"),
        hs.HopsPoint("C", "c", "Three"),
        hs.HopsBoolean("D", "d", "Four"),
        hs.HopsBrep("E", "e", "Five"),
        hs.HopsCurve("F", "f", "Six"),
        hs.HopsInteger("G", "g", "Seven"),
        hs.HopsLine("H", "h", "Eight"),
        hs.HopsMesh("I", "i", "Nine"),
        hs.HopsSubD("J", "j", "Ten"),
        hs.HopsSurface("K" ,"k", "Eleven"),
        hs.HopsVector("L", "l", "Twelve")
    ],
    outputs=None  #[hs.HopsNumber("Sum", "S", "A + B")]
)
def comp_name(a, b, c, d, e, f, g, h, i, j, k, l):
    global gdict
    gdict["a"] = a
    gdict["b"] = b
    gdict["c"] = c
    gdict["d"] = d
    gdict["e"] = e
    gdict["f"] = f
    gdict["g"] = g
    gdict["h"] = h
    gdict["i"] = i
    gdict["j"] = j
    gdict["k"] = k
    gdict["l"] = l
    return None


@hops.component(
    "/dict_data",
    name="dict_data_title",
    nickname="dict_data_shortname",
    description="Component's description",
    inputs=None,
    outputs=[hs.HopsNumber("A", "a", "One"),
             hs.HopsString("B", "b", "Two"),
             hs.HopsPoint("C", "c", "Three"),
             hs.HopsBoolean("D", "d", "Four"),
             hs.HopsBrep("E", "e", "Five"),
             hs.HopsCurve("F", "f", "Six"),
             hs.HopsInteger("G", "g", "Seven"),
             hs.HopsLine("H", "h", "Eight"),
             hs.HopsMesh("I", "i", "Nine"),
             hs.HopsSubD("J", "j", "Ten"),
             hs.HopsSurface("K" ,"k", "Eleven"),
             hs.HopsVector("L", "l", "Twelve")
             ]
)
def dict_data():
    global gdict
    a = gdict["a"]
    b = gdict["b"]
    c = gdict["c"]
    d = gdict["d"]
    e = gdict["e"]
    f = gdict["f"]
    g = gdict["g"]
    h = gdict["h"]
    i = gdict["i"]
    j = gdict["j"]
    k = gdict["k"]
    l = gdict["l"]

    return [a, b, c, d, e, f, g, h, i, j, k, l]


if __name__ == "__main__":
    hops.start(debug=False)

Another weird thing is that I’m not getting the description of the outputs that was set in the python code but rather one read by the object type:
image

Could you walk me though what this means? I would like to follow your steps, but am confused as to what re-connect means.

Hi. I am facing the issue of Hops not updating whenever I make changes to the Python file in VS Code. After removing casche from preferences, unchecking casche server and casche memory too, it doesnt update. It only updates its inputs and outputs if I change the name of end server (inside @hops.component( “/name”,…). How can I solve this?

If you click on Path in the hops component don’t change anything and then click ok, does the component update?

Make sure you are using the latest version of Hops (at least 0.5.0). I just updated the package last week.

Hi Steve. By path component , it doesnt update anything. It doesnt update the input and output names. the component works though . I am also using the debugg mode. It is happening to a few more people. Is there any other cache in grasshopper?

I am using the latest hops component and python 3.8.1 as python 3.9.5 (latest) is giving issues with importing rhinoinside.

I don’t believe this is a caching issue. I’ll need to try and repeat this myself.

1 Like

I just ran the sample server and set a hops component up with the pointat endpoint.

@hops.component(
    "/pointat",
    name="PointAt",
    nickname="PtAt",
    description="Get point along curve",
    icon="examples/pointat.png",
    inputs=[
        hs.HopsCurve("Curve", "C", "Curve to evaluate"),
        hs.HopsNumber("t", "t", "Parameter on Curve to evaluate"),
    ],
    outputs=[
        hs.HopsPoint("P", "P", "Point on curve at t")
    ]
)
def pointat(curve, t=0.0):
    return curve.PointAt(t)

which looks like this
image


I then stopped the python server and modified the pointat function to look like this

@hops.component(
    "/pointat",
    name="PointAt",
    nickname="PtAt",
    description="Get point along curve",
    icon="examples/pointat.png",
    inputs=[
        hs.HopsCurve("Curve", "C", "Curve to evaluate"),
        hs.HopsNumber("t", "t", "Parameter on Curve to evaluate"),
        hs.HopsNumber("m", "m", "Multiplier"),
    ],
    outputs=[
        hs.HopsPoint("P", "P", "Point on curve at t")
    ]
)
def pointat(curve, t=0.0, m=1.0):
    return curve.PointAt(t*m)

after clicking on the Hops component path and just clicking OK, I end up with the following
image


What are you doing that is different?

I found some cases where the component is not updating. I’m working a fix and should have a new version of Hops available next week.

1 Like

Hi. I am also facing the same issue. I am doing exactly what you are doing except that I am not specifying nickname and description. It would be great if you could fix it! cheers

The latest release of hops (0.6.0) tries to update inputs/outputs when solving. See Hops - version 0.6.0 available

1 Like

Hey @stevebaer I seem to not solve the problem yet. can you tell how to refresh the component after making changes in vs code to make it work?

Change a value for one of the inputs.

What are you doing to try and update? If I can repeat your process, I may be able to fix this.

For me, changing the input values inside “Inputs” doesnt update the hops components inputs (even after unchecking cache server). Also adding new inputs and outputs doesnt show in the hops component unless you change the name of end server

Do you get an error bubble about “Bad Inputs” when you run the component after changes?

no, the component works though

it appears its cached to previous state (end server name) and keeps running

Turn off “cache in memory” for your component when debugging and developing your server.

Can you describe some steps to try with the sample ghhops-server scripts to repeat the process?

Turn off cache done…doesnt help
Hi . As you can see in the image the inputs are FF1 and FF2, but it doesnt change it in the gh component. but it still works and computes geometry

I see what is going on. I’ll try to get this fixed in the future. For now, if you change the name of the input Hops will detect that and update the component. For example if you change
“face Index 1” to “Face1” you should see Hops update