Skip to content

Releases: alexhallam/fiasto

Release v0.2.7

10 Sep 01:32
33861cf

Choose a tag to compare

✨ Added

  • Multi-way Interaction Support: Complete implementation of multi-way interactions (e.g., x1*x2*x3) with canonical expansion
  • InteractionTerm Role: Added new InteractionTerm role to VariableRole enum for interaction variables
  • Comprehensive Interaction Metadata: Each variable now includes detailed interaction information showing all interactions it participates in
  • Canonical Expansion: Multi-way interactions now generate all possible combinations (2-way, 3-way, etc.) as per R/Wilkinson notation standards
  • Test Example: Added test_multiway_interaction.rs example demonstrating 2-way, 3-way, and 4-way interactions
  • Categorical Function Support: Added c() function for categorical variables with reference level specification
  • Named Arguments: Added support for named arguments in function calls (e.g., ref=treatment)
  • Categorical Role: Added new Categorical role to VariableRole enum for categorical variables
  • Test Example: Added test_categorical_function.rs example demonstrating categorical function usage

🔧 Improved

  • Interaction Parsing: Completely rewritten push_interaction method to handle nested interaction structures
  • Variable Extraction: New extract_all_variables method recursively extracts all variables from nested interactions
  • Combination Generation: New helper methods to generate all possible interaction combinations
  • Interaction Naming: Interaction variables now use underscore-separated naming (e.g., x1_x2_x3)

🐛 Fixed

  • Multi-way Interaction Bug: Fixed issue where x1*x2*x3 was only generating 2-way interactions instead of the complete canonical expansion
  • Missing Higher-order Interactions: Resolved problem where 3-way and higher-order interactions were not being generated

📝 Technical Details

  • Canonical Expansion: For x1*x2*x3, now generates: [x1, x2, x3, x1_x2, x1_x3, x2_x3, x1_x2_x3]
  • Backward Compatibility: Existing 2-way interactions continue to work as before
  • Role Assignment: Interaction variables receive both InteractionTerm and FixedEffect roles
  • Metadata Structure: Each variable includes comprehensive interaction metadata with order, context, and participating variables

Release v0.2.6

10 Sep 00:11
10dda51

Choose a tag to compare

✨ Added

  • Multi-way Interaction Support: Complete implementation of multi-way interactions (e.g., x1*x2*x3) with canonical expansion
  • InteractionTerm Role: Added new InteractionTerm role to VariableRole enum for interaction variables
  • Comprehensive Interaction Metadata: Each variable now includes detailed interaction information showing all interactions it participates in
  • Canonical Expansion: Multi-way interactions now generate all possible combinations (2-way, 3-way, etc.) as per R/Wilkinson notation standards
  • Test Example: Added test_multiway_interaction.rs example demonstrating 2-way, 3-way, and 4-way interactions

🔧 Improved

  • Interaction Parsing: Completely rewritten push_interaction method to handle nested interaction structures
  • Variable Extraction: New extract_all_variables method recursively extracts all variables from nested interactions
  • Combination Generation: New helper methods to generate all possible interaction combinations
  • Interaction Naming: Interaction variables now use underscore-separated naming (e.g., x1_x2_x3)

🐛 Fixed

  • Multi-way Interaction Bug: Fixed issue where x1*x2*x3 was only generating 2-way interactions instead of the complete canonical expansion
  • Missing Higher-order Interactions: Resolved problem where 3-way and higher-order interactions were not being generated

📝 Technical Details

  • Canonical Expansion: For x1*x2*x3, now generates: [x1, x2, x3, x1_x2, x1_x3, x2_x3, x1_x2_x3]
  • Backward Compatibility: Existing 2-way interactions continue to work as before
  • Role Assignment: Interaction variables receive both InteractionTerm and FixedEffect roles
  • Metadata Structure: Each variable includes comprehensive interaction metadata with order, context, and participating variables

Release v0.2.5

09 Sep 19:53

Choose a tag to compare

✨ Added

  • Identity Role for Plain Terms: Added new Identity role to VariableRole enum for variables that appear as plain terms in formulas (e.g., x in y ~ x)
  • Intercept Column Support: Added automatic inclusion of "intercept" column in all_generated_columns when has_intercept is true
  • Formula Order Mapping: Added new all_generated_columns_formula_order field that maps formula order (1, 2, 3...) to column names
  • Intercept-Only Model Support: Added support for intercept-only models like y ~ 1 and no-intercept models like y ~ 0 with new Term::Intercept and Term::Zero variants
  • Multivariate Model Support: Added support for multivariate response models like bind(y1, y2) ~ x with new Response::Multivariate variant and bind() function parsing
  • Tests: Added 11 new unit tests to verify intercept handling, formula order mapping, intercept-only model functionality, and multivariate model support

🔧 Improved

  • Variable Role Assignment: Plain terms now correctly receive Identity role instead of FixedEffect role
  • Generated Columns Preservation: Variables with Identity role now preserve their original column name in generated columns list
  • Intercept Positioning: Intercept column is automatically inserted at index 1 (after response variable) in all_generated_columns

🐛 Fixed

  • Issue #1: Fixed intercept-only model parsing by adding support for y ~ 1 and y ~ 0 formulas
  • Issue #3: Added multivariate model support with bind() function for multiple response variables
  • Issue #4: Fixed plain terms not receiving proper Identity role when appearing alone in formulas
  • Issue #6: Fixed missing intercept column in all_generated_columns and added formula order mapping

🧪 Testing

  • Unit Test Coverage: Added comprehensive test coverage for intercept, formula order, and intercept-only model functionality
  • Regression Prevention: Tests ensure intercept is present when has_intercept is true and absent when false
  • Order Validation: Tests verify correct column ordering in both all_generated_columns and all_generated_columns_formula_order
  • Intercept-Only Models: Tests verify y ~ 1 and y ~ 0 formulas work correctly with proper metadata generation
  • Multivariate Models: Tests verify bind(y1, y2) ~ x formulas work correctly with multiple response variables
  • Error Handling: Tests verify invalid syntax like y ~ 1 - 1 and y ~ 0 + 1 fails appropriately

🔄 Internal Changes

  • AST Enhancement: Added new Term::Intercept, Term::Zero variants and Response::Multivariate enum to support intercept-only, no-intercept, and multivariate models
  • Parser Updates: Enhanced parse_term() to recognize Token::One and Token::Zero as valid terms, and parse_response() to handle bind() function calls
  • Syntax Validation: Added validation to prevent contradictory syntax like y ~ 1 - 1 and invalid combinations like y ~ 0 + 1
  • MetaBuilder Enhancement: Updated build() method to handle intercept insertion and formula order mapping, and push_response() to handle multivariate responses
  • Data Structure Updates: Enhanced FormulaMetaData struct with new all_generated_columns_formula_order field
  • Role Management: Improved role assignment logic in push_plain_term() and add_transformation() methods

Release v0.2.4

05 Sep 22:54

Choose a tag to compare

Added

  • Cleaned docs

Release v0.2.3

05 Sep 21:36

Choose a tag to compare

✨ Added

  • Enhanced Error Messages: Added colored, user-friendly error reporting with contextual information
    • Pretty-printed syntax errors show original formula, successful lexemes (green), and failed lexemes (red)
    • Clear "Expected Token:" labels with clean token names
    • Contextual display of parsing progress with colored highlighting using owo-colors
  • Improved Parser Error Context: Parse errors now include the exact position and context where parsing failed

🔧 Improved

  • Error Message Quality: Cleaned up error messages to show "Function or ColumnName" instead of "Function token or ColumnName"
  • Code Style: Eliminated clippy warnings throughout the codebase
    • Removed unnecessary to_string() calls in format strings
    • Converted instance methods to static methods where appropriate
    • Removed unnecessary return statements
    • Fixed redundant pattern matching in examples

🐛 Fixed

  • Error Display: Fixed duplicate and malformed error message formatting
  • Documentation: Removed duplicate doc comments and improved consistency

📚 Documentation

  • Error Handling: Updated parser documentation to reflect new pretty error functionality
  • Examples: Added comprehensive error testing examples demonstrating colored output

🧹 Code Quality

  • Dead Code: Eliminated all dead code warnings in main library
  • Clippy Compliance: Achieved zero clippy warnings for main library code
  • Performance: Optimized error formatting to avoid unnecessary string allocations

🔄 Internal Changes

  • Error Processing: Streamlined error handling pipeline to preserve original ParseError::Unexpected for better formatting
  • String Processing: Improved error message generation to be more efficient and readable

Example Output Format:

Syntax error- Unexpected Token
Formula: y ~ x +
Show: y ~ x + <eoi>
Expected Token: Function or ColumnName

These changes maintain backward compatibility while significantly improving the developer experience when working with formula parsing errors.

Release v0.2.1

04 Sep 17:26

Choose a tag to compare

just to trigger a new release

Release v0.1.6

04 Sep 02:59

Choose a tag to compare

Added

  • added more detailed doc output

Release v0.1.5

04 Sep 02:34

Choose a tag to compare

Added

  • spelling

Release v0.1.4

04 Sep 02:30

Choose a tag to compare

Added

  • new logo

Release v0.1.3

04 Sep 02:02

Choose a tag to compare

Removed

  • some toml keywords. only 5 allowed.