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

(WIP) LIU-392: Enable per-port serailisation #300

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

(WIP) LIU-392: Enable per-port serailisation #300

wants to merge 3 commits into from

Conversation

myxie
Copy link
Collaborator

@myxie myxie commented Dec 6, 2024

…t values.

JIRA Ticket

LIU-392 (https://icrar.atlassian.net/browse/LIU-392)

Type

  • Feature (addition)
  • Bug fix
  • Refactor (change)
  • Documentation

Problem/Issue

Screenshot from 2024-11-06 17-51-11

Solution

image

Checklist

  • Unittests added
    • Reason for not adding unittests (remove this line if added)
  • Documentation added
    • Reason for not adding documentation (remove this line if added)

Summary by Sourcery

Enable per-port serialization and refactor input/output port handling for improved clarity.

New Features:

  • Enable per-port serialization for input and output ports in the application.

Enhancements:

  • Refactor the handling of input and output ports to improve code clarity and maintainability.

Copy link
Contributor

sourcery-ai bot commented Dec 6, 2024

Reviewer's Guide by Sourcery

This PR implements per-port serialization by refactoring how input and output ports are handled in the Python function application. The changes modify the port argument processing to work directly with drops instead of pre-loading all input data, enabling more efficient handling of large datasets and providing better control over data serialization.

Class diagram for updated port handling in Python function application

classDiagram
    class PyFunc {
        - _inputs
        - _outputs
        - parameters
        - fn_nargs
        - fn_nkw
        - argnames
        - input_parser
        - output_parser
        + _ports2args(inputs, outputs, posargs, pargsDict, keyargsDict) dict
        + run()
    }
    note for PyFunc "Refactored to handle per-port serialization and direct drop handling"
Loading

File-Level Changes

Change Details Files
Refactored port argument processing to work directly with drops
  • Replaced pre-loading of all input data with direct drop handling
  • Added input parser function application at the individual port level
  • Updated port dictionary structure to include drop objects directly
  • Removed bulk input content loading in the run method
daliuge-engine/dlg/apps/pyfunc.py
Enhanced output port handling with improved path management
  • Modified output dictionary creation to include drop path conditionally
  • Added drop reference to output port configuration
  • Updated path handling to check for path attribute existence
daliuge-engine/dlg/apps/pyfunc.py
Improved fallback handling for unnamed ports
  • Added length checking for unnamed input ports
  • Updated fallback port processing to use input parser function
  • Modified index-based port mapping to work with drop objects
daliuge-engine/dlg/apps/pyfunc.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@myxie myxie changed the title LIU-392: Enable per-port serailisation (WIP) LIU-392: Enable per-port serailisation Dec 6, 2024
@coveralls
Copy link

Coverage Status

coverage: 79.818% (+0.02%) from 79.795%
when pulling da7bca6 on LIU-392
into 20b29ec on master.

This commit has established per-commit encoding, whilst also updating/clarifying/polishing some existing PyFunc and Translator code.
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