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

[config] method to retrieve config object from a .poni object without creating a worker #2251

Open
EdgarGF93 opened this issue Aug 26, 2024 · 2 comments
Assignees
Labels
easy First contribution welcome

Comments

@EdgarGF93
Copy link
Collaborator

example:

from pyFAI.io.PoniFile import PoniFile
from pyFAI.io.integration_config import poni_to_config

poni_filename = "example.poni"
poni = PoniFile(poni_filename)
config = poni_to_config(poni)

equivalent method to

from pyFAI.worker import Worker
from pyFAI import load

ai = load(poni_filename)
worker = Worker(azimuthalIntegrator=ai)
config = worker.get_config()

to avoid instantiation of the worker

@EdgarGF93 EdgarGF93 self-assigned this Aug 26, 2024
@kif kif added the easy First contribution welcome label Aug 26, 2024
@kif
Copy link
Member

kif commented Aug 26, 2024

Why don't you add this as an export method to PoniFile ?

class PoniFile:
[...]
    def as_integration_config(self):
        [...]
        return config

@EdgarGF93
Copy link
Collaborator Author

We could do that, I was thinking about writing this method inside the worker module since it will contain all the possible keys for the worker (see #2252 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy First contribution welcome
Projects
None yet
Development

No branches or pull requests

2 participants