Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few more fixes for 7.6.4 release. #1759

Merged
merged 108 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
85b526b
xx`
jdramsey Apr 13, 2024
89a5b0b
Refactor graph path methods and adjust code accordingly
jdramsey Apr 13, 2024
d90c69d
Refactor graph separation logic and simplify EdgeNode
jdramsey Apr 14, 2024
b47ec2d
Merge branch 'development' of https://github.com/cmu-phil/tetrad into…
jdramsey Apr 14, 2024
216a8bd
Update methods to include additional parameter
jdramsey Apr 14, 2024
f350195
Add selection bias option to getParents method
jdramsey Apr 14, 2024
32cb83e
Add checks for graph types in GUI
jdramsey Apr 14, 2024
1c3b626
Add support for user-supplied graphs in Algcomparison
jdramsey Apr 15, 2024
6015e26
Implement Meek Rules in Paths class
jdramsey Apr 15, 2024
1146fb3
Update UI and graph logic
jdramsey Apr 15, 2024
3d0289a
Replace 'cpdagForDag' method with 'dagToCpdag'
jdramsey Apr 16, 2024
009f7e3
Refactor graph methods and improve documentation
jdramsey Apr 16, 2024
48e18e2
Refactor graph methods and improve documentation
jdramsey Apr 16, 2024
c1786a7
Refactor adjustment sets to "visible edge adjustments"
jdramsey Apr 17, 2024
2075a3d
Refactor PAG and MAG validation functionality
jdramsey Apr 17, 2024
6776966
Merge branch 'development' of https://github.com/cmu-phil/tetrad into…
jdramsey Apr 18, 2024
23231f4
Add "Meek Rules" submenu and handle exception in TestGraphUtils
jdramsey Apr 18, 2024
1a6d91a
Add new functions for graph manipulation
jdramsey Apr 19, 2024
e86b11e
Add 'SelectEdgesInCycles' class in tetrad-gui module
jdramsey Apr 19, 2024
cf9a273
Add dependency-reduced-pom.xml to tetrad-gui
jdramsey Apr 19, 2024
10aceb7
Some adjustments.
jdramsey Apr 20, 2024
88cb1db
Refactor graph operations and initialize sets
jdramsey Apr 20, 2024
3b39bc0
Remove log message and add new test for m-connection
jdramsey Apr 20, 2024
08e5c2d
Update JavaDoc for various methods across several classes
jdramsey Apr 20, 2024
2db8adf
Move addGraphManipItems method to GraphUtils class
jdramsey Apr 20, 2024
4fef112
Disable graph type checks in GraphSaveLoadUtils
jdramsey Apr 20, 2024
b165bd2
Merge branch 'development' of https://github.com/cmu-phil/tetrad into…
jdramsey Apr 20, 2024
4d7f1c3
Disable graph type checks in GraphSaveLoadUtils
jdramsey Apr 20, 2024
84dd184
Refine graph handling methods
jdramsey Apr 20, 2024
72c9dc4
Implement redo function in graph editor
jdramsey Apr 20, 2024
a09e939
Implement redo function in graph editor
jdramsey Apr 20, 2024
ec29905
Add 'cut' functionality to graph editors
jdramsey Apr 20, 2024
cccaf14
Refactor PAG coloring and adjust paste naming in GUI
jdramsey Apr 20, 2024
e5a58a0
Update graph check dialogs to use containing JScrollPane
jdramsey Apr 21, 2024
7e65e2e
Updated graph manipulation methods and corresponding GUI elements
jdramsey Apr 21, 2024
7c23ae5
Optimize graph legality check methods
jdramsey Apr 21, 2024
ac44ce6
Update action label in PickZhangMagInPagAction
jdramsey Apr 21, 2024
92c06d5
Refactor edge selection and improve terminology clarity
jdramsey Apr 21, 2024
77c2d03
Add "ExistsAlmostCyclicPathEst" statistic class
jdramsey Apr 21, 2024
26a30b8
Remove redundant graph path conditions and statistics
jdramsey Apr 21, 2024
1060fa8
Add SelectPartiallyOrientedAction and SelectNondirectedAction classes
jdramsey Apr 21, 2024
02b9d91
Add 'SelectEdgesInCyclicPaths' class and update 'GraphUtils'
jdramsey Apr 21, 2024
f9cb33e
Add 'SelectEdgesInCyclicPaths' class and update 'GraphUtils'
jdramsey Apr 21, 2024
0b46de6
Update graph edge explanation and help window size
jdramsey Apr 22, 2024
e8b76be
Add undo, redo and reset actions to Graph Editor
jdramsey Apr 22, 2024
e580559
Update graph edge types documentation and resize help window
jdramsey Apr 22, 2024
d85f721
Set current view to "Index" in PagEdgeTypeInstructions
jdramsey Apr 22, 2024
40c9375
Add 'SelectCliquesAction' and update documentation
jdramsey Apr 22, 2024
ec1a7c3
Update clique selection action in GraphWorkbench
jdramsey Apr 22, 2024
5d0d43b
Update clique selection action in GraphWorkbench
jdramsey Apr 22, 2024
df4ebb9
Merge branch 'development' into joe_adjustment
jdramsey Apr 23, 2024
0f021c3
Correct typos and comment out block of illegalMpdag check
jdramsey Apr 23, 2024
78cdfd7
Refactor clique selection logic in SelectCliquesAction
jdramsey Apr 23, 2024
97c413d
Update graph edge types documentation and URL in LaunchFlowchartAction
jdramsey Apr 23, 2024
52f131c
Add UndoLastAction import in TetradMenuBar
jdramsey Apr 23, 2024
4abde0d
Remove UndoLastAction import and adjust paragraph indentation
jdramsey Apr 23, 2024
b4f1463
Update graph edge label and modify input prompt
jdramsey Apr 23, 2024
2969363
Update graph edge label and modify input prompt
jdramsey Apr 23, 2024
7aa873c
Refactor random graph type and limit settings
jdramsey Apr 23, 2024
250276a
Merge branch 'development' of https://github.com/cmu-phil/tetrad into…
jdramsey Apr 23, 2024
06cb581
Merge remote-tracking branch 'origin/joe_adjustment' into joe_adjustment
jdramsey Apr 23, 2024
deb6e4d
Add PAG coloring support in AbstractWorkbench
jdramsey Apr 23, 2024
06a7f33
Add PAG coloring support in AbstractWorkbench
jdramsey Apr 23, 2024
0d7e3f4
Add MagToPag conversion feature and update RevertToPag
jdramsey Apr 26, 2024
482d97b
Add MagToPag conversion feature and update RevertToPag
jdramsey Apr 26, 2024
d75a78f
Refactor PAG coloring to PAG edge specialization markups
jdramsey Apr 27, 2024
291f597
Refactor PAG coloring to PAG edge specialization markups
jdramsey Apr 27, 2024
3fa61ff
Refactor code and improve condition checks in graph methods
jdramsey Apr 28, 2024
ffcf833
Remove cap on 'b' value in ChoiceGenerator
jdramsey Apr 28, 2024
8bc4a99
Add SepsetsMaxP class and update references
jdramsey Apr 28, 2024
de36601
Add GraspLvLite class and update GraphUtils
jdramsey Apr 28, 2024
6e22e06
Add GraspLvLite class and update GraphUtils
jdramsey Apr 28, 2024
7e7d4f5
Add GraspLvLite class and update GraphUtils
jdramsey Apr 29, 2024
a2580ac
Remove NumCompatibleVisibleAncestors and refactor related code
jdramsey Apr 30, 2024
9389d78
Refactor LvLite.java to remove unused code
jdramsey Apr 30, 2024
fa999c5
Refactor variable names in LvLite.java
jdramsey Apr 30, 2024
f77c640
Refactor variable names in LvLite.java
jdramsey Apr 30, 2024
6dabab4
Refactor LvLite.java to simplify code
jdramsey Apr 30, 2024
5c10863
Remove unused parameters in LvLite.java
jdramsey Apr 30, 2024
ba38a57
Remove unused parameters in LvLite.java
jdramsey May 1, 2024
a0ce0c2
Update visibility check method and update search configuration options
jdramsey May 1, 2024
96003cb
Refactor code for visibility check and search configurations
jdramsey May 1, 2024
586f783
Add functionality for latent confounder detection in bidirectional edges
jdramsey May 2, 2024
a482005
Add verbosity checks to logger in FciOrient and LvLite
jdramsey May 2, 2024
d8db609
Removed P1, P2, PagIdea, and PagIdea2 files
jdramsey May 2, 2024
d6d5098
[Message]
jdramsey May 3, 2024
6c51807
Update LvLite class documentation
jdramsey May 3, 2024
3bb5a71
Update LvLite class documentation
jdramsey May 3, 2024
c5819e1
Refactor LvLite search algorithm and update comments
jdramsey May 3, 2024
6eb72c9
Add feature to resolve almost cyclic paths in graph search
jdramsey May 3, 2024
d38e023
Update table background color in graph_edge_types.html
jdramsey May 3, 2024
6e22c3c
Add functionality to resolve almost cyclic paths
jdramsey May 3, 2024
ceaf8e5
Refactor code for various algorithms and classes
jdramsey May 4, 2024
24ea09d
Update adjacency check and remove seed setting in LvLite
jdramsey May 4, 2024
3ea9750
Refactor edge manipulation logic and rule set application
jdramsey May 4, 2024
89425de
Refactor multiple classes and update LvLite algorithm
jdramsey May 5, 2024
44f804d
Refactor LvLite class and update method descriptions
jdramsey May 6, 2024
bd46da0
Remove unused imports in LvLite.java
jdramsey May 6, 2024
591cdc2
Remove unused variable and commented code in LvLite
jdramsey May 6, 2024
d48bae1
Update FciOrient constructor documentation
jdramsey May 6, 2024
180ca8e
Remove unused code and methods in FciOrient
jdramsey May 6, 2024
94121a5
Remove depth setting in LvLite algorithm
jdramsey May 6, 2024
946f6d7
Update LvLite class constructors and method documentation
jdramsey May 6, 2024
86fb028
Add verbose logging in LvLite search algorithm
jdramsey May 6, 2024
24de5bc
Add documentation for score-based rule in LvLite.java
jdramsey May 6, 2024
b18fc3e
Simplify code and remove redundant comments
jdramsey May 6, 2024
fb7a079
Improve reachability algorithm performance in CPDAGs and PAGs
jdramsey May 6, 2024
e80885d
Merge branch 'development' into joe_adjustment
jdramsey May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/manual/flowchart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting...</title>
<meta content="0;url=https://htmlpreview.github.io/?https:///github.com/cmu-phil/tetrad/blob/development/tetrad-lib/src/main/resources/docs/manual/flowchart.html"
http-equiv="refresh">
</head>
<body>
<p>If you are not redirected automatically, follow this <a
href="https://htmlpreview.github.io/?https:///github.com/cmu-phil/tetrad/blob/development/tetrad-lib/src/main/resources/docs/manual/flowchart.html">link
to the new page</a>.</p>
</body>
</html>
74 changes: 74 additions & 0 deletions tetrad-gui/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>tetrad</artifactId>
<groupId>io.github.cmu-phil</groupId>
<version>7.6.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tetrad-gui</artifactId>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</extension>
</extensions>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>resources/version</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>resources/version</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<manifestEntries>
<Main-Class>edu.cmu.tetradapp.Tetrad</Main-Class>
<Permissions>all-permissions</Permissions>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</transformer>
</transformers>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>launch</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public LaunchFlowchartAction() {
public void actionPerformed(ActionEvent e) {
Desktop d = Desktop.getDesktop();
try {
d.browse(new URI("https://htmlpreview.github.io/?https://raw.githubusercontent.com/cmu-phil/tetrad/" +
"development/docs/manual/flowchart.html"));
d.browse(new URI("https://htmlpreview.github.io/?https:///github.com/cmu-phil/" +
"tetrad/blob/development/tetrad-lib/src/main/resources/docs/manual/flowchart.html"));
} catch (IOException | URISyntaxException e2) {
e2.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ private void buildEditMenu(JMenu editMenu) {
editMenu.add(cut);
editMenu.add(copy);
editMenu.add(paste);
editMenu.addSeparator();
}

/**
Expand Down Expand Up @@ -241,13 +240,13 @@ public SuggestionDialog(JComponent parent, String url) {

// Create a clickable link
JLabel label = new JLabel("<html>" +
"<p>Please submit any issues you may have,</p>" +
"<p>whether bug reports, general encouragement,</p>" +
"<p>or feature requests, to our issues list. We'd</p>" +
"<p>love to hear from you as we continue to</p>" +
"<p>improve the Tetrad tools!</p>" +
"<p><center><a href=\"" + url + "\">" + url + "</a></center>" +
"</html>");
"<p>Please submit any issues you may have,</p>" +
"<p>whether bug reports, general encouragement,</p>" +
"<p>or feature requests, to our issues list. We'd</p>" +
"<p>love to hear from you as we continue to</p>" +
"<p>improve the Tetrad tools!</p>" +
"<p><center><a href=\"" + url + "\">" + url + "</a></center>" +
"</html>");
label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
label.setFont(label.getFont().deriveFont(Font.PLAIN, 14));
label.addMouseListener(new MouseAdapter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,19 @@ public static StringTextField getStringField(String parameter, Parameters parame
* @throws IllegalAccessException If the graph or simulation constructor or class is inaccessible.
*/
@NotNull
private static edu.cmu.tetrad.algcomparison.simulation.Simulation getSimulation(Class<? extends edu.cmu.tetrad.algcomparison.graph.RandomGraph> graphClazz, Class<? extends edu.cmu.tetrad.algcomparison.simulation.Simulation> simulationClazz) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
RandomGraph randomGraph = graphClazz.getConstructor().newInstance();
private edu.cmu.tetrad.algcomparison.simulation.Simulation getSimulation(Class<? extends edu.cmu.tetrad.algcomparison.graph.RandomGraph> graphClazz, Class<? extends edu.cmu.tetrad.algcomparison.simulation.Simulation> simulationClazz) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
RandomGraph randomGraph;

if (graphClazz == SingleGraph.class) {
if (model.getSuppliedGraph() == null) {
throw new IllegalArgumentException("No graph supplied.");
}

randomGraph = new SingleGraph(model.getSuppliedGraph());
} else {
randomGraph = graphClazz.getConstructor().newInstance();
}

return simulationClazz.getConstructor(RandomGraph.class).newInstance(randomGraph);
}

Expand Down Expand Up @@ -821,8 +832,12 @@ public static void scrollToWord(JTextArea textArea, JScrollPane scrollPane, Stri
}

@NotNull
private static Class<? extends RandomGraph> getGraphClazz(String graphString) {
List<String> graphTypeStrings = Arrays.asList(ParameterTab.GRAPH_TYPE_ITEMS);
private Class<? extends RandomGraph> getGraphClazz(String graphString) {
List<String> graphTypeStrings = new ArrayList<>(Arrays.asList(ParameterTab.GRAPH_TYPE_ITEMS));

if (model.getSuppliedGraph() != null) {
graphTypeStrings.add("User Supplied Graph");
}

return switch (graphTypeStrings.indexOf(graphString)) {
case 0:
Expand All @@ -831,12 +846,14 @@ private static Class<? extends RandomGraph> getGraphClazz(String graphString) {
yield ErdosRenyi.class;
case 2:
yield ScaleFree.class;
case 4:
case 3:
yield Cyclic.class;
case 5:
case 4:
yield RandomSingleFactorMim.class;
case 6:
case 5:
yield RandomTwoFactorMim.class;
case 6:
yield SingleGraph.class;
default:
throw new IllegalArgumentException("Unexpected value: " + graphString);
};
Expand Down Expand Up @@ -1441,6 +1458,11 @@ private void addAddSimulationListener() {
JComboBox<String> graphsDropdown = getGraphsDropdown();

Arrays.stream(ParameterTab.GRAPH_TYPE_ITEMS).forEach(graphsDropdown::addItem);

if (model.getSuppliedGraph() != null) {
graphsDropdown.addItem("User Supplied Graph");
}

graphsDropdown.setMaximumSize(graphsDropdown.getPreferredSize());
graphsDropdown.setSelectedItem(model.getLastGraphChoice());

Expand Down Expand Up @@ -1507,6 +1529,7 @@ private JComboBox<String> getGraphsDropdown() {
model.setLastGraphChoice(selectedItem);
}
});

return graphsDropdown;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void watch() {
}

private void addTreks(Node node1, Node node2, Graph graph, JTextArea textArea) {
List<List<Node>> treks = graph.paths().allPathsFromTo(node1, node2, 8);
List<List<Node>> treks = graph.paths().allPaths(node1, node2, 8);

if (treks.isEmpty()) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
///////////////////////////////////////////////////////////////////////////////
// For information as to what this class does, see the Javadoc, below. //
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, //
// 2007, 2008, 2009, 2010, 2014, 2015, 2022 by Peter Spirtes, Richard //
// Scheines, Joseph Ramsey, and Clark Glymour. //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
///////////////////////////////////////////////////////////////////////////////

package edu.cmu.tetradapp.editor;

import edu.cmu.tetrad.graph.EdgeListGraph;
import edu.cmu.tetrad.graph.Graph;
import edu.cmu.tetrad.search.utils.DagSepsets;
import edu.cmu.tetrad.search.utils.FciOrient;
import edu.cmu.tetradapp.workbench.GraphWorkbench;

import javax.swing.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;

/**
* This class represents an action to run the final FCI (Fast Causal Inference) rules on a graph in a GraphWorkbench.
* It extends the AbstractAction class and implements the ClipboardOwner interface.
*/
public class ApplyFinalFciRules extends AbstractAction implements ClipboardOwner {

/**
* The desktop containing the target session editor.
*/
private final GraphWorkbench workbench;

/**
* Runs the final FCI (Fast Causal Inference) rules on a graph in a GraphWorkbench.
* This action is triggered by clicking a button or selecting a menu option.
*
* @param workbench the GraphWorkbench instance containing the graph to run final FCI rules on.
* @throws NullPointerException if workbench is null.
*/
public ApplyFinalFciRules(GraphWorkbench workbench) {
super("Apply Final FCI Rules");

if (workbench == null) {
throw new NullPointerException("Desktop must not be null.");
}

this.workbench = workbench;
}

/**
* Performs an action when an event occurs.
*
* @param e the event that triggered the action.
*/
public void actionPerformed(ActionEvent e) {
this.workbench.deselectAll();
Graph graph = this.workbench.getGraph();

if (graph == null) {
JOptionPane.showMessageDialog(this.workbench, "No graph to apply final FCI rules to.");
return;
}

Graph __g = new EdgeListGraph(graph);
FciOrient finalFciRules = new FciOrient(new DagSepsets(__g));
finalFciRules.zhangFinalOrientation(__g);
workbench.setGraph(__g);
}

/**
* Called when ownership of the clipboard contents is lost.
*
* @param clipboard the clipboard that lost ownership
* @param contents the contents that were lost
*/
public void lostOwnership(Clipboard clipboard, Transferable contents) {
}
}



Loading