Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
Hailey Johnson committed Mar 12, 2024
1 parent a86c29b commit 748fc83
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cdm/core/src/test/java/ucar/nc2/filter/TestEnhancements.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ public static void setUp() throws IOException, InvalidRangeException {
// short data with small scale and offsets
Array smallVals = Array.factory(DataType.FLOAT, new int[] {dataLen}, missingData);

builder.addVariable("smallVals", DataType.FLOAT, "dim")
.addAttribute(new Attribute(CDM.SCALE_FACTOR, 1e-12)).addAttribute(new Attribute(CDM.ADD_OFFSET, 1e-12))
.addAttribute(new Attribute(CDM.FILL_VALUE, 110));
builder.addVariable("smallVals", DataType.FLOAT, "dim").addAttribute(new Attribute(CDM.SCALE_FACTOR, 1e-12))
.addAttribute(new Attribute(CDM.ADD_OFFSET, 1e-12)).addAttribute(new Attribute(CDM.FILL_VALUE, 110));


// write data
Expand Down Expand Up @@ -162,11 +161,12 @@ public void testCombinedEnhancements() throws IOException {
Array data = v.read();
assertThat((double[]) data.copyTo1DJavaArray()).isEqualTo(expected);
}

@Test
public void testConvertMissingWithSmallScaleAndOffset() throws IOException {
Variable v = ncd.findVariable("smallVals");
Array data = v.read();
assertThat(Double.isNaN(data.getDouble(2))).isTrue();
assertThat(Double.isNaN(data.getDouble(1))).isFalse();
Variable v = ncd.findVariable("smallVals");
Array data = v.read();
assertThat(Double.isNaN(data.getDouble(2))).isTrue();
assertThat(Double.isNaN(data.getDouble(1))).isFalse();
}
}

0 comments on commit 748fc83

Please sign in to comment.