Releases: alexhallam/fiasto
Releases · alexhallam/fiasto
Release v0.2.7
✨ Added
- Multi-way Interaction Support: Complete implementation of multi-way interactions (e.g.,
x1*x2*x3) with canonical expansion - InteractionTerm Role: Added new
InteractionTermrole toVariableRoleenum 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.rsexample 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
Categoricalrole toVariableRoleenum for categorical variables - Test Example: Added
test_categorical_function.rsexample demonstrating categorical function usage
🔧 Improved
- Interaction Parsing: Completely rewritten
push_interactionmethod to handle nested interaction structures - Variable Extraction: New
extract_all_variablesmethod 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*x3was 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
InteractionTermandFixedEffectroles - Metadata Structure: Each variable includes comprehensive interaction metadata with order, context, and participating variables
Release v0.2.6
✨ Added
- Multi-way Interaction Support: Complete implementation of multi-way interactions (e.g.,
x1*x2*x3) with canonical expansion - InteractionTerm Role: Added new
InteractionTermrole toVariableRoleenum 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.rsexample demonstrating 2-way, 3-way, and 4-way interactions
🔧 Improved
- Interaction Parsing: Completely rewritten
push_interactionmethod to handle nested interaction structures - Variable Extraction: New
extract_all_variablesmethod 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*x3was 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
InteractionTermandFixedEffectroles - Metadata Structure: Each variable includes comprehensive interaction metadata with order, context, and participating variables
Release v0.2.5
✨ Added
- Identity Role for Plain Terms: Added new
Identityrole toVariableRoleenum for variables that appear as plain terms in formulas (e.g.,xiny ~ x) - Intercept Column Support: Added automatic inclusion of
"intercept"column inall_generated_columnswhenhas_interceptis true - Formula Order Mapping: Added new
all_generated_columns_formula_orderfield that maps formula order (1, 2, 3...) to column names - Intercept-Only Model Support: Added support for intercept-only models like
y ~ 1and no-intercept models likey ~ 0with newTerm::InterceptandTerm::Zerovariants - Multivariate Model Support: Added support for multivariate response models like
bind(y1, y2) ~ xwith newResponse::Multivariatevariant andbind()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
Identityrole instead ofFixedEffectrole - Generated Columns Preservation: Variables with
Identityrole 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 ~ 1andy ~ 0formulas - Issue #3: Added multivariate model support with
bind()function for multiple response variables - Issue #4: Fixed plain terms not receiving proper
Identityrole when appearing alone in formulas - Issue #6: Fixed missing intercept column in
all_generated_columnsand 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_interceptis true and absent when false - Order Validation: Tests verify correct column ordering in both
all_generated_columnsandall_generated_columns_formula_order - Intercept-Only Models: Tests verify
y ~ 1andy ~ 0formulas work correctly with proper metadata generation - Multivariate Models: Tests verify
bind(y1, y2) ~ xformulas work correctly with multiple response variables - Error Handling: Tests verify invalid syntax like
y ~ 1 - 1andy ~ 0 + 1fails appropriately
🔄 Internal Changes
- AST Enhancement: Added new
Term::Intercept,Term::Zerovariants andResponse::Multivariateenum to support intercept-only, no-intercept, and multivariate models - Parser Updates: Enhanced
parse_term()to recognizeToken::OneandToken::Zeroas valid terms, andparse_response()to handlebind()function calls - Syntax Validation: Added validation to prevent contradictory syntax like
y ~ 1 - 1and invalid combinations likey ~ 0 + 1 - MetaBuilder Enhancement: Updated
build()method to handle intercept insertion and formula order mapping, andpush_response()to handle multivariate responses - Data Structure Updates: Enhanced
FormulaMetaDatastruct with newall_generated_columns_formula_orderfield - Role Management: Improved role assignment logic in
push_plain_term()andadd_transformation()methods
Release v0.2.4
Added
- Cleaned docs
Release v0.2.3
✨ 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
- Removed unnecessary
🐛 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::Unexpectedfor 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
just to trigger a new release
Release v0.1.6
Added
- added more detailed doc output
Release v0.1.5
Added
- spelling
Release v0.1.4
Added
- new logo
Release v0.1.3
Removed
- some toml keywords. only 5 allowed.