Skip to content

Conversation

@rsenne
Copy link
Contributor

@rsenne rsenne commented Dec 29, 2025

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 SSMProductDistribution type and related functionality to support product distributions for sequential sampling models (SSMs), especially for cases involving NamedTuple data, 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:

  • Introduced the SSMProductDistribution type as a wrapper around ProductDistribution to enable defining logpdf and rand methods for SSMs with NamedTuple data, avoiding type piracy. Added the product_distribution function to create either a standard or SSM-specific product distribution depending on the input. Implemented related methods for rand, rand!, and logpdf for this new type. (src/product_distribution.jl) [1] [2]
  • Exported the new SSMProductDistribution type and product_distribution function. (src/SequentialSamplingModels.jl) [1] [2]

Testing and code quality improvements:

  • Added new dependencies (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]
  • Added a test/codequality.jl file to run code quality checks using Aqua and static analysis with JET. (test/codequality.jl)
  • Updated product distribution tests to explicitly import the new product_distribution function for clarity and correctness. (test/product_distribution_tests.jl) [1] [2] [3] [4] [5] [6] [7] [8]

API and workflow refinements:

  • Added a type annotation to the make_default_contrast function argument for clarity and type safety. (src/multi_choice_models/MDFT.jl)
  • Updated the CI workflow to include Julia version 1 in the test matrix for broader compatibility testing. (.github/workflows/CI.yml)
    This pull request introduces a new SSMProductDistribution type to support product distributions for sequential sampling models (SSMs), adds a product_distribution constructor, 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:

  • Added a new SSMProductDistribution struct in src/product_distribution.jl to wrap ProductDistribution for SSMs, allowing specialized logpdf and rand methods for NamedTuple data.
  • Introduced the product_distribution function to construct either a standard ProductDistribution or an SSMProductDistribution depending on the element type, and updated exports accordingly. [1] [2]
  • Implemented and updated methods for rand, rand!, and logpdf to work with SSMProductDistribution, ensuring correct handling of SSM-specific data.

Testing and code quality improvements:

  • Added Aqua and JET as test dependencies and created a new test/codequality.jl to automatically check for code quality and type stability. [1] [2] [3]
  • Updated product distribution tests to explicitly import product_distribution for clarity and coverage. [1] [2] [3] [4] [5] [6] [7] [8]

General improvements and compatibility:

  • Exported the new SSMProductDistribution type from the main module.
  • Updated the make_default_contrast function in src/multi_choice_models/MDFT.jl to require an Integer argument for better type safety.
  • Added Julia version '1' to the GitHub Actions CI matrix to broaden version testing.
  • Updated test/Project.toml to use the new [sources] syntax for TuringUtilities and added compatibility for JET.

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.
Copilot AI review requested due to automatic review settings December 29, 2025 16:10
Copy link
Contributor

Copilot AI left a 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 SSMProductDistribution wrapper type to enable custom logpdf and rand methods for SSM models with NamedTuple data 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.

rsenne and others added 4 commits December 29, 2025 11:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@itsdfish
Copy link
Owner

@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-commenter
Copy link

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.27%. Comparing base (70f6fb1) to head (c186cf3).

Files with missing lines Patch % Lines
src/product_distribution.jl 92.30% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rsenne
Copy link
Contributor Author

rsenne commented Dec 29, 2025

Sounds good @itsdfish, happy to help! Let me know what else I can do/if I need to edit anything.

@itsdfish itsdfish closed this Dec 31, 2025
@itsdfish itsdfish reopened this Dec 31, 2025
@itsdfish
Copy link
Owner

@rsenne, this looks great. I will merge. Thanks!

@itsdfish itsdfish merged commit c21af9e into itsdfish:master Dec 31, 2025
4 of 6 checks passed
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