This is a two-part question. You can answer "(1) Yes (2) No", "(1) No (2) No" or "(1) irrelevant (2) Yes"

(1): Is "auto" the right word?

The reason I ask is that it's taken us quite some time to realize what this does, and that leads me to wonder if something is amiss.
My thinking:

Taking a look at this code:

 private final static String[] connectOperationStrings =
 { "delete", "modify", "create", "modifyOrCreate", "auto" };

we see that there are five possible operations that the connect command can do. None of us, even Miguel, were realizing that "auto" is in this set -- that you can't "modify auto" any more than you can "delete create". You get one operation only.

I believe the confusion may lie with the fact that "auto" is an adverb and the rest are action verbs. Thus, you can "delete" or "modify" something, but you can't "auto" it. Sometimes it just takes time to realize things like this. My suggetion, proposal, question, is this:

Should this list read:

 private final static String[] connectOperationStrings =
 { "delete", "modify", "create", "modifyOrCreate", "calculate" };

? Would that be more obvious? Seems to me "calculate" is the operation actually being performed.

connect calculate hbonds (*) (*)
connect calculate (*) (*)

?

(2) Second point along these lines. Various people have pointed out that defaults should have names as well. Here the default seems to me to be "covalent":

connect calculate hbonds (*) (*)
connect calculate covalent (*) (*)

In Jmol, "hbond" and "hbonds" are equivalent. But because connect is being used for two separate operations -- one in which "hbonds" is simply indicating what sort of thing to calculate, the other what sort of bond to produce (subtle difference), and because this calculate function doesn't use, for example, the minimum/maximum distance business, I propose splitting it off to a new command:

calculate hbonds (*) (*)
calculate covalent (*) (*)

Now we have a clearly distinguishable action. I'm always thinking documentation: "The calculate command generates either hydrogen bonds or covalent bonds based on algorithms involving atom type and distance...."

This will avoid all confusion with "connect modify". And there would be no suggestion of

calculate 1.0 1.3 covalent (*) (*)

which otherwise would be "conceivable" with

connect 1.0 1.3 auto (*) (*)

which also doesn't make any sense.

Bob


Bob Hanson wrote:

Let' see exactly what the processor does here:

connect modify auto (*) (*)


First, "modify" is ignored. The covalent "autobonding" functionality does not ever replace existing bonds. So since in this case the bonds are already double, they are left intact. If some had been deleted, then they would show up again, but if none were deleted, none are changed.

That is, the "auto" functionality in its current state cannot be used to modify bond order. All it is meant to do is add bonds that don't already exist. "Create" is implicit.

To use "connect" to replace current bonding patterns with Jmol-calculated single bonds you would invoke:

 connect delete (*) (*)
 connect auto (*) (*)

The same goes for hydrogen bonds. The "auto" functionality there cannot be used to modify existing bonds, only create bonds. For that you would need:

 connect hbonds delete (*) (*)
 connect hbonds auto (*) (*)


Bob

programming note: This is because both methods end up ultimately at Atom.bondMutually(Atom, short, Frame), and that method never changes an existing bond.





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to