Skip to content

Commit

Permalink
Merge pull request #1802 from cmu-phil/joe-work-2024-8-14
Browse files Browse the repository at this point in the history
joe-work-2024-8-14
  • Loading branch information
jdramsey authored Aug 15, 2024
2 parents 37ebfeb + d2abdef commit 2558025
Show file tree
Hide file tree
Showing 36 changed files with 263 additions and 164 deletions.
10 changes: 5 additions & 5 deletions data-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.6.5-SNAPSHOT</version>
<version>7.6.5</version>
</parent>
<!-- <groupId>io.github.cmu-phil</groupId>-->
<artifactId>data-reader</artifactId>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<build>
Expand All @@ -24,8 +24,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
</plugins>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.6.5-SNAPSHOT</version>
<version>7.6.5</version>
<packaging>pom</packaging>

<name>Tetrad Project</name>
Expand Down Expand Up @@ -64,8 +64,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -193,8 +193,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<additionalparam>-Xdoclint:none</additionalparam>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions tetrad-gui/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>tetrad</artifactId>
<groupId>io.github.cmu-phil</groupId>
<version>7.6.5-SNAPSHOT</version>
<version>7.6.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tetrad-gui</artifactId>
Expand Down Expand Up @@ -35,8 +35,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -68,7 +68,7 @@
</plugins>
</build>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
8 changes: 4 additions & 4 deletions tetrad-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.6.5-SNAPSHOT</version>
<version>7.6.5</version>
</parent>

<artifactId>tetrad-gui</artifactId>
Expand All @@ -33,8 +33,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -186,7 +186,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
</properties>

<!--<scm>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,34 +483,32 @@ GraphHistory getGraphHistory() {
}

/**
* <p>getTestType.</p>
*
* @return a {@link edu.cmu.tetradapp.util.IndTestType} object
*/
public IndTestType getTestType() {
return (IndTestType) getAlgorithmRunner().getParams().get("indTestType", IndTestType.FISHER_Z);
}
/**
* {@inheritDoc}
* Sets the test type for the search algorithm.
*
* @param testType The test type to be set.
*/
public void setTestType(IndTestType testType) {
getAlgorithmRunner().getParams().set("indTestType", testType);
}

/**
* <p>getDataModel.</p>
* Retrieves the data model used to execute the algorithm.
*
* @return a {@link edu.cmu.tetrad.data.DataModel} object
* @return the data model used to execute the algorithm, which might possibly be a graph.
*/
public DataModel getDataModel() {
return getAlgorithmRunner().getDataModel();
}

/**
* <p>getSourceGraph.</p>
* Retrieves the source graph used for the search algorithm.
*
* @return a {@link java.lang.Object} object
* @return the source graph used for the search algorithm, or null if not set.
*/
public Object getSourceGraph() {
return getAlgorithmRunner().getParams().get("sourceGraph", null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import edu.cmu.tetrad.graph.Graph;
import edu.cmu.tetrad.graph.LayoutUtil;
import edu.cmu.tetradapp.model.FactorAnalysisRunner;
import edu.cmu.tetradapp.util.IndTestType;
import edu.cmu.tetradapp.workbench.GraphWorkbench;

import javax.swing.*;
Expand Down Expand Up @@ -132,6 +133,16 @@ protected void addSpecialMenus(JMenuBar menuBar) {

}

/**
* This method is called when the user selects "Save As..." from the File menu.
*
* @throws UnsupportedOperationException since this method is not supported by this class.
*/
@Override
public IndTestType getTestType() {
throw new UnsupportedOperationException("Not supported yet.");
}

/**
* <p>getSourceGraph.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
* @version $Id: $Id
*/
public class MissingDataInjectorWrapper extends DataWrapper {
@Serial
private static final long serialVersionUID = 23L;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public class ReplaceMissingWithRandomWrapper extends DataWrapper {
@Serial
private static final long serialVersionUID = 23L;

/**
* @serial Cannot be null.
*/
private final DataSet outputDataSet;

//============================CONSTRUCTORS=============================//

/**
Expand All @@ -59,8 +54,8 @@ public ReplaceMissingWithRandomWrapper(DataWrapper wrapper) {
DataSet dataSet =
(DataSet) wrapper.getSelectedDataModel();

this.outputDataSet = DataTransforms.replaceMissingWithRandom(dataSet);
setDataModel(this.outputDataSet);
DataSet outputDataSet = DataTransforms.replaceMissingWithRandom(dataSet);
setDataModel(outputDataSet);
setSourceGraph(wrapper.getSourceGraph());

LogDataUtils.logDataModelList("Parent data with missing values injected randomly.", getDataModelList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class SemImWrapper implements SessionModel {
private List<SemIm> semIms;

/**
* @serial Can be null.
* The name of the model.
*/
private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public class SemUpdaterWrapper implements SessionModel {
private static final long serialVersionUID = 23L;

/**
* @serial
* The wrapped Bayes Updater.
*/
private final SemUpdater semUpdater;

/**
* @serial Can be null.
* The name of the model.
*/
private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public class StandardizedSemImWrapper implements KnowledgeBoxInput {

private static final long serialVersionUID = 23L;
/**
* @serial Cannot be null.
* The wrapped standardized SEM IM.
*/
private final StandardizedSemIm standardizedSemIm;
/**
* @serial Can be null.
* The name of the model.
*/
private String name;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ public class StructEmBayesSearchRunner implements SessionModel, GraphSource {
private String name;

/**
* @serial Cannot be null.
* The Bayes PM.
*/
private BayesPm bayesPm;

/**
* @serial Cannot be null.
* The data set.
*/
private DataSet dataSet;

/**
* @serial Cannot be null.
* The estimated Bayes IM.
*/
private BayesIm estimatedBayesIm;

Expand Down
6 changes: 3 additions & 3 deletions tetrad-lib/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>tetrad</artifactId>
<groupId>io.github.cmu-phil</groupId>
<version>7.6.5-SNAPSHOT</version>
<version>7.6.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tetrad-lib</artifactId>
Expand All @@ -20,8 +20,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down
6 changes: 3 additions & 3 deletions tetrad-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.6.5-SNAPSHOT</version>
<version>7.6.5</version>
</parent>

<artifactId>tetrad-lib</artifactId>
Expand All @@ -18,8 +18,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
algoType = AlgType.allow_latent_common_causes
)
@Bootstrapping
@Experimental
//@Experimental
public class Bfci extends AbstractBootstrapAlgorithm implements Algorithm, UsesScoreWrapper,
TakesIndependenceWrapper, HasKnowledge, ReturnsBootstrapGraphs,
TakesCovarianceMatrix {
Expand Down Expand Up @@ -119,7 +119,7 @@ public Graph runSearch(DataModel dataModel, Parameters parameters) {
search.setDoDiscriminatingPathColliderRule(parameters.getBoolean(Params.DO_DISCRIMINATING_PATH_COLLIDER_RULE));
search.setDepth(parameters.getInt(Params.DEPTH));
search.setNumThreads(parameters.getInt(Params.NUM_THREADS));
search.setRepairFaultyPag(parameters.getBoolean(Params.REPAIR_FAULTY_PAG));
search.setGuaranteePag(parameters.getBoolean(Params.GUARANTEE_PAG));
search.setVerbose(parameters.getBoolean(Params.VERBOSE));

search.setKnowledge(knowledge);
Expand Down Expand Up @@ -182,7 +182,7 @@ public List<String> getParameters() {
params.add(Params.TIME_LAG);
params.add(Params.SEED);
params.add(Params.NUM_THREADS);
params.add(Params.REPAIR_FAULTY_PAG);
params.add(Params.GUARANTEE_PAG);
params.add(Params.VERBOSE);

// Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Graph runSearch(DataModel dataModel, Parameters parameters) {
search.setVerbose(parameters.getBoolean(Params.VERBOSE));
search.setPcHeuristicType(pcHeuristicType);
search.setStable(parameters.getBoolean(Params.STABLE_FAS));
search.setRepairFaultyPag(parameters.getBoolean(Params.REPAIR_FAULTY_PAG));
search.setGuaranteePag(parameters.getBoolean(Params.GUARANTEE_PAG));

return search.search();
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public List<String> getParameters() {
parameters.add(Params.DO_DISCRIMINATING_PATH_COLLIDER_RULE);
parameters.add(Params.COMPLETE_RULE_SET_USED);
parameters.add(Params.TIME_LAG);
parameters.add(Params.REPAIR_FAULTY_PAG);
parameters.add(Params.GUARANTEE_PAG);

parameters.add(Params.VERBOSE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Graph runSearch(DataModel dataModel, Parameters parameters) {
search.setDoDiscriminatingPathColliderRule(parameters.getBoolean(Params.DO_DISCRIMINATING_PATH_COLLIDER_RULE));
search.setPossibleMsepSearchDone(parameters.getBoolean(Params.POSSIBLE_MSEP_DONE));
search.setPcHeuristicType(pcHeuristicType);
search.setRepairFaultyPag(parameters.getBoolean(Params.REPAIR_FAULTY_PAG));
search.setGuaranteePag(parameters.getBoolean(Params.GUARANTEE_PAG));
search.setVerbose(parameters.getBoolean(Params.VERBOSE));

return search.search();
Expand Down Expand Up @@ -160,7 +160,7 @@ public List<String> getParameters() {
parameters.add(Params.DO_DISCRIMINATING_PATH_TAIL_RULE);
parameters.add(Params.DO_DISCRIMINATING_PATH_COLLIDER_RULE);
parameters.add(Params.POSSIBLE_MSEP_DONE);
parameters.add(Params.REPAIR_FAULTY_PAG);
parameters.add(Params.GUARANTEE_PAG);
// parameters.add(Params.PC_HEURISTIC);
parameters.add(Params.TIME_LAG);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Graph runSearch(DataModel dataModel, Parameters parameters) {
search.setDoDiscriminatingPathTailRule(parameters.getBoolean(Params.DO_DISCRIMINATING_PATH_TAIL_RULE));
search.setDoDiscriminatingPathColliderRule(parameters.getBoolean(Params.DO_DISCRIMINATING_PATH_COLLIDER_RULE));
search.setNumThreads(parameters.getInt(Params.NUM_THREADS));
search.setRepairFaultyPag(parameters.getBoolean(Params.REMOVE_ALMOST_CYCLES));
search.setGuaranteePag(parameters.getBoolean(Params.REMOVE_ALMOST_CYCLES));
search.setOut(System.out);

return search.search();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public Graph runSearch(DataModel dataModel, Parameters parameters) {

// General
search.setVerbose(parameters.getBoolean(Params.VERBOSE));
search.setRepairFaultyPag(parameters.getBoolean(Params.REMOVE_ALMOST_CYCLES));
search.setGuaranteePag(parameters.getBoolean(Params.REMOVE_ALMOST_CYCLES));
search.setKnowledge(this.knowledge);

return search.search();
Expand Down
Loading

0 comments on commit 2558025

Please sign in to comment.