-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor #597
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Enhanced `Job` model with `is_terminal`, `is_successful`, and `is_failed` properties. - Added `list_by_site` and `async_list_by_site` to `SubjectsEndpoint` for site-based filtering. - Added validation to `FormDesignerClient.save_form` for `form_id`, `community_id`, `revision`, and `csrf_key`. - Added unit tests in `tests/unit/test_tui_migration.py`. - Removed `imednet/tui` directory. - Removed `textual` dependency.
Migrated business logic from the deprecated TUI into the core SDK: - `Job` model: Added `is_terminal`, `is_successful`, `is_failed` properties. - `SubjectsEndpoint`: Added `list_by_site` and `async_list_by_site` for filtering. - `FormDesignerClient`: Added input validation to `save_form`. Removed the TUI application: - Deleted `imednet/tui` directory. - Removed `textual` dependency from `pyproject.toml`. - Updated CLI and examples to reflect removal. Added verification tests in `tests/unit/test_tui_migration.py`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Frederick de Ruiter <127706008+fderuiter@users.noreply.github.com>
Refactors `ListGetEndpointMixin` in `imednet/endpoints/_mixins.py` to: - Enforce strict typing using `TypeVar`, `Protocol`, and generics. - Decompose `_list_impl` into smaller, focused methods (`_prepare_list_params`, `_execute_sync_list`, `_execute_async_list`). - Separate sync and async execution paths to avoid runtime type checking. - Updates `BaseEndpoint` to remove dead code (`_fallback_from_list`) and improve typing. - Updates `UsersEndpoint` to strict typing. - Adds `.jules/architect.md` for architectural decision logging.
Refactors `ListGetEndpointMixin` in `imednet/endpoints/_mixins.py` to: - Enforce strict typing using `TypeVar`, `Protocol`, and generics. - Decompose `_list_impl` into smaller, focused methods (`_prepare_list_params`, `_execute_sync_list`, `_execute_async_list`). - Separate sync and async execution paths to avoid runtime type checking. - Updates `BaseEndpoint` to remove dead code (`_fallback_from_list`) and improve typing. - Updates `UsersEndpoint` to strict typing. - Adds `.jules/architect.md` for architectural decision logging. - Formatted with black.
Reformatted the file using black to comply with project coding standards.
…ct.iscoroutinefunction patterns Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
… imports Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request removes the Textual-based Terminal User Interface (TUI) from the codebase and migrates key TUI logic into the core SDK and CLI. It also introduces several improvements to the SDK, including new subject filtering methods, improved job state checks, and enhanced validation for form submissions. The most important changes are summarized below.
Removal of TUI Functionality
imednet/tui/app.py,imednet/tui/form_builder.py) have been fully deleted, and thetextualdependency has been removed frompyproject.toml. Users are now directed to use CLI commands instead. [1] [2] [3]imednet/cli/__init__.py) and example scripts (examples/build_form_payload.py) have been replaced with messages indicating TUI mode is no longer available. [1] [2]Migration and Enhancement of Business Logic
list_by_siteandasync_list_by_sitemethods on theSubjectsEndpointin the SDK, improving accessibility and testability.SDK Improvements
Jobmodel now includesis_terminal,is_successful, andis_failedproperties for easier job state checks, migrated from TUI logic.save_formmethod inFormDesignerClientnow includes input validation for CSRF key, form ID, community ID, and revision, ensuring errors are caught early. This logic was migrated from the TUI.Minor Improvements
List) toimednet/endpoints/subjects.pyfor type annotations.