Skip to content

Conversation

@jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented May 8, 2025

Following the decision for unifying programming interfaces within the pyiron project.

Summary by CodeRabbit

  • New Features

    • Introduced a new stable API module for external use, providing a curated set of interfaces for command execution, communication, process management, and utilities.
  • Documentation

    • Updated documentation to recommend using the new API module for external imports instead of the previous module, clarifying the stable interface for users.
  • Refactor

    • Removed public exports from the previous module to consolidate and streamline the external API surface.

Following the [decision for unifying programming interfaces](https://github.com/pyiron/decisions/blob/main/decisions/25-001-split-api.md) within the pyiron project.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 8, 2025

Walkthrough

A new module, executorlib/api.py, is introduced to serve as the stable, semantically versioned external API for the library. The previous public exports from executorlib.standalone.__init__.py are removed, and documentation is updated to reference executorlib.api as the correct import path for external users.

Changes

File(s) Change Summary
executorlib/api.py New module providing a stable, explicitly enumerated external API surface by re-exporting selected internal functions and classes.
executorlib/standalone/init.py All public exports and import statements removed; now contains only the module docstring.
notebooks/4-developer.ipynb Documentation updated to reference executorlib.api instead of executorlib.standalone for stable external imports.

Sequence Diagram(s)

sequenceDiagram
    participant ExternalLibrary
    participant executorlib.api
    participant InternalModules

    ExternalLibrary->>executorlib.api: import (e.g. get_command_path, SocketInterface)
    executorlib.api->>InternalModules: Re-export selected functions/classes
    ExternalLibrary->>executorlib.api: Use stable API functions/classes
Loading

Possibly related PRs

  • Provide additional functions for import #639: Refactored the public API by adding the same set of functions and classes to executorlib.standalone.__init__.py exports; this PR moves those exports to executorlib.api.py, making their changes directly related.

Poem

In burrows deep, a change takes root,
APIs now wear a tailored suit.
No more confusion, the path is clear—
Use executorlib.api, bring stable cheer!
The old way’s gone, the docs agree,
Hopping forward, code runs free! 🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@codecov
Copy link

codecov bot commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.81%. Comparing base (58452ba) to head (2ac1cb0).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
- Coverage   96.83%   96.81%   -0.02%     
==========================================
  Files          30       29       -1     
  Lines        1294     1288       -6     
==========================================
- Hits         1253     1247       -6     
  Misses         41       41              

☔ 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
notebooks/4-developer.ipynb (1)

132-132: Minor: Improve consistency and hyperlinking.

Consider adding backticks or hyperlinks around executorlib.api (similar to earlier module references) and rephrase slightly for clarity and flow. For example:

- It is not recommended to import components from other parts of executorlib in other libraries, only the interfaces in `executorlib` and `executorlib.api` are designed to be stable.
+ It is not recommended to import components from other parts of executorlib in external projects; only the interfaces in `executorlib` and `executorlib.api` are guaranteed to be stable.
executorlib/api.py (2)

1-6: Fix docstring grammar and spelling.

There are typos and awkward phrasing (e.g., "inteface" → "interface" and missing punctuation). Suggest this diff:

- External application programming interface (API) following the semantic versioning this inteface is promised to remain
- stable during minor releases and any change in the interface leads to a major version bump. External libraries should
- only use the functionality in this API in combination with the user interface defined in the root __init__.py, all other
- functionality is considered internal and might change during minor releases.
+ External application programming interface (API) following semantic versioning; this interface is promised to remain
+ stable during minor releases, and any change to its contract will trigger a major version bump. External libraries
+ should only use the functionality in this API (and the user interface in the root `__init__.py`); all other
+ components are internal and may change without notice.

21-33: Explicit __all__ defines the public API.

Listing the exports here provides a clear contract for external consumers. Consider the following optional enhancements:

  • Alphabetize the entries for easier maintenance.
  • Introduce a __version__ attribute in this module to track the API schema version explicitly.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f59e6cb and 2ac1cb0.

📒 Files selected for processing (3)
  • executorlib/api.py (1 hunks)
  • executorlib/standalone/__init__.py (0 hunks)
  • notebooks/4-developer.ipynb (2 hunks)
💤 Files with no reviewable changes (1)
  • executorlib/standalone/init.py
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.12)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.11)
  • GitHub Check: unittest_mpich (macos-latest, 3.13)
  • GitHub Check: unittest_openmpi (macos-latest, 3.13)
  • GitHub Check: notebooks
  • GitHub Check: notebooks_integration
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.13)
  • GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-openmpi.yml)
  • GitHub Check: unittest_flux_mpich
  • GitHub Check: unittest_win
  • GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-mpich.yml)
  • GitHub Check: unittest_flux_openmpi
🔇 Additional comments (2)
notebooks/4-developer.ipynb (1)

119-119: Documentation updated to reflect new stable API module.

The reference to executorlib.api correctly aligns with the new external interface. Please ensure all other occurrences in the notebook (e.g., import statements in code cells) are updated accordingly.

executorlib/api.py (1)

8-19: Explicit imports reflect the stable API surface.

The module cleanly imports and re-exports only the intended functions and classes from internal submodules, which aligns well with the goal of a stable, semantically versioned API.

@jan-janssen jan-janssen merged commit bac1a92 into main May 8, 2025
91 of 99 checks passed
@jan-janssen jan-janssen deleted the api branch May 8, 2025 07:35
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.

2 participants