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

aiida/common/progress_reporter.py could accept **kwargs #6564

Open
khsrali opened this issue Sep 18, 2024 · 0 comments
Open

aiida/common/progress_reporter.py could accept **kwargs #6564

khsrali opened this issue Sep 18, 2024 · 0 comments

Comments

@khsrali
Copy link
Contributor

khsrali commented Sep 18, 2024

This is particularly useful, when unit and unit_scale is to be set during a callback.
see:
aiidateam/disk-objectstore#171 & #6562

An ideal use case would be:

# in aiida-core
with get_progress_reporter()(total=1) as progress:
  callback = create_callback(progress)
  external_function(.., callback=callback)

# some other package
def external_function(.., callback=callback):
  ..
  callback(
      action="init",
      value={
          "total": 10,
          "description": "my_description",
          "unit": 'B'          #**kwargs
          "unit_scale": 1024   #**kwargs
      },
  )
@khsrali khsrali added the type/feature request status undecided label Sep 18, 2024
@khsrali khsrali changed the title aiida-core/src/aiida/common/progress_reporter.py could accept **kwargs aiida/common/progress_reporter.py could accept **kwargs Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants