<commit_before>/*
 * Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata
 * See LICENSE for license information.
 */
package ucar.nc2.iosp.nids;

import junit.framework.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.ma2.Array;
import ucar.ma2.ArrayStructure;
import ucar.ma2.StructureData;
import ucar.nc2.*;
import ucar.unidata.util.test.TestDir;
import java.io.*;
import java.lang.invoke.MethodHandles;

public class TestNids extends TestCase {
  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

  private static String basereflectFile = TestDir.localTestDataDir + "nids/N0R_20041119_2147";
  private static String basereflect1File = TestDir.localTestDataDir + "nids/N1R_20050119_1548";
  private static String basereflect2File = TestDir.localTestDataDir + "nids/N2R_20050119_1528";
  private static String basereflect3File = TestDir.localTestDataDir + "nids/N3R_20050119_1548";
  private static String basereflectCFile = TestDir.localTestDataDir + "nids/NCR_20050119_1548";
  private static String basereflect248File = TestDir.localTestDataDir + "nids/N0Z_20050119_1538";
  private static String radialVelocityFile = TestDir.localTestDataDir + "nids/N0V_20041117_1646";
  private static String radialVelocity1File = TestDir.localTestDataDir + "nids/N1V_20050119_1548";
  private static String echotopFile = TestDir.localTestDataDir + "nids/NET_20041123_1648";
  private static String oneHourPrecipFile = TestDir.localTestDataDir + "nids/N1P_20041122_1837";
  private static String StormRelMeanVel0File = TestDir.localTestDataDir + "nids/N0S_20050119_1548";
  private static String StormRelMeanVel1File = TestDir.localTestDataDir + "nids/N1S_20041117_1640";
  private static String StormRelMeanVel2File = TestDir.localTestDataDir + "nids/N2S_20050120_1806";
  private static String StormRelMeanVel3File = TestDir.localTestDataDir + "nids/N3S_20050120_1806";
  private static String totalPrecipFile = TestDir.localTestDataDir + "nids/NTP_20050119_1528";
  private static String digitPrecipArrayFile = TestDir.localTestDataDir + "nids/DPA_20041123_1709";
  private static String vertIntegLiquidFile = TestDir.localTestDataDir + "nids/NVL_20041130_1946";
  private static String vadWindProfileFile = TestDir.localTestDataDir + "nids/NVW_20041117_1657";

  public void testNidsReadRadial() throws IOException {
    NetcdfFile ncfile = null;
    try {
      System.out.println("**** Open " + basereflectFile);
      ncfile = NetcdfFile.open(basereflectFile);

    } catch (java.io.IOException e) {
      System.out.println(" fail = " + e);
      e.printStackTrace();
      assert (false);
    }

    Variable v = null;
    v = ncfile.findVariable("BaseReflectivity");
    testReadData(v);
    assert (null != v.getDimension(0));
    assert (null != v.getDimension(1));

    ncfile.close();
    try {
      System.out.println("**** Open " + basereflect1File);
      ncfile = NetcdfFile.open(basereflect1File);

    } catch (java.io.IOException e) {
      System.out.println(" fail = " + e);
      e.printStackTrace();
      assert (false);
    }
    v = ncfile.findVariable("BaseReflectivity");
    testReadData(v);
    assert (null != v.getDimension(0));<commit_msg>fix tests<commit_after>/*
 * Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata
 * See LICENSE for license information.
 */
package ucar.nc2.iosp.nids;

import junit.framework.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.ma2.Array;
import ucar.ma2.ArrayStructure;
import ucar.ma2.StructureData;
import ucar.nc2.*;
import ucar.unidata.util.test.TestDir;
import java.io.*;
import java.lang.invoke.MethodHandles;

public class TestNids extends TestCase {
  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

  private static String basereflectFile = TestDir.localTestDataDir + "nids/N0R_20041119_2147";
  private static String basereflect1File = TestDir.localTestDataDir + "nids/N1R_20050119_1548";
  private static String basereflect2File = TestDir.localTestDataDir + "nids/N2R_20050119_1528";
  private static String basereflect3File = TestDir.localTestDataDir + "nids/N3R_20050119_1548";
  private static String basereflectCFile = TestDir.localTestDataDir + "nids/NCR_20050119_1548";
  private static String basereflect248File = TestDir.localTestDataDir + "nids/N0Z_20050119_1538";
  private static String radialVelocityFile = TestDir.localTestDataDir + "nids/N0V_20041117_1646";
  private static String radialVelocity1File = TestDir.localTestDataDir + "nids/N1V_20050119_1548";
  private static String echotopFile = TestDir.localTestDataDir + "nids/NET_20041123_1648";
  private static String oneHourPrecipFile = TestDir.localTestDataDir + "nids/N1P_20041122_1837";
  private static String StormRelMeanVel0File = TestDir.localTestDataDir + "nids/N0S_20050119_1548";
  private static String StormRelMeanVel1File = TestDir.localTestDataDir + "nids/N1S_20041117_1640";
  private static String StormRelMeanVel2File = TestDir.localTestDataDir + "nids/N2S_20050120_1806";
  private static String StormRelMeanVel3File = TestDir.localTestDataDir + "nids/N3S_20050120_1806";
  private static String totalPrecipFile = TestDir.localTestDataDir + "nids/NTP_20050119_1528";
  private static String digitPrecipArrayFile = TestDir.localTestDataDir + "nids/DPA_20041123_1709";
  private static String vertIntegLiquidFile = TestDir.localTestDataDir + "nids/NVL_20041130_1946";
  private static String vadWindProfileFile = TestDir.localTestDataDir + "nids/NVW_20041117_1657";

  public void testNidsReadRadial() throws IOException {
    File cwd = new File(".");
    System.out.printf("**** CWD = %s%n", cwd.getAbsolutePath());

    File f = new File(basereflectFile);
    System.out.printf("**** %s = %s%n", f.getAbsolutePath(), f.exists());

    NetcdfFile ncfile = null;
    try {
      System.out.println("**** Open " + basereflectFile);
      ncfile = NetcdfFile.open(basereflectFile);

    } catch (java.io.IOException e) {
      System.out.println(" fail = " + e);
      e.printStackTrace();
      assert (false);
    }

    Variable v = null;
    v = ncfile.findVariable("BaseReflectivity");
    testReadData(v);
    assert (null != v.getDimension(0));
    assert (null != v.getDimension(1));

    ncfile.close();
    try {
      System.out.println("**** Open " + basereflect1File);
      ncfile = NetcdfFile.open(basereflect1File);

    } catch (java.io.IOException e) {
      System.out.println(" fail = " + e);
      e.printStackTrace();
      assert (false);
    }
    v = ncfile.findVariable("BaseReflectivity");
    testReadData(v);
    assert (null != v.getDimension(0));
{'fraction_non_alphanumeric': 0.10529437935636957, 'fraction_numerical': 0.07682040634732315, 'mean_word_length': 4.900262467191601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2978293', 'n_tokens_mistral': 2589, 'n_tokens_neox': 2234, 'n_words': 441}