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

Better dict-like interface for WorkerConfig dataclass #2425

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/pyFAI/io/integration_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "31/01/2025"
__date__ = "03/02/2025"
__docformat__ = 'restructuredtext'

import sys
Expand Down Expand Up @@ -675,6 +675,12 @@ def __setitem__(self, key, value):
@decorators.deprecated(reason="WorkerConfig now dataclass, no more a dict", replacement=None, since_version="2025.01")
def __getitem__(self, key):
return self.__getattribute__(key)
@decorators.deprecated(reason="WorkerConfig now dataclass, no more a dict", replacement=None, since_version="2025.01")
def get(self, key, default=None):
try:
return self.__getattribute__(key)
except:
return default

# @dataclass(slots=True)
# class PixelwiseWorkerConfig:
Expand Down