bluesky / hklpy

Diffractometer computation library with ophyd pseudopositioner support
https://blueskyproject.io/hklpy
BSD 3-Clause "New" or "Revised" License
3 stars 11 forks source link

Refactor handling of libhkl to be a service #161

Open prjemian opened 3 years ago

prjemian commented 3 years ago

Currently, libhkl (the Hkl library) is integral to several modules (such as calc & sample) and is the central datastore of the crystallographic information (such as reflections, #143). Refactor so the hklpy Python code is the central datastore of all information. When needed, hklpy should identify which back-end (known as solver in #14) is to be used, then configure the back-end as needed.

This refactor will enable hklpy to call different back-end solvers, other than libhkl. An added benefit, eventually, will allow this code to run on systems where libhkl is not compiled.

prjemian commented 4 months ago

This issue is a central feature of hklpy2, the 2nd generation hklpy.

In hklpy2, solvers are identified as project entrypoints such as these examples:

[project.entry-points."hklpy2.solver"]
no_op = "hklpy2.backends.no_op:NoOpSolver"
hkl_soleil = "hklpy2.backends.hkl_soleil:HklSolver"
th_tth = "hklpy2.backends.th_tth_q:ThTthSolver"