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

Version 7.6.5 code #1803

Merged
merged 359 commits into from
Aug 15, 2024
Merged

Version 7.6.5 code #1803

merged 359 commits into from
Aug 15, 2024

Conversation

jdramsey
Copy link
Collaborator

Version 7.6.t

jdramsey and others added 30 commits May 30, 2024 12:22
This commit refactors the Rfci and GridSearchModel classes. In Rfci, it makes logging of elapsed time conditional based on the "verbose" variable and imports specific classes instead of using wildcard import statements. A new comment is added in GridSearchModel to explain a variable.
The double weight was extracted from the call chain for more clarity. This enhances the readability of the code in GridSearchEditor by breaking down complex lines into simpler segments. Thus, the code maintanability is improved.
This commit adds error logging to the serialization and deserialization processes which was missing beforehand. The error messages notify the user when an object fails to serialize or deserialize, providing the class name and error details for troubleshooting.
This commit introduces serialization and deserialization methods to various classes in the edu/cmu/tetrad directory. ObjectOutputStream and ObjectInputStream are used to handle the serialization and deserialization process, and exceptions are logged using TetradLogger if they occur.
An unnecessary backtick (`) was removed from the parameter name "algcomparisonSetAlgorithmKnowledge" in the setAlgorithmKnowledge method within the GridSearchModel class. This correction allows the function to reference the correct parameter name.
The code has been refactored to include type checking before doing a type conversion, improving error handling. Unnecessary import statements have been removed. Additionally, white spaces and line alignment have been corrected for better readability. The readResolve method in the NodeType class, which was not being used, has also been removed.
Several new constructors have been added to the GridSearchModel class. These constructors enable initialization of GridSearchModel with different combinations of arguments such as KnowledgeBoxModel, GraphSource, DataWrapper, and Parameters. This provides more flexibility when initializing GridSearchModel instances. Also, adjustments have made in some method's documentation for clarity and old unused method 'setWeight' was deleted.
The commit mainly adds the 'transient' keyword to several variables in TetradLogger class to avoid them being serialized. Another significant change includes renaming of 'LvBossPag' class to 'LvDumb'. Several redundancies in GridSearchModel class have been cleaned up and error handling improvements have been made in classes like Comparison and GridSearchModel. Scroll functionality has also been added in GridSearchEditor class.
Improved the handling of statistics model creation by checking for no-argument constructors before instantiation to avoid exceptions. Also corrected the filtering logic in the Directed Acyclic Graph (DAG) to Page (PAG) conversion utility to properly remove non-measured nodes.
The enumeration classes, ParamComparison, ParamType, ParamConstraintType, NodeType, have been refactored. Serialization and deserialization methods have been added to several classes. In addition, null checks have been added for setNodeType and getNodeType methods, a 'Grid Search' button has been added to the toolbar, and the IndTestType enum class has been refactored.
Fixed shuffle function and combine all shuffled independence test p vals  for a target node into a flat list to feed into Anderson Darling Test
Finished up experimental LV-Lite and cleaned up the rest of the LV code.
The commit corrects a spelling mistake in a error message in the PoissonPriorScore class and streamlines the import statements in the NodeType class within the graph package. Removed unused imports to enhance code cleanliness.
The LvLite search algorithm was refactored for optimization and clarity. A new class, 'LvLiteDsepFriendly', was also added. The 'GraphEditor' now has a shortcut for creating a random graph.
In this commit, the triangle reasoning logic was refactored into a separate method for both LvLite and LvLiteDsepFriendly. Additionally, the extra conditional statements were removed, and readable variables were introduced for ease of understanding. Unnecessary codes were successfully cleaned up.
The code updates improve the efficiency of the GFci-R0 algorithm. These improvements involve better handling of nodes within graphs, including refinements in recognizing unshielded triples and allowing colliders. Enhancements also include additional condition checks to avoid redundant operations and incorrect orientations.
The description of the LvDumb class has been updated to more accurately reflect its functionality. Specifically, it has been clarified that the LV-Dumb algorithm is used to find the BOSS DAG for the dataset, which is then reported as a PAG (Partially Ancestral Graph) structure.
The documentation for the LvDumb class has been updated to better describe how it handles latent variable reasoning. More specifically, the doc now mentions that the class reports the PAG structure of the BOSS DAG without performing any further latent variable reasoning.
The commit includes changes across multiple classes where the generic 'discriminating path rule' is divided into two specific rules: 'discriminating path tail rule' and 'discriminating path collider rule'. This update increases the clarity and specificity of the rule application during the search operation in these classes.
In this commit, an option has been added to allow for internal randomness in the search algorithm. This feature is toggleable through setAllowInternalRandomness(). Other changes include removing the Bes algorithm related code, adjusting max path length for various orientation heuristics, and cleaning up/resetting several default configurations. Documentation for class variables has also been improved.
In this commit, an option has been added to allow for internal randomness in the search algorithm. This feature is toggleable through setAllowInternalRandomness(). Other changes include removing the Bes algorithm related code, adjusting max path length for various orientation heuristics, and cleaning up/resetting several default configurations. Documentation for class variables has also been improved.
The method across multiple classes has been refactored to set the maximum length of any discriminating path. The parameters have been updated to allow for unlimited length using -1. The change also includes adding validation checks to ensure the length is either -1 or a non-negative integer.
The method across multiple classes has been refactored to set the maximum length of any discriminating path. The parameters have been updated to allow for unlimited length using -1. The change also includes adding validation checks to ensure the length is either -1 or a non-negative integer.
The LvLite and LvLiteDsepFriendly classes have been streamlined and cleaned up for clarity and performance. This includes removing unnecessary conditionals and repetitions, consolidating duplicate code into a helper function, and optimizing how common adjacents are processed.
Refactored LvLite and LvLiteDsepFriendly classes to improve code readability and maintainability. The code was restructured by extracting methods and better organizing code logic. In addition, adjustments were made to enhance efficiency during traversal and manipulation of graph elements.
Primarily, refactored the 'reorientWithCircles', 'search', 'setKnowledge', 'setCompleteRuleSetUsed', 'setVerbose', 'setNumStarts', 'setDoDiscriminatingPathTailRule', 'setDoDiscriminatingPathColliderRule', and 'setUseBes' methods, and made them more efficient. Also, removed the unused 'score' and 'start' variables and unnecessary methods in LvLiteDsepFriendly. Also, optimized the 'search' method and updated the verbose logs for better clarity.
The collider orientation logic in the LvLite.java and LvLiteDsepFriendly.java files is refactored and made more concise. Unnecessary parameters and methods related to depth settings for search algorithms in these files are also removed. The default value for 'doDiscriminatingPathColliderRule' is now set to true in the manual index.html file.
Revamped the recallUnshieldedTriples method in LvLite to clean up its operations, improving its efficiency. Enhanced LvLiteDsepFriendly by altering various parameters for better performance. The DagToPag has been revised with more extensive inline documentation and notes. The FciOrient class was updated to ensure that every endpoint and edge changing operation correctly sets the change flag for better responsiveness to alterations.
jdramsey added 29 commits August 6, 2024 19:39
Enhanced `GraphUtils` to handle new edge types and updated the `Counts` array size to accommodate these changes. Additionally, modified the method signature of `FciOrient.orient` to remove an unnecessary return statement, improving the method's clarity and correctness.
Simplified `DiscriminatingPath` logic by modifying key methods to use more concise parameters. Removed verbose comments and refactored validation to improve readability and maintainability. Updated related classes to align with the new discriminating path structure.
Relocate R5R9Dijkstra from the util package to search.utils for better module organization. Updated all relevant import statements in FciOrient and SvarFciOrient accordingly.
Removed redundant comments and streamlined logic for discriminating path orientation across multiple files. Updated method signatures to reflect simplified logic and added validation checks in a centralized manner.
…k_2024_6-13

# Conflicts:
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/utils/DagToPag.java
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/utils/DiscriminatingPath.java
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/utils/FciOrient.java
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/utils/R0R4Strategy.java
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/utils/R0R4StrategyScoreBased.java
#	tetrad-lib/src/main/java/edu/cmu/tetrad/search/utils/R0R4StrategyTestBased.java
The import statement for R5R9Dijkstra was not being used in the code. This cleanup improves code readability and maintainability by removing unnecessary dependencies.
Deleted the SvarFciOrient.java file which contained legacy code for the SvarFCI algorithm. This cleanup removes outdated and possibly unused code components to streamline the codebase.
Refactor method name for clarity in DiscriminatingPath class and update references in related code. This improves readability and better describes the method's purpose.
Updated the `DiscriminatingPath` class to include additional documentation, rename methods for clarity, and improve path checking logic. Enhanced comments and checks in relevant methods in `FciOrient`, `DagToPag`, and `R0R4StrategyTestBased` to ensure correctness and readability. Adjusted test cases in `TestFci` to align with new path orientation rules.
Updated edge orientation rules R1-R10 for better clarity and succinctness. Simplified comments and documentation, focusing on mathematical notation and removing verbose explanations. Improved implementation by removing redundant checks and consolidating functions where appropriate.
Changed the visibility of fciOrientbk method from private to public. This modification allows external classes to access and utilize the method for BK orientation in a graph.
Refactor `defVisible` logic, add detailed comments, and introduce helper methods to improve readability and maintainability. Also, include documentation for endpoint strategy in FciOrient.java.
Wrapped all logging statements with a verbosity check (`if (verbose)`) to ensure logs are generated only when the `verbose` flag is enabled. This reduces unnecessary logging and improves performance in non-verbose mode. The change affects multiple sections in the `LvLite.java` file, enhancing overall log management.
Added a newline for better code readability before a comment. No functional changes made to the existing logic.
Added Javadoc comments to several classes and methods across multiple files, including DefaultSetEndpointStrategy, SetEndpointStrategy, R5R9Dijkstra, GraphSearchUtils, SvarSetEndpointStrategy, R0R4Strategy, FciOrientDijkstra, Paths, and Edges. This improves code documentation and provides useful information about the purpose and usage of classes and their methods.
Removed unnecessary parameters and configurations across several search classes including `Fci`, `SpFci`, and `LvLite`. This cleanup improves code readability and maintainability by eliminating unused functionality.
Eliminated the `ABLATION_LEAVE_OUT_FINAL_ORIENTATION` parameter as it is no longer used, simplifying the `SpFci` algorithm setup. Added logging to mark the number of available processors during parallel execution in `MarkovCheck`, enhancing debugging capabilities.
Refactored FCI search algorithms (Fci, SvarFci, SpFci, GraspFci) to manage unshielded triples for rule R0 orientation. Added repairFaultyPag method to correct faulty PAGs using unshielded triples, inducing paths, and final orientations. Updated HTML documentation to reflect new parameter descriptions and default values.
Added boolean flags and configuration to enable discriminating path tail and collider rules in FCI-related classes. This allows for more detailed control over the rule sets and improves the flexibility of the search algorithms.
Added methods to set complete rule set usage and maximum path length in FciOrient configuration. Updated TsDagToPag and Fci classes to integrate these new settings, improving the customization and flexibility of the algorithm's behavior.
Enhanced the `repairFaultyPag` method with a new `checkCyclicity` parameter to optionally check for directed cycles. Updated all relevant instances across different classes to accommodate this new parameter.
Refactor `resolveAlmostCycles1` by removing the redundant `anyChange` parameter and clean up commented code. Add new setter methods in `GFci` for discriminating path tail and collider rules, improving configurability.
Refactor methods and variables to rename "repairFaultyPag" to "guaranteePag" across multiple classes. Added javadoc comments for newly renamed methods and enhanced documentation for better clarity and maintainability.
Updated the version in multiple POM files to move from the 7.6.5-SNAPSHOT development version to the 7.6.5 release version. This change ensures the project dependencies align with the stable release. Also, improved the Javadoc for the `ruleR0` method in `FciOrient.java` for better clarity.
Updated all POM files to set Java source and target versions from 17 to 21. This change applies to all modules within the project to ensure compatibility and leverage new Java 21 features.
Updated the Maven configuration across multiple POM files to change the Java source and target versions from 21 to 17. This ensures compatibility with environments requiring Java 17, and updates relevant plugin configurations accordingly.
@jdramsey jdramsey merged commit 69fdb1c into master Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants