Re: [Jmol-users] Potential bug in reading xyz files

2016-09-26 Thread Peter Brommer
Hi Bob (and the others),

thanks for your answer - this helps enormously. I have a bunch of legacy files 
created by a legacy utility - I modified the code to no longer put stuff after 
the integer.

As a side note: the xyz::broken.xyz trick also works on the command line (which 
is how I start jmol in most cases).

Peter


> On 26 Sep 2016, at 13:42, Robert Hanson  wrote:
> 
> The xyz reader ignores everything else on the first line after the integer.
> 
> The reader format resolver is what requires just an integer (the number of 
> atoms) and white space on the first line in order to send the data to the xyz 
> reader, because there are several other formats that start with an integer.
> 
> So the documentation is technically not incorrect, but what it does not say 
> is that if you do not specify the format using "xyz::" as a prefix to the 
> file name in the LOAD command, then Jmol will not recognize your file as 
> "XYZ" format. 
> 
> So no need to change your files unless you need to drag-drop them into Jmol 
> or JSmol. If you are using the LOAD command, just do it like this:
> 
> load "xyz::broken.xyz "
> 
> It would not be impossible to add one more check to Jmol's  resolver to allow 
> for this. But that would introduce a whole new problem of "false positives," 
> and it probably would be better to align the documentation with what is 
> standard and indicated at https://en.wikipedia.org/wiki/XYZ_file_format 
>  rather than allowing that 
> resolution.
> 
> Bob
> 
> 
> 
> 
> 
> On Mon, Sep 26, 2016 at 5:46 AM, Peter Brommer  > wrote:
> Hi,
> 
> This concerns Jmol Version: 14.6.1_2016.08.11  2016-08-11 22:11.
> 
> There is an issue with reading/recognising xyz files. On the wiki page 
> http://wiki.jmol.org/index.php/File_formats/Formats/XYZ 
>  those are described 
> as having two header lines per step in a multi-step format, the first of 
> which states "the number of atoms in that step. This integer may be preceded 
> by whitespace; anything on the line after the integer is ignored.”
> 
> However, if there is anything after the integer, the xyz file is no longer 
> recognised and the load command gives up with “script ERROR: unrecognised 
> file format for file broken.xyz ". I attach two files 
> which only differ by a supposedly ignored character after the number of 
> atoms, and both fulfil the standard given in the wiki.
> 
> So, at the moment there is a discord between documentation and code. I’d 
> prefer this was fixed in the code, so I don’t have to change a bunch of xyz 
> files.
> 
> Cheers,
> 
> Peter
> 
> --
> Peter Brommer
> 
> 
> --
> 
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/jmol-users 
> 
> 
> 
> 
> 
> -- 
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr 
> 
> 
> If nature does not answer first what we want,
> it is better to take what answer we get. 
> 
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> 
> --
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/jmol-users 
> 
-- 
Dr Peter Brommer
Assistant Professor  |  Warwick Centre for Predictive Modelling  |  School of 
Engineering  |  University of Warwick
pbrom...@warwick.ac.uk  |  www.warwick.ac.uk/pbrommer  |  External: +44 (0) 24 
7652 8613  |  Internal: 28613  

D2.08  |  School of Engineering  | Library Road | Coventry  |  CV4 7AL  |  
United Kingdom

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Potential bug in reading xyz files

2016-09-26 Thread Robert Hanson
No changes ever.

On Mon, Sep 26, 2016 at 9:08 AM, Angel Herráez  wrote:

>
> OK, I will ammend the wiki to clarify the issue.
>
> But, important: Peter, has this behaviour changed across Jmol versions?
> It is one thing that Jmol identifies or not the format, as Bob has
> explained; it
> is another if there has been a change in behaviour.
>
> Thanks
>
>
> 
> --
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Potential bug in reading xyz files

2016-09-26 Thread Angel Herráez

OK, I will ammend the wiki to clarify the issue.

But, important: Peter, has this behaviour changed across Jmol versions?
It is one thing that Jmol identifies or not the format, as Bob has explained; 
it 
is another if there has been a change in behaviour.

Thanks


--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Potential bug in reading xyz files

2016-09-26 Thread Kubasik, Matthew A.
Peter,

On my editor, your “broken” file has an additional text (the letter “a’) on the 
first line.

Could that be the problem?

Matt Kubasik

On Sep 26, 2016, at 6:46 AM, Peter Brommer 
> wrote:

Hi,

This concerns Jmol Version: 14.6.1_2016.08.11  2016-08-11 22:11.

There is an issue with reading/recognising xyz files. On the wiki page 
http://wiki.jmol.org/index.php/File_formats/Formats/XYZ those are described as 
having two header lines per step in a multi-step format, the first of which 
states "the number of atoms in that step. This integer may be preceded by 
whitespace; anything on the line after the integer is ignored.”

However, if there is anything after the integer, the xyz file is no longer 
recognised and the load command gives up with “script ERROR: unrecognised file 
format for file broken.xyz". I attach two files which only differ by a 
supposedly ignored character after the number of atoms, and both fulfil the 
standard given in the wiki.

So, at the moment there is a discord between documentation and code. I’d prefer 
this was fixed in the code, so I don’t have to change a bunch of xyz files.

Cheers,

Peter

--
Peter Brommer

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Potential bug in reading xyz files

2016-09-26 Thread Robert Hanson
The *xyz reader *ignores everything else on the first line after the
integer.

The *reader format resolver *is what requires just an integer (the number
of atoms) and white space on the first line in order to send the data to
the xyz reader, because there are several other formats that start with an
integer.

So the documentation is technically not incorrect, but what it does not say
is that if you do not specify the format using "xyz::" as a prefix to the
file name in the LOAD command, then Jmol will not recognize your file as
"XYZ" format.

So no need to change your files unless you need to drag-drop them into Jmol
or JSmol. If you are using the LOAD command, just do it like this:

load "xyz::broken.xyz"

It would not be impossible to add one more check to Jmol's  resolver to
allow for this. But that would introduce a whole new problem of "false
positives," and it probably would be better to align the documentation with
what is standard and indicated at
https://en.wikipedia.org/wiki/XYZ_file_format rather than allowing that
resolution.

Bob





On Mon, Sep 26, 2016 at 5:46 AM, Peter Brommer 
wrote:

> Hi,
>
> This concerns Jmol Version: 14.6.1_2016.08.11  2016-08-11 22:11.
>
> There is an issue with reading/recognising xyz files. On the wiki page
> http://wiki.jmol.org/index.php/File_formats/Formats/XYZ those are
> described as having two header lines per step in a multi-step format, the
> first of which states "the number of atoms in that step. This integer may
> be preceded by whitespace; anything on the line after the integer is
> ignored.”
>
> However, if there is anything after the integer, the xyz file is no longer
> recognised and the load command gives up with “script ERROR: unrecognised
> file format for file broken.xyz". I attach two files which only differ by
> a supposedly ignored character after the number of atoms, and both fulfil
> the standard given in the wiki.
>
> So, at the moment there is a discord between documentation and code. I’d
> prefer this was fixed in the code, so I don’t have to change a bunch of xyz
> files.
>
> Cheers,
>
> Peter
>
> --
> Peter Brommer
>
>
> 
> --
>
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users