Skip to content

[core]: Error for missing kwargs in workunits - #434

Open
kennykos wants to merge 1 commit into
mainfrom
kennykos/workunit-kwarg-error
Open

[core]: Error for missing kwargs in workunits#434
kennykos wants to merge 1 commit into
mainfrom
kennykos/workunit-kwarg-error

Conversation

@kennykos

Copy link
Copy Markdown
Collaborator

Description

Report the workunit name and clarify that translation failed due to a missing keyword argument.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / code cleanup
  • Other:

Checklist

  • Code is formatted with black==25.12.0 (CI will enforce this)
  • Tests pass locally with python3 runtests.py
  • New or updated unit tests added in the test directory where applicable
  • Examples added in examples/pykokkos for large feature changes
  • PR title follows the module: feature naming convention

Testing

N/A

Additional Notes

N/A

Report the workunit name and clarify that translation
failed due to a missing keyword argument
@IvanGrigorik

Copy link
Copy Markdown
Collaborator

Can you add test / show how it works please?

@kennykos

Copy link
Copy Markdown
Collaborator Author

Can you add test / show how it works please?

When a keyword argument is missing, the message changes e.g. from
KeyError: 'cutoff'
to
KeyError: "workunit 'direct_reg_stokes3d_near_correction_fp64' missing keyword argument 'cutoff'"

I'm not sure we need a unit test as it just intercepts KeyError and makes the message more helpful, while leaving everything else unchanged.

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