Skip to content

Commit b12293e

Browse files
authored
Merge pull request #1582 from lesserwhirls/gh-1581
xpublish DAP2 implementation compatibility
2 parents db89fdd + ff55b74 commit b12293e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

opendap/src/main/java/ucar/nc2/dods/DODSAttribute.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ public DODSAttribute(String dodsName, opendap.dap.Attribute att) {
7575
data = Array.factory(ncType, new int[] {nvals});
7676
Index ima = data.getIndex();
7777
for (int i = 0; i < nvals; i++) {
78-
double dval = Double.parseDouble(vals[i]);
78+
double dval;
79+
try {
80+
dval = Double.parseDouble(vals[i]);
81+
} catch (NumberFormatException e) {
82+
// could be a python, rust (perhaps others) based server, in which case the string representation of NaN is
83+
// nan
84+
dval = Double.parseDouble(vals[i].replace("nan", "NaN"));
85+
}
7986
data.setDouble(ima.set(i), dval);
8087
}
8188
} catch (NumberFormatException e) {

0 commit comments

Comments
 (0)