-
Notifications
You must be signed in to change notification settings - Fork 6
Code Quality Checking #132
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
Conversation
Introduces the SSMProductDistribution wrapper for product distributions of sequential sampling models, enabling custom logpdf methods for NamedTuple data. Refactors related methods in product_distribution.jl, updates exports, and adds a codequality.jl test file for Aqua and JET checks. Project.toml is updated to reflect new weak dependencies, test targets, and extras.
Expanded [extensions] and [compat] in Project.toml, added new test dependencies and compat entries in test/Project.toml, and removed JET from main compat. In src, removed export of predict_distribution. In tests, explicitly imported product_distribution in relevant test sets and updated code quality checks to address package compatibility issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances code quality by adding automated testing with Aqua and JET, and introduces a new SSMProductDistribution type to avoid type piracy when working with product distributions of sequential sampling models (SSMs) that produce NamedTuple data.
Key Changes:
- Introduced
SSMProductDistributionwrapper type to enable customlogpdfandrandmethods for SSM models withNamedTupledata without type piracy - Added Aqua and JET code quality checks to the test suite
- Updated CI workflow to test against Julia version '1' in addition to '1.11'
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/product_distribution.jl | Implements new SSMProductDistribution type and product_distribution constructor to avoid type piracy for SSM2D models |
| src/SequentialSamplingModels.jl | Exports new SSMProductDistribution type and product_distribution function |
| src/multi_choice_models/MDFT.jl | Adds Integer type constraint to make_default_contrast function parameter for better type safety |
| test/codequality.jl | New file adding Aqua and JET code quality checks to test suite |
| test/product_distribution_tests.jl | Adds explicit imports of product_distribution function for clarity |
| test/Project.toml | Adds Aqua and JET test dependencies, updates TuringUtilities source syntax to modern format, adds JET compat constraint |
| Project.toml | Moves Interpolations, KernelDensity, and Plots to weakdeps, adds DynamicPPL weakdep, updates PlotsExt dependencies |
| .github/workflows/CI.yml | Adds Julia version '1' to test matrix for broader version compatibility testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@rsenne, thank you for this pull request. I have not reviewed the code in detail, but these seem like nice improvements to the code base. I will finish reviewing later this week. Thanks again! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #132 +/- ##
==========================================
+ Coverage 88.97% 89.27% +0.30%
==========================================
Files 26 26
Lines 1913 1921 +8
==========================================
+ Hits 1702 1715 +13
+ Misses 211 206 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sounds good @itsdfish, happy to help! Let me know what else I can do/if I need to edit anything. |
|
@rsenne, this looks great. I will merge. Thanks! |
Hi SequentialSamplingModels team, congrats on the publication! I am submitting this PR to satisfy some things I forgot to mention in my PR, and to fix some issues these fixes found. The basic goal was to add JET and Aqua testing, which in my opinion, are a must for unit tests. After adding these tests, both packages found several issues including type piracy, stale deps, etc. These are all detailed below! I also added minor things like adding '1" to the CI matrix as i think it is good practice to always test against the latest version of Julia. Let me know how this all looks to y'all.
This pull request adds a new
SSMProductDistributiontype and related functionality to support product distributions for sequential sampling models (SSMs), especially for cases involvingNamedTupledata, and improves code quality and testing. The changes also include updates to exports, dependency management, and the CI workflow.New product distribution support for SSMs:
SSMProductDistributiontype as a wrapper aroundProductDistributionto enable defininglogpdfandrandmethods for SSMs withNamedTupledata, avoiding type piracy. Added theproduct_distributionfunction to create either a standard or SSM-specific product distribution depending on the input. Implemented related methods forrand,rand!, andlogpdffor this new type. (src/product_distribution.jl) [1] [2]SSMProductDistributiontype andproduct_distributionfunction. (src/SequentialSamplingModels.jl) [1] [2]Testing and code quality improvements:
Aqua,JET,JuliaFormatter) for code quality and static analysis, and updated the test project configuration for better dependency management and compatibility. (test/Project.toml) [1] [2]test/codequality.jlfile to run code quality checks usingAquaand static analysis withJET. (test/codequality.jl)product_distributionfunction for clarity and correctness. (test/product_distribution_tests.jl) [1] [2] [3] [4] [5] [6] [7] [8]API and workflow refinements:
make_default_contrastfunction argument for clarity and type safety. (src/multi_choice_models/MDFT.jl)1in the test matrix for broader compatibility testing. (.github/workflows/CI.yml)This pull request introduces a new
SSMProductDistributiontype to support product distributions for sequential sampling models (SSMs), adds aproduct_distributionconstructor, and integrates these into the codebase and tests. It also improves code quality by adding Aqua and JET checks, and includes several minor improvements and compatibility updates.New functionality for product distributions in SSMs:
SSMProductDistributionstruct insrc/product_distribution.jlto wrapProductDistributionfor SSMs, allowing specializedlogpdfandrandmethods forNamedTupledata.product_distributionfunction to construct either a standardProductDistributionor anSSMProductDistributiondepending on the element type, and updated exports accordingly. [1] [2]rand,rand!, andlogpdfto work withSSMProductDistribution, ensuring correct handling of SSM-specific data.Testing and code quality improvements:
test/codequality.jlto automatically check for code quality and type stability. [1] [2] [3]product_distributionfor clarity and coverage. [1] [2] [3] [4] [5] [6] [7] [8]General improvements and compatibility:
SSMProductDistributiontype from the main module.make_default_contrastfunction insrc/multi_choice_models/MDFT.jlto require anIntegerargument for better type safety.test/Project.tomlto use the new[sources]syntax forTuringUtilitiesand added compatibility for JET.