Skip to content

Commit

Permalink
Resolved conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
kvb2univpitt committed Dec 11, 2022
2 parents 8cefd71 + 75d8525 commit 5f1fce0
Show file tree
Hide file tree
Showing 20 changed files with 266 additions and 215 deletions.
17 changes: 8 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>causal-cmd</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<packaging>jar</packaging>

<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand Down Expand Up @@ -46,7 +45,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -60,7 +59,7 @@
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<executions>
<execution>
<id>copy-dist-resources</id>
Expand All @@ -83,7 +82,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
Expand All @@ -95,7 +94,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.2</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -134,7 +133,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<configuration>
<javadocExecutable>/usr/bin/javadoc</javadocExecutable>
<!--<show>private</show>-->
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/edu/pitt/dbmi/causal/cmd/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static String[] removeLongOption(String[] args, String option) {
}
}

return argsToKeep.toArray(String[]::new);
return argsToKeep.stream().toArray(String[]::new);
}

/**
Expand Down Expand Up @@ -143,7 +143,7 @@ public static String[] extractLongOptions(String[] args, Options options) {
}
});

return argsList.toArray(String[]::new);
return argsList.stream().toArray(String[]::new);
}

/**
Expand Down Expand Up @@ -179,7 +179,7 @@ public static String[] extractOptions(String[] args, Options options) {
}
});

return argsList.toArray(String[]::new);
return argsList.stream().toArray(String[]::new);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private static void runTetrad(CmdArgs cmdArgs) throws AlgorithmRunException, Val
Files.deleteIfExists(outTxtFile);
}

try ( PrintStream out = new PrintStream(new BufferedOutputStream(Files.newOutputStream(outTxtFile, StandardOpenOption.CREATE)), true)) {
try (PrintStream out = new PrintStream(new BufferedOutputStream(Files.newOutputStream(outTxtFile, StandardOpenOption.CREATE)), true)) {
writeOutParameters(cmdArgs, out);

if (!cmdArgs.isSkipValidation()) {
Expand Down Expand Up @@ -166,7 +166,7 @@ private static void runTetrad(CmdArgs cmdArgs) throws AlgorithmRunException, Val

Path outGraphFile = Paths.get(outDir, fileName);
if (Files.exists(outGraphFile)) {
Files.deleteIfExists(outTxtFile);
Files.deleteIfExists(outGraphFile);
}

GraphIO.writeAsJSON(graphs[i], outGraphFile);
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/edu/pitt/dbmi/causal/cmd/CmdArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class CmdArgs {
* by the data reader.
*/
protected String commentMarker;

/**
* Indicates whether the first line in the data file is a header.
*/
Expand All @@ -89,7 +89,7 @@ public class CmdArgs {
* Type of data in the dataset.
*/
protected DataType dataType;

/**
* Data delimiter.
*/
Expand All @@ -99,12 +99,12 @@ public class CmdArgs {
* Algorithm class.
*/
protected Class algorithmClass;

/**
* Score class.
*/
protected Class scoreClass;

/**
* Independence test class.
*/
Expand All @@ -119,14 +119,15 @@ public class CmdArgs {
* Indicates whether or not to skip data validation.
*/
protected boolean skipValidation;

/**
* Indicates whether to output the search graph in JSON format.
*/
protected boolean jsonGraph;

/**
* Maximum number of threads can be used by algorithm, score, or independence test.
* Maximum number of threads can be used by algorithm, score, or
* independence test.
*/
protected int numOfThreads;

Expand Down
19 changes: 9 additions & 10 deletions src/main/java/edu/pitt/dbmi/causal/cmd/CmdOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private CmdOptions() {
/**
* Get an instance of the command-line options.
*
* @return
* @return CmdOptions instance
*/
public static CmdOptions getInstance() {
if (instance == null) {
Expand All @@ -75,7 +75,7 @@ public static void clear() {
* Get multi-character name options for a given name..
*
* @param param multi-character name
* @return
* @return command-line option
*/
public Option getLongOption(String param) {
return options.get(param);
Expand Down Expand Up @@ -165,12 +165,11 @@ public List<Option> getBaseOptions() {
opts.add(options.get(CmdParams.DIR_OUT));

// opts.add(options.get(CmdParams.THREAD));

// data validation options
opts.add(options.get(CmdParams.SKIP_VALIDATION));

opts.add(options.get(CmdParams.EXPERIMENTAL));

opts.add(options.get(CmdParams.DEFAULT));

return opts;
Expand Down Expand Up @@ -250,7 +249,7 @@ private void addRequiredOptions() {
/**
* Get the application required options from the stored options.
*
* @return
* @return required command-line options
*/
public List<Option> getRequiredOptions() {
return options.entrySet().stream()
Expand All @@ -262,7 +261,7 @@ public List<Option> getRequiredOptions() {
/**
* Get the names of all the datatypes.
*
* @return
* @return datatype description
*/
private String getDataTypeDesc() {
return "Data type: " + DataTypes.getInstance().getNames().stream()
Expand All @@ -272,7 +271,7 @@ private String getDataTypeDesc() {
/**
* Get the names of all the delimiters.
*
* @return
* @return names of delimiters
*/
private String getDelimiterDesc() {
return "Delimiter: " + Delimiters.getInstance().getNames().stream()
Expand All @@ -282,7 +281,7 @@ private String getDelimiterDesc() {
/**
* Get the names of all the scores.
*
* @return
* @return description for score
*/
private String getScoreDesc() {
return "Score: " + TetradScores.getInstance().getCommands().stream()
Expand All @@ -292,7 +291,7 @@ private String getScoreDesc() {
/**
* Get the names of all the independence test.
*
* @return
* @return description for test of independence
*/
private String getIndependenceTestDesc() {
return "Independence Test: " + TetradIndependenceTests.getInstance().getCommands().stream()
Expand All @@ -302,7 +301,7 @@ private String getIndependenceTestDesc() {
/**
* Get the names of all the algorithms.
*
* @return
* @return description for algorithm
*/
private String getAlgorithmDesc() {
return "Algorithm: " + TetradAlgorithms.getInstance().getCommands().stream()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/pitt/dbmi/causal/cmd/CmdParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final class CmdParams {
public static final String EXTRACT_STRUCT_MODEL = "extract-struct-model";

public static final String EXPERIMENTAL = "experimental";

public static final String DEFAULT = "default";

private CmdParams() {
Expand Down
Loading

0 comments on commit 5f1fce0

Please sign in to comment.