[HepData-svn] r1934 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Mar 21 11:22:29 GMT 2016


Author: watt
Date: Mon Mar 21 11:22:28 2016
New Revision: 1934

Log:
YAML formatter: don't write low/high/focus of independent variable if description exists

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java	Fri Mar 18 15:01:01 2016	(r1933)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java	Mon Mar 21 11:22:28 2016	(r1934)
@@ -595,7 +595,7 @@
 		double mean = (bin.getLowValue() + bin.getHighValue()) / 2.0;
 		if((Math.abs(diff/mean) > 1E-6) || (mean == 0.0 && Math.abs(diff) > 1E-6)){ haswidth = true;}
 	    }
-	    if(bin.getRelation() != null && bin.getRelation() != Relation.EQUALS ) { 
+	    if(bin.getRelation() != null && bin.getRelation() != Relation.EQUALS && bin.getDescription() == null) { 
 		if(!first) { s.append(", "); } 
 		s.append("value: '"+bin.getRelation()+" ");
 		if (bin.getLowValue() != null) {
@@ -606,7 +606,7 @@
 		s.append("'");
 		first=false; 
 	    }
-	    else if(bin.getFocus() != null) {
+	    else if(bin.getFocus() != null && bin.getDescription() == null) {
 		if(asymmfocus || !haswidth) { 
 		    if(!first) {s.append(", "); } 
 		    if(bin.getFocusLength()!=null) { 
@@ -617,7 +617,7 @@
 		    first=false; 
 		}
 	    }
-	    if(bin.getLowValue() != null && haswidth) {
+	    if(bin.getLowValue() != null && haswidth && bin.getDescription() == null) {
 		if(!first) { s.append(", "); } 
 		if(bin.getLowValueLength()!=null) { 
 		    s.append("low: "+forms(bin.getLowValue(),bin.getLowValueLength())); 
@@ -626,7 +626,7 @@
 		}
 		first=false; 
 	    }
-	    if(bin.getHighValue() != null && haswidth) {
+	    if(bin.getHighValue() != null && haswidth && bin.getDescription() == null) {
 		if(!first) {s.append(", "); } 
 		if(bin.getHighValueLength()!=null) { 
 		    s.append("high: "+forms(bin.getHighValue(),bin.getHighValueLength())); 


More information about the HepData-svn mailing list