Skip to content
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

fix!: clean up JS APIs #135

Merged
merged 8 commits into from
Oct 18, 2024
Merged

fix!: clean up JS APIs #135

merged 8 commits into from
Oct 18, 2024

Conversation

sd2k
Copy link
Collaborator

@sd2k sd2k commented Oct 16, 2024

This PR makes a bunch of breaking changes to the Javascript
bindings to make them a bit more comfortable to use.

The main changes are:

  • All the types are prefixed with Prophet to avoid cluttering the
    exported namespace.
  • SeasonalityOption is now a nicer-to-use union type.
  • The results on the ProphetPrediction share the same type as
    other forecasters.

Commits:

  • fix! re-use ForecastIntervals types in JS bindings
  • fix!: use tagged enums with struct variants for SeasonalityOption
  • Add Prophet prefix to all types to avoid cluttering namespace too much

Summary by CodeRabbit

  • New Features

    • Introduced a new GitHub Actions workflow for automating testing processes.
    • Added logging capabilities and enhanced type handling for JavaScript interoperability.
    • Implemented new changepoint detection methods and improved error handling.
    • Enhanced Dynamic Time Warping (DTW) functionality with new distance metrics.
    • Added a trend forecasting mechanism to the MSTL model.
    • Introduced new outlier detection algorithms with updated data handling.
  • Bug Fixes

    • Improved error handling across various methods and functionalities.
  • Tests

    • Added comprehensive unit tests for various components, including changepoint detection, clustering, DTW, AutoETS, MSTL, outlier detection, and Prophet class.
  • Documentation

    • Updated TypeScript configuration for better development and type checking.

@sd2k sd2k force-pushed the clean-up-js-apis branch from abca231 to a088e30 Compare October 17, 2024 22:48
@sd2k sd2k force-pushed the clean-up-js-apis branch from a18af40 to 48aa774 Compare October 17, 2024 22:52
@sd2k sd2k marked this pull request as ready for review October 18, 2024 08:14
Copy link
Contributor

coderabbitai bot commented Oct 18, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

A new GitHub Actions workflow file named js.yml has been added to automate testing for the augurs-js project. This workflow triggers on pushes to the main branch and on pull requests, setting up an environment for building, type checking, and testing the project. Additionally, several files have been modified to enhance functionality, including updates to Cargo.toml, various Rust source files, and the introduction of new test files for comprehensive unit testing of the project's features.

Changes

File Path Change Summary
.github/workflows/js.yml New workflow file added to automate testing for the augurs-js project, including setup for Rust and Node.js environments.
crates/augurs-js/Cargo.toml Updated features and dependencies, added new default and logging features, and modified wasm-pack profile options.
crates/augurs-js/src/changepoints.rs Enhanced ChangepointDetector struct with new enum and updated method signatures for error handling.
crates/augurs-js/src/dtw.rs Improved DTW functionality with new enum for distance functions and updated method signatures for better error handling.
crates/augurs-js/src/ets.rs Updated AutoETS struct methods for error handling and input data type changes.
crates/augurs-js/src/lib.rs Introduced new module for logging and custom types for JavaScript interoperability.
crates/augurs-js/src/logging.rs New file for logging utilities in WebAssembly, including configuration and initialization functions.
crates/augurs-js/src/mstl.rs Enhanced MSTL model functionality with new trend forecasting mechanism and updated method signatures.
crates/augurs-js/src/outlier.rs Major modifications to OutlierDetector for unified data handling and method signature updates.
crates/augurs-js/src/prophet.rs Significant updates to the Prophet model for improved structure and functionality.
crates/augurs-js/src/seasons.rs Updated seasonalities function to handle errors and accept new data types.
crates/augurs-js/testpkg/.gitignore Updated to ignore node_modules directory.
crates/augurs-js/testpkg/changepoints.test.ts New unit tests for ChangepointDetector class, validating detection methods and input handling.
crates/augurs-js/testpkg/clustering.test.ts New unit tests for DbscanClusterer, covering various input types and clustering functionality.
crates/augurs-js/testpkg/dtw.test.ts New unit tests for Dtw class, validating distance calculations and error handling.
crates/augurs-js/testpkg/ets.test.ts New unit tests for AutoETS class, covering instantiation, fitting, and prediction functionalities.
crates/augurs-js/testpkg/logging.test.ts New unit tests for logging functionality, validating initialization behavior under various conditions.
crates/augurs-js/testpkg/mstl.test.ts New unit tests for MSTL class, validating instantiation and fitting functionalities.
crates/augurs-js/testpkg/outlier.test.ts New unit tests for OutlierDetector, validating DBSCAN and MAD algorithms.
crates/augurs-js/testpkg/package.json New package.json file created for @bsull/augurs-js-testpkg, specifying dependencies and scripts.
crates/augurs-js/testpkg/prophet.test.ts New unit tests for Prophet class, covering instantiation and prediction functionalities.
crates/augurs-js/testpkg/seasons.test.ts New unit tests for seasonalities function, validating output for different input types.
crates/augurs-js/testpkg/tsconfig.json New TypeScript configuration file created for the test package.
justfile New target added for building augurs-js with wasm-pack, and modified publish-npm target to depend on the new build target.

Possibly related PRs

"In the meadow where rabbits play,
New tests and workflows brighten the day.
With changepoints detected and models so fine,
Our code hops forward, a joyful design!
Let's celebrate with a leap and a cheer,
For every new feature brings us near!" 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sd2k sd2k merged commit 7fe33a8 into main Oct 18, 2024
22 checks passed
@sd2k sd2k deleted the clean-up-js-apis branch October 18, 2024 08:14
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