Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#801 closed defect (fixed)

Unpredictable keyword completion

Reported by: pett Owned by: Greg Couch
Priority: blocker Milestone: 0.5
Component: Command Line Version:
Keywords: Cc: chimera-programmers, Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Currently, if a user doesn't type enough characters to uniquely identify a command keyword, the parser basically picks one of the matches out of a hat (dictionary) and uses it. This can lead to surprising results, particularly if a user was unaware of other possible matches, or a command has been recently modified to add keywords that create ambiguity where there was none before.

The proposed change is this: if the partially typed keyword matches a keyword that is a complete subset of the other possible completions (i.e. "silhouette" vs. "silhouetteWidth"), the short keyword is matched so that the user doesn't have to type it completely. In other cases, a [non-dialog] error is raised saying that what was typed is ambiguous and listing the possible completions for it.

Change History (16)

comment:1 by pett, 8 years ago

Cc: chimerax-programmers added; chimeras-programmers removed

comment:2 by pett, 8 years ago

Cc: chimera-programmers added; chimerax-programmers removed

comment:3 by pett, 8 years ago

Milestone: Alpha 3

comment:4 by Greg Couch, 8 years ago

Is there a test case, or does one need to be written?

in reply to:  5 ; comment:5 by pett, 8 years ago

hb inter true


comment:6 by Greg Couch, 8 years ago

Resolution: fixed
Status: assignedclosed

Done.

in reply to:  7 ; comment:7 by Elaine Meng, 8 years ago

I don’t want to have to type the whole word “silhouettes” but it is not exactly a subset of the other possibilities with “set," so it is now required.  Can we somehow change the rules to avoid the following problem, or maybe change the “silhouettes” keyword to “silhouette”?

set sil t
Expected keyword "silhouettes", "silhouetteWidth", "silhouetteColor", or "silhouetteDepthJump” 


comment:8 by pett, 8 years ago

The same issue exists for "cartoon style arrows" where just "arrow" wouldn't conflict with the longer keywords (and the only conflict is actually in upper vs. lower case!)

comment:9 by pett, 8 years ago

Resolution: fixed
Status: closedreopened

Sorry to reopen this when the problem is that we didn't specify the problem correctly the first time, but Elaine and I have talked this over and the behavior we'd like is that if there is only one possible match with the lowest "word count" (i.e. camel-case changes or underscores, depending on what the code looks at) then that gets matched. Only if there are more than one possible completion at the lowest word count would the "ambiguous" error occur (probably listing all the possibilities, not just the lowest word count ones).

--Eric

comment:10 by Conrad Huang, 8 years ago

Owner: changed from Greg Couch to pett
Status: reopenedassigned

Accidentally added comments to wrong ticket.

Last edited 8 years ago by Conrad Huang (previous) (diff)

comment:11 by Conrad Huang, 8 years ago

Owner: changed from pett to Greg Couch

Accidentally added comments to wrong ticket. Changing owner back to Greg.

comment:12 by Conrad Huang, 8 years ago

Milestone: Alpha 3Alpha 4

comment:13 by Greg Couch, 8 years ago

Resolution: fixed
Status: assignedclosed

Checked in fix that takes into account the number of words in a keyword.

comment:14 by Elaine Meng, 8 years ago

Milestone: Alpha 4Beta Release
Resolution: fixed
Status: closedreopened

In current daily build (2017-11-28) "col" is interpreted as "colorAtoms" instead of "color" option of "clashes". Example:

open 1zik
show
clashes #1 col hot pink

...whereas "clashes #1 color hot pink" does work...

comment:15 by Greg Couch, 8 years ago

Resolution: fixed
Status: reopenedclosed

Fixed. Needed sort possible completions by number of words. Note that entering the clashes command without an open structure gives a traceback:

No clashes
Traceback (most recent call last):
  File "C:\cygwin64\home\gregc\src\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\cmd_line\tool.py", line 201, in execute
    cmd.run(cmd_text)
  File "C:\cygwin64\home\gregc\src\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2551, in run
    result = ci.function(session, **kw_args)
  File "C:\cygwin64\home\gregc\src\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\clashes\cmd.py", line 21, in cmd_clashes
    return _cmd(session, test_atoms, name, hbond_allowance, overlap_cutoff, "clashes", **kw)
  File "C:\cygwin64\home\gregc\src\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\clashes\cmd.py", line 168, in _cmd
    pbg = attr_atoms[0].structure.pseudobond_group(name)
  File "C:\cygwin64\home\gregc\src\chimerax\ChimeraX.app\bin\lib\site-packages\chimerax\core\atomic\molarray.py", line 157, in __getitem__
    v = object_map(self._pointers[i], self._object_class)
IndexError: index 0 is out of bounds for axis 0 with size 0

comment:16 by pett, 8 years ago

Milestone: Beta Release0.5

Milestone renamed

Note: See TracTickets for help on using tickets.