cpptraj icon indicating copy to clipboard operation
cpptraj copied to clipboard

Change "DataSet already present" message from Warning to Error

Open hainm opened this issue 5 years ago • 1 comments

Hi, while working on https://github.com/Amber-MD/pytraj/issues/1553, I've realized that cpptraj message is not very clear to me.

parm tz2.parm7
trajin tz2.nc
rms myrms @CA
radgyr myrms @CA nomax

Here is the message:

CPPTRAJ: Trajectory Analysis. V4.30.0 (GitHub)
    ___  ___  ___  ___
     | \/ | \/ | \/ | 
    _|_/\_|_/\_|_/\_|_

| Date/time: 10/11/20 22:11:19
| Available memory: 3.272 GB

INPUT: Reading input from 'c.in'
  [parm tz2.parm7]
	Reading 'tz2.parm7' as Amber Topology
	This Amber topology does not include atomic numbers.
	Assigning elements from atom masses/names.
	No SCEE section: setting Amber default (1.2)
	No SCNB section: setting Amber default (2.0)
  [trajin tz2.nc]
	Reading 'tz2.nc' as Amber NetCDF
  [rms myrms @CA]
    RMSD: (@CA), reference is first frame (@CA).
	Best-fit RMSD will be calculated, coords will be rotated and translated.
  [radgyr myrms @CA nomax]
Warning: DataSet 'myrms' already present.
Error: Could not initialize action [radgyr]
	1 errors encountered reading input.
TIME: Total execution time: 0.0671 seconds.
Error: Error(s) occurred during execution.

What's the reason of Error: Could not initialize action [radgyr]. Is that because of Warning: DataSet 'myrms' already present.. If yes, should the Warning should be Error?

hainm avatar Oct 12 '20 02:10 hainm

What's the reason of Error: Could not initialize action [radgyr]. Is that because of Warning: DataSet 'myrms' already present.

Yes, you can't give 2 data sets the same name.

If yes, should the Warning should be Error?

Probably. I forget originally why I made it a warning. I think I had some half-baked idea to have cpptraj automatically append a number to the set so the calculation could continue, but ultimately decided that violated the principle of least surprise and wasn't worth it. I'll try to fix that this week.

drroe avatar Oct 12 '20 11:10 drroe