Skip to content

Refactor parser#25

Merged
superstar54 merged 2 commits intomainfrom
custom_inputs
Mar 26, 2025
Merged

Refactor parser#25
superstar54 merged 2 commits intomainfrom
custom_inputs

Conversation

@superstar54
Copy link
Member

@superstar54 superstar54 commented Mar 26, 2025

  • rename function_outputs to output_ports
  • add support for input_ports
  • PyFunction and PythonJob share the helper parser function.

@superstar54 superstar54 force-pushed the custom_inputs branch 3 times, most recently from 122a74e to 02835b3 Compare March 26, 2025 17:28
@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 91.62562% with 17 lines in your changes missing coverage. Please review.

Project coverage is 87.71%. Comparing base (81f97f9) to head (c6f9fa8).

Files with missing lines Patch % Lines
src/aiida_pythonjob/utils.py 90.90% 11 Missing ⚠️
src/aiida_pythonjob/calculations/pyfunction.py 85.18% 4 Missing ⚠️
src/aiida_pythonjob/data/utils.py 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   85.57%   87.71%   +2.13%     
==========================================
  Files          16       17       +1     
  Lines         929      944      +15     
==========================================
+ Hits          795      828      +33     
+ Misses        134      116      -18     

☔ 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

Copilot AI left a 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 refactors the parser interface by renaming the output‐related keys from function_outputs to output_ports and adding support for input_ports. In addition, it shares the helper parser function between PyFunction and PythonJob and updates related tests and documentation for consistency.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/aiida_pythonjob/utils.py Introduces helper functions for formatting and serializing input/output ports.
src/aiida_pythonjob/calculations/pyfunction.py Updates process specification to use output_ports instead of deprecated outputs key.
tests/test_pyfunction.py Adjusts tests to use the new output_ports parameter instead of function_outputs.
tests/test_parser.py Modifies tests to validate output_ports handling in the parser.
docs/gallery/autogen/* Updates documentation examples replacing function_outputs with output_ports.
Other files Various helper functions, decorators, and utilities updated accordingly for consistency.
Comments suppressed due to low confidence (3)

src/aiida_pythonjob/utils.py:259

  • [nitpick] Consider using a consistent uppercase default for 'identifier' (e.g., 'ANY') to match comparisons elsewhere in the code.
item.setdefault("identifier", "any")

tests/test_pyfunction.py:55

  • Ensure test inputs consistently use 'output_ports' instead of the deprecated 'function_outputs' to align with the updated API.
output_ports=[{"name": "sum"}, ...]

src/aiida_pythonjob/calculations/pyfunction.py:46

  • The change from 'function_data.outputs' to 'function_data.output_ports' improves clarity; ensure that corresponding documentation and error messages are updated accordingly.
spec.input("function_data.output_ports", valid_type=Dict, serializer=to_aiida_type, required=False)

@superstar54 superstar54 merged commit 7a93ee9 into main Mar 26, 2025
5 checks passed
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.

3 participants