-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added non RNG parameters for TOML parameters files
- Loading branch information
Showing
17 changed files
with
173 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
api/src/main/java/org/fairdatapipeline/parameters/BoolList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.fairdatapipeline.parameters; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import java.util.List; | ||
import org.immutables.value.Value.Immutable; | ||
|
||
@Immutable | ||
@JsonSerialize | ||
@JsonDeserialize | ||
public interface BoolList extends Component { | ||
List<Boolean> bools(); | ||
|
||
@JsonIgnore | ||
default List<Boolean> getBools() { | ||
return bools(); | ||
} | ||
} |
8 changes: 1 addition & 7 deletions
8
api/src/main/java/org/fairdatapipeline/parameters/Component.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
package org.fairdatapipeline.parameters; | ||
|
||
import org.apache.commons.math3.random.RandomGenerator; | ||
import org.immutables.value.Value.Auxiliary; | ||
|
||
public interface Component extends ReadComponent, WriteComponent { | ||
@Auxiliary | ||
RandomGenerator rng(); | ||
} | ||
public interface Component extends ReadComponent, WriteComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 1 addition & 10 deletions
11
api/src/main/java/org/fairdatapipeline/parameters/ReadComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
package org.fairdatapipeline.parameters; | ||
|
||
import java.util.List; | ||
import org.fairdatapipeline.distribution.Distribution; | ||
|
||
public interface ReadComponent { | ||
Number getEstimate(); | ||
|
||
List<Number> getSamples(); | ||
|
||
Distribution getDistribution(); | ||
} | ||
public interface ReadComponent {} |
17 changes: 17 additions & 0 deletions
17
api/src/main/java/org/fairdatapipeline/parameters/RngComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.fairdatapipeline.parameters; | ||
|
||
import java.util.List; | ||
import org.apache.commons.math3.random.RandomGenerator; | ||
import org.fairdatapipeline.distribution.Distribution; | ||
import org.immutables.value.Value; | ||
|
||
public interface RngComponent extends Component { | ||
@Value.Auxiliary | ||
RandomGenerator rng(); | ||
|
||
Number getEstimate(); | ||
|
||
List<Number> getSamples(); | ||
|
||
Distribution getDistribution(); | ||
} |
19 changes: 19 additions & 0 deletions
19
api/src/main/java/org/fairdatapipeline/parameters/StringList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.fairdatapipeline.parameters; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import java.util.List; | ||
import org.immutables.value.Value.Immutable; | ||
|
||
@Immutable | ||
@JsonSerialize | ||
@JsonDeserialize | ||
public interface StringList extends Component { | ||
List<String> strings(); | ||
|
||
@JsonIgnore | ||
default List<String> getStrings() { | ||
return strings(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
api/src/test/java/org/fairdatapipeline/parameters/BoolListTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.fairdatapipeline.parameters; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class BoolListTest { | ||
@Test | ||
void makeBoolList() { | ||
var boollist = ImmutableBoolList.builder().addBools(true, false, true).build(); | ||
assertThat(boollist.bools()).contains(true, false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.