Hops not updating

It may as well be my fault but I noticed that after restarting the server and Rhino and opening the gh file with hops component one cannot reconnect to the server unless a new hops component is added.

Is this a know issue?

Are you referring to a python server or the compute.geometry server that hops uses to solve definitions?

python server

Hops aggressively caches results based on inputs. When working on the python server you may want to turn off caching to make sure things are working. If you turn off caching for the hops component that calls the python server, do you see calls occurring after restarting the python process?

No, doesn’t seem to make a difference.

Do I have to uncheck the caches prior to connecting to a server? Does it delete the cache upon uncheck?

You can clear the cache in grasshopper preferences. I’m not sure if this is the cause of the issue that you are seeing.

Just tested it doesn’t matter if it’s unchecked before connecting, though this makes another issue. When you uncheck the caches before connecting and then stop the server it’s tanking GH.

Are you able to repeat this with the sample script at

I would like to try and figure out how to repeat this bug.

Thanks

While I test the example, please take a look at this:

I get an error:

[INFO] Starting hops python server on localhost:5000
[DEBUG] False : {"values": [], "errors": ["Unknown Hops url"]}
[INFO] 127.0.0.1 - - [09/May/2021 19:18:37] "GET /Add HTTP/1.1" 404 -
[DEBUG] False : {"values": [], "errors": ["Unknown Hops url"]}
[INFO] 127.0.0.1 - - [09/May/2021 19:18:37] "GET /Add HTTP/1.1" 404 -
[DEBUG] False : {"values": [], "errors": ["Unknown Hops url"]}
[INFO] 127.0.0.1 - - [09/May/2021 19:18:37] "GET /Add HTTP/1.1" 404 -
[DEBUG] False : {"values": [], "errors": ["Unknown Hops url"]}
[INFO] 127.0.0.1 - - [09/May/2021 19:18:37] "GET /Add HTTP/1.1" 404 -

Update:
Scrap that the example works I’ll test the issue (I used a capital letter in Add :slight_smile: )

Confirmed the issue persist even with your example. No matter the cache check(s) the re-opened gh file doesn’t reconnect to the server.

I see, the hops component fails at first because the server is off and never builds itself once the server is started. I’ll get this added as an issue on github and see what can be done to fix this. Thanks

[edit] I added an issue for this at

1 Like

With Hops 0.5.0 you should get an error message that the server is not available if you try to connect to a python server that isn’t running. I don’t have auto-connect hooked up, but the following steps should work now

  • start the python server
  • right click on your hops component and click on “Path…”
  • click ok to accept the already set path. This should cause the component to check with the server again and get properly set up

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