add_tokens_to_AOIs does not work when AOI kind is line instead of sub-line
the function add_tokens_to_AOIs does not work when AOI kind is set to "line" it only works when kind is set to "sub-line"
Hi, we are Elliot and Tom, and we are dealing with this issue. During the process of fixing the bug, we met some problems. First, we actually found that the bug is not actually a bug, and this method is designed only for sub-line kind AOI by using this line of code.aois_raw = aois_raw[aois_raw.kind == "sub-line"].copy() This makes the rest method including add_srcml_to_AOIs and hit_test to be unavailable for line kind AOI. Thus, our solution based on this assumption is adding an error message.
if aois_raw.kind[0] == "line":
msg = rf"cannot add a token when AOI kind is line"
raise TypeError(msg)
However, we want to confirm with you about our assumption because we believe that there should be more use for the line kind AOI. Thank you for answering our concern.
Hello Elliot and Tom, Adding an error message is not a solution for the problem, it requires adding code to allow for an entire line to be processed as an area of interest. Start with the Jupyter notebook example and try to run it with a line to see how it fails. Ideally, we want this to work in a similar way to "part"
I responded to your email too. Let me know if you have any questions.
Fixed! Reapply at 1444
aois_raw = aois_raw[aois_raw.kind == "sub-line" or "line"].copy()
Thanks @jhimel22 You should create a pull request for this fix, if possible.