Skip to content

Commit

Permalink
Util 4.1.0 (#18)
Browse files Browse the repository at this point in the history
* Addded array indexers

* move test resource helper

* Added default serialVersionUID to IOExceptionFile

* Added tuple generator to ms-util

* Bump the standard-plugins group with 3 updates (#11)

Bumps the standard-plugins group with 3 updates: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire), [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) and [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin).


Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.0.0-M5 to 3.2.5
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.0.0-M5...surefire-3.2.5)

Updates `org.apache.maven.plugins:maven-source-plugin` from 3.2.1 to 3.3.0
- [Commits](apache/maven-source-plugin@maven-source-plugin-3.2.1...maven-source-plugin-3.3.0)

Updates `org.apache.maven.plugins:maven-javadoc-plugin` from 3.5.0 to 3.6.3
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](apache/maven-javadoc-plugin@maven-javadoc-plugin-3.5.0...maven-javadoc-plugin-3.6.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: standard-plugins
- dependency-name: org.apache.maven.plugins:maven-source-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: standard-plugins
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: standard-plugins
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump the test-dependencies group with 3 updates (#12)

Bumps the test-dependencies group with 3 updates: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5), [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) and [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco).


Updates `org.junit.jupiter:junit-jupiter-engine` from 5.8.2 to 5.10.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.8.2...r5.10.1)

Updates `org.junit.jupiter:junit-jupiter-api` from 5.8.2 to 5.10.1
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.8.2...r5.10.1)

Updates `org.jacoco:jacoco-maven-plugin` from 0.8.9 to 0.8.11
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.9...v0.8.11)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: test-dependencies
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: test-dependencies
- dependency-name: org.jacoco:jacoco-maven-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: test-dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor package structure (#13)

* move path validator (#14)

* update workflows

* update workflows

* test-commit

* Update dev_build.yml

* Update pr_build.yml

* update workflow

* update workflows

* add text table reader (#17)

* Bump the test-dependencies group with 2 updates (#16)

Bumps the test-dependencies group with 2 updates: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) and [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5).


Updates `org.junit.jupiter:junit-jupiter-engine` from 5.10.1 to 5.10.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.10.1...r5.10.2)

Updates `org.junit.jupiter:junit-jupiter-api` from 5.10.1 to 5.10.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.10.1...r5.10.2)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: test-dependencies
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: test-dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pom.xml

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: shawnhatch <[email protected]>
Co-authored-by: shawnhatch <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
4 people committed Feb 20, 2024
1 parent 7d1b1fe commit 839be6d
Show file tree
Hide file tree
Showing 154 changed files with 1,908 additions and 435 deletions.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<!-- Artifact -->
<groupId>gov.hhs.aspr.ms</groupId>
<artifactId>util</artifactId>
<version>4.0.0</version>
<packaging>jar</packaging>
<version>4.1.0</version>
<packaging>jar</packaging>

<name>Modeling Utils</name>
<description>A suite of utility methods that are useful for simulation frameworks.</description>
Expand Down Expand Up @@ -53,15 +53,15 @@
<maven.compiler.target>17</maven.compiler.target>

<!-- plugin versions -->
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>

<!-- dependency versions-->
<commons-math3.version>3.6.1</commons-math3.version>
<jcip-annotations.version>1.0</jcip-annotations.version>
<junit-jupiter-engine.version>5.8.2</junit-jupiter-engine.version>
<jacoco-maven-plugin.version>0.8.9</jacoco-maven-plugin.version>
<junit-jupiter-engine.version>5.10.2</junit-jupiter-engine.version>
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
</properties>

<!-- Dependencies -->
Expand Down Expand Up @@ -215,4 +215,4 @@
</profile>
</profiles>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.annotations;
package gov.hhs.aspr.ms.util.annotations;

public enum UnitTag {
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.annotations;
package gov.hhs.aspr.ms.util.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.annotations;
package gov.hhs.aspr.ms.util.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.annotations;
package gov.hhs.aspr.ms.util.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.annotations;
package gov.hhs.aspr.ms.util.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package gov.hhs.aspr.ms.util.combinatorics;

import java.util.ArrayList;
import java.util.List;

/**
* Utility class for generating tuples from a fixed set of finite ranges of the
* form [0,n). Uses a standard builder pattern for construction.
*/
public final class TupleGenerator {
private final int[] moduli;
private final int[] dimensions;
private final int size;

private TupleGenerator(List<Integer> dimensionSizes) {
dimensions = new int[dimensionSizes.size()];
moduli = new int[dimensionSizes.size()];

int count = 1;
for (int i = 0; i < dimensionSizes.size(); i++) {
int dimSize = dimensionSizes.get(i);
dimensions[i] = dimSize;
moduli[i] = count;
count *= dimSize;
}
size = count;
}

/**
* Returns the number of dimensions in this {@link TupleGenerator}.
*/
public int dimensions() {
return dimensions.length;
}

/**
* Returns the number of tuples that can be generated by this {@link TupleGenerator}
*/
public int size() {
return size;
}

/**
* Fills the given tuple with the values that correspond to the given index.
*
* @throws IndexOutOfBoundsException
* <ul>
* <li>if index &lt; 0</li>
* <li>if index &gt;= size()</li>
* </ul>
* @throws IllegalArgumentException
* <ul>
* <li>if the tuple is null</li>
* <li>if the tuple's length is not equal to
* dimensions()</li>
* </ul>
*/
public void fillTuple(int index, int[] tuple) {
if ((index < 0) || (index >= size)) {
throw new IndexOutOfBoundsException("index out of bounds");
}

if (tuple == null) {
throw new IllegalArgumentException("null array");
}

if (tuple.length != dimensions.length) {
throw new IllegalArgumentException("wrong number of dimensions");
}

for (int i = 0; i < dimensions.length; i++) {
tuple[i] = (index / moduli[i]) % dimensions[i];
}
}

public static Builder builder() {
return new Builder();
}

public static class Builder {
private List<Integer> dimensionSizes = new ArrayList<>();

private Builder() {
}

public TupleGenerator build() {
return new TupleGenerator(dimensionSizes);
}

public Builder addDimension(int dimensionSize) {
if (dimensionSize <= 0) {
throw new IllegalArgumentException("Non positive dimension size");
}
dimensionSizes.add(dimensionSize);
return this;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.delaunay;
package gov.hhs.aspr.ms.util.delaunay;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -10,10 +10,10 @@
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.Pair;

import util.dimensiontree.VolumetricDimensionTree;
import util.earth.LatLon;
import util.vector.MutableVector3D;
import util.vector.Vector3D;
import gov.hhs.aspr.ms.util.dimensiontree.VolumetricDimensionTree;
import gov.hhs.aspr.ms.util.earth.LatLon;
import gov.hhs.aspr.ms.util.vector.MutableVector3D;
import gov.hhs.aspr.ms.util.vector.Vector3D;

public class GeoDelaunaySolver<T> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.delaunay;
package gov.hhs.aspr.ms.util.delaunay;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -10,10 +10,10 @@
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.Pair;

import util.dimensiontree.VolumetricDimensionTree;
import util.spherical.Chirality;
import util.vector.MutableVector2D;
import util.vector.Vector2D;
import gov.hhs.aspr.ms.util.dimensiontree.VolumetricDimensionTree;
import gov.hhs.aspr.ms.util.spherical.Chirality;
import gov.hhs.aspr.ms.util.vector.MutableVector2D;
import gov.hhs.aspr.ms.util.vector.Vector2D;

public class PlanarDelaunaySolver<T> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.dimensiontree;
package gov.hhs.aspr.ms.util.dimensiontree;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -9,7 +9,7 @@

import org.apache.commons.math3.util.FastMath;

import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package util.dimensiontree;
package gov.hhs.aspr.ms.util.dimensiontree;

import util.errors.ContractError;
import util.errors.ContractException;
import gov.hhs.aspr.ms.util.errors.ContractError;
import gov.hhs.aspr.ms.util.errors.ContractException;

/**
* An enumeration supporting {@link ContractException} that acts as a general
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.dimensiontree;
package gov.hhs.aspr.ms.util.dimensiontree;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package util.earth;
package gov.hhs.aspr.ms.util.earth;

import org.apache.commons.math3.util.FastMath;

import util.vector.Vector3D;
import gov.hhs.aspr.ms.util.vector.Vector3D;

/**
* A spherical geo-model for converting various coordinate representations and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package util.earth;
package gov.hhs.aspr.ms.util.earth;

import org.apache.commons.math3.util.FastMath;

import util.vector.MutableVector3D;
import util.vector.Vector2D;
import util.vector.Vector3D;
import gov.hhs.aspr.ms.util.vector.MutableVector3D;
import gov.hhs.aspr.ms.util.vector.Vector2D;
import gov.hhs.aspr.ms.util.vector.Vector3D;

/**
* A utility class for converting (x,y) two dimensional grid coordinates to and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.earth;
package gov.hhs.aspr.ms.util.earth;

import net.jcip.annotations.Immutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package util.earth;
package gov.hhs.aspr.ms.util.earth;

import util.vector.Vector3D;
import gov.hhs.aspr.ms.util.vector.Vector3D;

public class LatLonAlt {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package util.errors;
package gov.hhs.aspr.ms.util.errors;

/**
* Marker interface for the descriptions of runtime exceptions where the source
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.errors;
package gov.hhs.aspr.ms.util.errors;

/**
* A {@link RuntimeException} that indicates that the cause of the error as a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.geolocator;
package gov.hhs.aspr.ms.util.geolocator;

import java.util.ArrayList;
import java.util.Comparator;
Expand All @@ -9,11 +9,11 @@
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.Pair;

import util.dimensiontree.DimensionTree;
import util.earth.Earth;
import util.earth.LatLonAlt;
import util.vector.Vector2D;
import util.vector.Vector3D;
import gov.hhs.aspr.ms.util.dimensiontree.DimensionTree;
import gov.hhs.aspr.ms.util.earth.Earth;
import gov.hhs.aspr.ms.util.earth.LatLonAlt;
import gov.hhs.aspr.ms.util.vector.Vector2D;
import gov.hhs.aspr.ms.util.vector.Vector3D;

/**
* A generics-based utility class for managing point locations on a spherical
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.graph;
package gov.hhs.aspr.ms.util.graph;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.graph;
package gov.hhs.aspr.ms.util.graph;

import java.util.ArrayList;
import java.util.LinkedHashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.graph;
package gov.hhs.aspr.ms.util.graph;

import java.util.ArrayList;
import java.util.LinkedHashMap;
Expand All @@ -9,8 +9,8 @@
import java.util.Optional;
import java.util.Set;

import util.path.Path;
import util.path.Paths;
import gov.hhs.aspr.ms.util.path.Path;
import gov.hhs.aspr.ms.util.path.Paths;

public final class Graphs {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util.graph;
package gov.hhs.aspr.ms.util.graph;

import java.util.ArrayList;
import java.util.LinkedHashMap;
Expand Down
Loading

0 comments on commit 839be6d

Please sign in to comment.