Package org.eclipse.egit.ui.internal.preferences

Examples of org.eclipse.egit.ui.internal.preferences.ConfigurationEditorComponent$Section


  static int max_size = 1000 * 1000 * 10;
  static Section makeSubset(Variable v) throws InvalidRangeException {
    int[] shape = v.getShape();
    shape[0] = 1;
    Section s = new Section(shape);
    long size = s.computeSize();
    shape[0] = (int) Math.max(1, max_size / size);
    return new Section(shape);
  }
View Full Code Here


    System.out.printf("%s%n", spec);
    assert spec.section.equals(v.getShapeAsSection());

    spec = ParsedSectionSpec.parseVariableSection(ncfile, "temperature(1,0:127:2)");
    System.out.printf("%s%n", spec);
    Section s = new Section("1,0:127:2");
    assert spec.section.equals(s) : spec.section + " != " + s;

    spec = ParsedSectionSpec.parseVariableSection(ncfile, "temperature(:,0:127:2)");
    System.out.printf("%s%n", spec);
    s = new Section("0:63,0:127:2");
    assert spec.section.equals(s) : spec.section + " != " + s;

    ncfile.close();
  }
View Full Code Here

    System.out.printf("%s%n", spec);
    assert spec.section.equals(v2.getShapeAsSection());

    spec = ParsedSectionSpec.parseVariableSection(ncfile, "group\\.name/var\\.name(1,0:0)");
    System.out.printf("%s%n", spec);
    Section s = new Section("1,0");
    assert spec.section.equals(s);

    ncfile.close();
  }
View Full Code Here

    System.out.printf("%s%n", spec);
    assert spec.section.equals(v2.getShapeAsSection());

    spec = ParsedSectionSpec.parseVariableSection(ncfile, "group\\(name/var\\(name(1,0:0)");
    System.out.printf("%s%n", spec);
    Section s = new Section("1,0");
    assert spec.section.equals(s);

    ncfile.close();
  }
View Full Code Here

    super(name);
  }

  public void testFull() throws InvalidRangeException {
    int[] shape = new int[] {123,22,92,12};
    Section section = new Section(shape);
    IndexChunker index = new IndexChunker(shape, section);
    assert index.getTotalNelems() == section.computeSize();
    IndexChunker.Chunk chunk = index.next();
    assert chunk.getNelems() == section.computeSize();
    assert !index.hasNext();
  }
View Full Code Here

  }

  public void testPart() throws InvalidRangeException {
    int[] full = new int[] {2, 10, 20};
    int[] part = new int[] {2, 5, 20};
    Section section = new Section(part);
    IndexChunker index = new IndexChunker(full, section);
    assert index.getTotalNelems() == section.computeSize();
    IndexChunker.Chunk chunk = index.next();
    assert chunk.getNelems() == section.computeSize()/2;
  }
View Full Code Here

    IndexChunker.Chunk chunk = index.next();
    assert chunk.getNelems() == section.computeSize()/2;
  }

  public void testChunkerTiled() throws InvalidRangeException {
    Section dataSection = new Section("0:0, 20:39,  0:1353 ");
    Section wantSection = new Section("0:2, 22:3152,0:1350");
    IndexChunkerTiled index = new IndexChunkerTiled(dataSection, wantSection);
    while(index.hasNext()) {
      Layout.Chunk chunk = index.next();
      System.out.println(" "+chunk);
    }
View Full Code Here

      System.out.println(" "+chunk);
    }
  }

  public void testChunkerTiled2() throws InvalidRangeException {
    Section dataSection = new Section("0:0, 40:59,  0:1353  ");
    Section wantSection = new Section("0:2, 22:3152,0:1350");
    IndexChunkerTiled index = new IndexChunkerTiled(dataSection, wantSection);
    while(index.hasNext()) {
      Layout.Chunk chunk = index.next();
      System.out.println(" "+chunk);
    }
View Full Code Here

    int[] dataShape = A.getShape();
    assert dataShape.length == shape.length;
    for (int i = 0; i < shape.length; i++)
      assert dataShape[i] == shape[i];
    Section all = v.getShapeAsSection();
    System.out.println("  Entire dataset="+all);

    for (int k = 0; k < ntrials; k++) {
      // create a random subset, read and compare
      testOne(v, randomSubset(all, 1), A);
View Full Code Here

      CompareNetcdf.compareData(sdata, Asection);
  }

  private static Section randomSubset(Section all, int stride) throws InvalidRangeException {
    Section s = new Section();
    for (Range r : all.getRanges()) {
      int first = random(r.first(), r.last() / 2);
      int last = random(r.last() / 2, r.last());
      s.appendRange(first, last, stride);
    }
    return s;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.preferences.ConfigurationEditorComponent$Section

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.