Skip to content

Commit

Permalink
Merge pull request #1803 from cmu-phil/development
Browse files Browse the repository at this point in the history
Version 7.6.5 code
  • Loading branch information
jdramsey authored Aug 15, 2024
2 parents 1611de7 + db3fc5b commit 69fdb1c
Show file tree
Hide file tree
Showing 569 changed files with 28,896 additions and 10,508 deletions.
2 changes: 1 addition & 1 deletion INSTALL_APPLICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ See [Setting up Java for Tetrad](https://github.com/cmu-phil/tetrad/wiki/Setting

To download the Tetrad jar, please click the following link (which will always be updated to the latest version):

https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/tetrad-gui/7.6.3/tetrad-gui-7.6.3-launch.jar
https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/tetrad-gui/7.6.4/tetrad-gui-7.6.4-launch.jar

You may be able to launch this jar by double-clicking the jar file name. However, on a Mac, this presents some security
challenges. On all platforms, the jar may be launched at the command line (with a specification of the amount of RAM you
Expand Down
4 changes: 2 additions & 2 deletions data-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.6.4</version>
<version>7.6.5</version>
</parent>
<!-- <groupId>io.github.cmu-phil</groupId>-->
<artifactId>data-reader</artifactId>
Expand All @@ -22,7 +22,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
11 changes: 3 additions & 8 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.4</version>
<version>7.6.5</version>
<packaging>pom</packaging>

<name>Tetrad Project</name>
Expand Down Expand Up @@ -62,7 +62,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down Expand Up @@ -163,7 +163,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -198,11 +198,6 @@
</properties>

<dependencies>
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-log4j12</artifactId>-->
<!-- <version>1.7.36</version>-->
<!-- </dependency>-->
<dependency> <!--For java annotations used by annotated algorithms-->
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
Expand Down
49 changes: 49 additions & 0 deletions testTrueGraphForCheckNodewiseMarkov.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Graph Nodes:
X1;X2;X3;X4;X5;X6;X7;X8;X9;X10

Graph Edges:
1. X1 --> X2
2. X1 --> X3
3. X1 --> X5
4. X1 --> X6
5. X1 --> X7
6. X1 --> X8
7. X1 --> X9
8. X1 --> X10
9. X2 --> X3
10. X2 --> X4
11. X2 --> X5
12. X2 --> X8
13. X2 --> X9
14. X2 --> X10
15. X3 --> X4
16. X3 --> X5
17. X3 --> X6
18. X3 --> X7
19. X3 --> X8
20. X3 --> X9
21. X3 --> X10
22. X4 --> X5
23. X4 --> X6
24. X4 --> X9
25. X4 --> X10
26. X5 --> X6
27. X5 --> X7
28. X5 --> X8
29. X5 --> X9
30. X5 --> X10
31. X6 --> X7
32. X6 --> X8
33. X6 --> X9
34. X6 --> X10
35. X7 --> X8
36. X7 --> X9
37. X7 --> X10
38. X8 --> X9
39. X8 --> X10
40. X9 --> X10


Test True Graph size: 10
Test Estimated CPDAG Graph: Graph Nodes:
X1;X2;X3;X4;X5;X6;X7;X8;X9;X10
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.4</version>
<version>7.6.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tetrad-gui</artifactId>
Expand Down Expand Up @@ -33,15 +33,15 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -68,7 +68,7 @@
</plugins>
</build>
<properties>
<java.version>1.8</java.version>
<java.version>17</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.4</version>
<version>7.6.5</version>
</parent>

<artifactId>tetrad-gui</artifactId>
Expand All @@ -31,7 +31,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand All @@ -40,7 +40,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -186,7 +186,7 @@

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

<!--<scm>-->
Expand Down
7 changes: 3 additions & 4 deletions tetrad-gui/src/main/java/edu/cmu/tetradapp/Tetrad.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
///////////////////////////////////////////////////////////////////////////////
package edu.cmu.tetradapp;

import edu.cmu.tetrad.search.work_in_progress.DMSearch;
import edu.cmu.tetrad.util.JOptionUtils;
import edu.cmu.tetrad.util.TetradLogger;
import edu.cmu.tetrad.util.Version;
Expand Down Expand Up @@ -52,7 +51,7 @@ public final class Tetrad implements PropertyChangeListener {
*/
private static final String EXP_OPT = "--experimental";
/**
* Whether to enable experimental features
* Whether to enable experimental featuresj
*/
public static boolean enableExperimental;
/**
Expand Down Expand Up @@ -122,7 +121,7 @@ private static void setLookAndFeel() {
UIManager.getSystemLookAndFeelClassName());
}
} catch (Exception e) {
TetradLogger.getInstance().forceLogMessage("Couldn't set look and feel.");
TetradLogger.getInstance().log("Couldn't set look and feel.");
}
}

Expand Down Expand Up @@ -271,7 +270,7 @@ public void componentMoved(ComponentEvent e) {
}
});
} catch (Exception e) {
TetradLogger.getInstance().forceLogMessage("Could not set quit handler on this platform..");
TetradLogger.getInstance().log("Could not set quit handler on this platform..");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public void watch() {

throw e1;
} catch (Exception e2) {
TetradLogger.getInstance().forceLogMessage("Exception: " + e2.getMessage());
e2.printStackTrace();
TetradLogger.getInstance().log("Exception: " + e2.getMessage());
}
} else if (o instanceof SessionWrapper) {
sessionWrapper = (SessionWrapper) o;
Expand Down Expand Up @@ -158,8 +159,10 @@ public void watch() {
DesktopController.getInstance().closeEmptySessions();
DesktopController.getInstance().putMetadata(sessionWrapper, metadata);
} catch (FileNotFoundException ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "That wasn't a TETRAD session file: " + file);
} catch (Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "An error occurred attempting to load the session.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectOutputStream;
import java.io.Serial;
import java.nio.file.Files;
Expand Down Expand Up @@ -106,6 +107,11 @@ public void watch() {
sessionWrapper.setNewSession(false);
objOut.writeObject(metadata);
objOut.writeObject(sessionWrapper);
} catch (NotSerializableException exception) {
exception.printStackTrace(System.err);
JOptionPane.showMessageDialog(
JOptionUtils.centeringComp(),
"An error occurred while attempting to save the session. The session could not be saved.");
} catch (IOException exception) {
exception.printStackTrace(System.err);
JOptionPane.showMessageDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,19 @@ public void doDoubleClickAction() {
public void doDoubleClickAction(Graph sessionWrapper) {
this.sessionWrapper = (SessionWrapper) sessionWrapper;

class MyWatchedProcess extends WatchedProcess {
public void watch() {
TetradLogger.getInstance().setTetradLoggerConfig(getSessionNode().getLoggerConfig());
launchEditorVisit();
}
}
SwingUtilities.invokeLater(() -> {
TetradLogger.getInstance().setTetradLoggerConfig(getSessionNode().getLoggerConfig());
launchEditorVisit();
});

new MyWatchedProcess();
// class MyWatchedProcess extends WatchedProcess {
// public void watch() {
// TetradLogger.getInstance().setTetradLoggerConfig(getSessionNode().getLoggerConfig());
// launchEditorVisit();
// }
// }
//
// new MyWatchedProcess();
}

private void launchEditorVisit() {
Expand Down Expand Up @@ -816,7 +821,7 @@ private void showLogConfig(TetradLoggerConfig config) {
}

private void executeSessionNode(SessionNode sessionNode) {
class MyWatchedProcess extends WatchedProcess {
new WatchedProcess() {
@Override
public void watch() {
final Class c = SessionEditorWorkbench.class;
Expand All @@ -829,13 +834,11 @@ public void watch() {

workbench.getSimulationStudy().execute(sessionNode, true);
}
}

new MyWatchedProcess();
};
}

private void createDescendantModels() {
class MyWatchedProcess extends WatchedProcess {
new WatchedProcess() {
@Override
public void watch() {
final Class clazz = SessionEditorWorkbench.class;
Expand All @@ -849,9 +852,7 @@ public void watch() {
getSessionNode(), true);
}
}
}

new MyWatchedProcess();
};
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public SessionEditorToolbar(SessionEditorWorkbench workbench) {
new ButtonInfo("Graph", "Graph", "graph", "<html>Add a graph node.</html>"),
new ButtonInfo("Compare", "Compare", "compare",
"<html>Add a node to compare graphs or SEM IM's.</html>"),
new ButtonInfo("GridSearch", "Grid Search", "search",
"<html>Add a node to do a grid search.</html>"),
new ButtonInfo("PM", "Parametric Model", "pm",
"<html>Add a node for a parametric model.</html>"),
new ButtonInfo("IM", "Instantiated Model", "im",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public void setDisplayLogging(boolean displayLogging) {
try {
TetradLogger.getInstance().setNextOutputStream();
} catch (IllegalStateException e2) {
TetradLogger.getInstance().forceLogMessage(
TetradLogger.getInstance().log(
"Unable to setup logging, please restart Tetrad.");
return;
}
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
Loading

0 comments on commit 69fdb1c

Please sign in to comment.