pcdshub / happi

Heuristic Access to Positions of Photon Instruments
https://pcdshub.github.io/happi/master
Other
13 stars 29 forks source link

BUG: allow `happi search` to match int numerics #261

Closed tangkong closed 2 years ago

tangkong commented 2 years ago

Description

Motivation and Context

closes #256

In building tests I realized happi edit does not allow editing of extraneous information. A portion of the new test has been commented out for when that is fixed. (see #262)

How Has This Been Tested?

Test suite, interactively

Where Has This Been Documented?

This PR

image

ZLLentz commented 2 years ago

The screenshot in the description above confused the heck out of me because its "after -> before" instead of "before -> after" but I caught myself before making an equally confused comment.

tangkong commented 2 years ago

I'm going to merge this, but another edge case I didn't consider is scientific notation. client.search_regex won't consider something 100 == 1e2, so we basically pray that the str(float(str)) conversion produces something that matches the database.

At this point, we're patching over an interface that really doesn't seem to handle numerics correctly. This is probably worth a deeper look, perhaps at other search methods on the backends.