-
Notifications
You must be signed in to change notification settings - Fork 6
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
entities don't handle being set to np.inf #133
Comments
It would be useful to understand where this is failing, dripline should be trying to serialize this in json, which probably won't actually do what you want but I think should work from the client side. I'd bet the service doesn't know what to do with whatever that gets rendered into though. |
@laroque Is there anything you want me to do on my end to diagnose this? For now, I have my control scripts throw an exception whenever my curve_fit throws an error. |
I've been mulling over this but I haven't dug into the code (much less actually tried to reproduce). It isn't clear to me if this is a problem on the client side with sending the message, or on the server side with responding to it. The solution will be very dependent on that. Several different paths that we could follow up: QuestionCan you help clarify where it is failing? I think the steps are something like:
this leads to.... HypothesisI expect that the problem is that above in step 2 the C++ implemented binding doesn't know how to deal with a numpy array and/or a numpy.infinity type when converting to a scarab Param object (for constructing a dripline message and eventually serializing to json). Sidestep/workaroundWe should probably figure out a place to document this more clearly, but dripline as written doesn't support arbitrary data types from outside of the standard python library (for example, numpy types). There are a couple of issues around this:
... that was a distraction, what I meant to say was: |
We could also look at how something like JSON or YAML encoding works for objects like that in Python. I presume there must be some fairly transparent way that the translation in either direction between a numpy array and the fairly limited types of data allowed by JSON and YAML is done. |
I'm trying to push hard on Orpheus commissioning right now. I think I'll do some DAQ development next week and can look at this then. I'd be ok if it was required of me to convert to a native python type as long as that requirement is explicit. But I think it would be good if dripline threw an error when I didn't do that, rather than just hang and stall, necessitating me to manually kill the docker container. |
Your expectation here (getting an exception & an explicit requirement in the docs) is reasonable and is what I would have expected to happen. I would have expected failed type conversion to produce an error, I would have expected a failed attempt to send a message to time out and produce a (possibly not so helpful) error. I think that this is something that we (the dripline side) should fix to basically the state you asked for, the problem is just finding someone with the time to dig in and isolate and fix the problem. The suggestion to convert to python types may or may not end up being the only option long term, but is probably the fastest solution to your problem let you get back to focus on Orpheus, since I don't know that we'll be able to resolve it by then. |
Here is another instance of dripline not being able to handle numpy arrays. I tried to use the
This returns single-valued numpy array, assuming resistance is single-valued. I see this error in my k8 logs when the calibration function gets called.
To work around this, I casted the interpolated result as a float. |
My data taking scripts ran into an edge case where it tried to set an entity to
np.inf
. The script just hung. I didn't even see an error in the service logs. I think the dripline should catch this case and try to intentionally crash or throw an error.To go into more detail, here is the relevant portion of my control script.
My script couldn't perform the fit on the VNA trace.
I think when I get an OptimizeWarning error, the values of my
pcov
arenp.inf
, so it tried to setsig_f_reflection
tonp.inf
and just hung without making any sort of progress.The text was updated successfully, but these errors were encountered: