Skip to content

Ruby 4#550

Open
lomefin wants to merge 2 commits intoSciRuby:masterfrom
lomefin:ruby-4
Open

Ruby 4#550
lomefin wants to merge 2 commits intoSciRuby:masterfrom
lomefin:ruby-4

Conversation

@lomefin
Copy link

@lomefin lomefin commented Feb 27, 2026

No description provided.

Port the fork to MRI Ruby 4.0.1 and make the default spec suite pass without pending examples.

Toolchain and dependency updates:
- add mise.toml with ruby = "4.0.1" for reproducible local setup
- add runtime dependencies on stdlib gems that are explicit on modern Ruby (matrix, csv)
- add missing development deps used by specs (prime, mutex_m, benchmark)
- make gruff opt-in via DARU_TEST_GRUFF to avoid forcing ImageMagick/rmagick on default runs

Core compatibility and behavior fixes:
- add Daru::Core::GroupBy#[] for scalar and tuple-style group retrieval
- make DataFrame#group_by_and_aggregate accept both keyword and legacy hash calling forms
- fix index deduction for mixed/non-comparable index values by preserving insertion order when sorting is not possible
- prevent vector aliasing during dataframe initialization by duplicating per-vector sources in update_data
- honor configurable Daru::DateTimeIndex.format using DateTime.strptime when present
- update CSV APIs for modern keyword argument handling and switch URL reads to URI.open
- improve plaintext fixed-width parsing to preserve empty middle fields
- make vector arithmetic robust for mixed index types by guarding sort errors
- fix Vector#delete_at to delete by resolved positional index consistently

SQL and optional integration handling:
- add sqlite3-native adapter support in SqlDataSource for file path sources
- keep DBI/ActiveRecord adapters, with explicit adapter type detection
- fail unsupported sqlite file inputs with clear argument errors

Test suite modernization:
- convert remaining pending blocks into executable assertions across GroupBy, DataFrame, DateTimeIndex, and Vector specs
- add/adjust MultiIndex expectations for alignment, row assignment, conversion, and sorting behavior
- make optional backends and integrations metadata-driven (:sql, :dbi, :rserve, :gsl, :nmatrix, :gruff)
- add capability probes for sqlite-backed ActiveRecord and DBI integration specs, so unavailable stacks are reported as skipped/pending instead of hard failures
- make Rserve specs skip cleanly when the daemon is not available

Validation:
- default suite on Ruby 4.0.1 passes: 2329 examples, 0 failures
- optional suites now run in capability-aware mode and report unavailable external stacks explicitly
Update project documentation to match the Ruby 4.0.1 baseline and the new optional-test execution model.

README updates:
- replace the legacy tested-rubies note (2.5/2.7) with the current MRI 4.0.1 baseline
- add a Development Setup section with mise trust/use + bundle install + default rspec run
- document explicit commands for optional tagged suites (sql, dbi, rserve, gsl, nmatrix, gruff)

CONTRIBUTING updates:
- add a Ruby toolchain section centered on mise + Ruby 4.0.1
- clarify that acceleration backends and integration stacks are optional for default development
- list optional stack prerequisites and external dependencies at a high level
- provide direct commands for running default and optional tagged suites
- remove outdated guidance that implied pending examples are expected in the default suite

History updates:
- add an Unreleased section summarizing the Ruby 4 port, compatibility fixes, and test-matrix modernization

Why this matters:
- new contributors can reproduce the exact toolchain immediately
- maintainers have explicit commands for core vs optional checks
- release notes now reflect the current state of the fork instead of historical Ruby targets
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.

1 participant