-
Notifications
You must be signed in to change notification settings - Fork 0
[Workflow API] Enable support for Importing helper utilities in FederatedRuntime notebooks #6
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
base: develop
Are you sure you want to change the base?
Conversation
ishant162
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks OK but some error handling needs to be done to make it more robust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances FederatedRuntime notebook support by enabling user-defined helper utilities to be imported and executed remotely.
- Update workspace context manager to include both the experiment directory and its
srcsubdirectory insys.path. - Extend
CodeAnalyzerto detect user-defined imports in the generated script and copy the corresponding.pyfiles or packages into the workspace. - Add helper methods for checking and resolving module paths.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| openfl/utilities/workspace.py | Enhanced __enter__/__exit__ to manage src directory on sys.path. |
| openfl/experimental/workflow/notebooktools/code_analyzer.py | Implemented __extract_user_defined_imports, __copy_user_defined_modules, _is_user_defined_module, and _get_module_paths; updated imports and type hints. |
Comments suppressed due to low confidence (1)
openfl/experimental/workflow/notebooktools/code_analyzer.py:92
- Add unit tests for
__extract_user_defined_importsand__copy_user_defined_modulesto verify correct detection of user modules, including edge cases like nested packages, missing files, and different import styles.
def __extract_user_defined_imports(self, notebook_path) -> List[str]:
ishant162
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Please check the copilot review comments and incorporate if they make sense
Signed-off-by: refai06 <refai.ahamed06@gmail.com>
Signed-off-by: refai06 <refai.ahamed06@gmail.com>
Signed-off-by: refai06 <refai.ahamed06@gmail.com>
cf15e62 to
e40a28f
Compare
Summary
This PR addresses issue securefederatedai#1565 by enabling the import of user-defined helper functions and utilities from separate Python scripts in
FederatedRuntimenotebooks.Type of Change (Mandatory)
Specify the type of change being made.
Description (Mandatory)
PR enhances the
CodeAnalyzerto support importing user-defined helper modules inFederatedRuntimenotebooks by.pyfiles or packages togenerated_workspace/src.Testing