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

make util.list_orientation_runs() faster #243

Open
prjemian opened this issue Jun 28, 2022 · 0 comments
Open

make util.list_orientation_runs() faster #243

prjemian opened this issue Jun 28, 2022 · 0 comments
Assignees
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

Execution time of util.list_orientation_runs() is proportional to catalog size. On one workstation, 10 runs/second is typical since this code must be executed for every run to be checked:

hklpy/hkl/util.py

Lines 306 to 315 in f91c18d

run_conf = run.primary.config
for device in sorted(run_conf):
conf = run_conf[device].read()
if f"{device}_orientation_attrs" in conf:
# fmt:off
devices[device] = {
item[len(device)+1:]: conf[item].to_dict()["data"][0]
for item in conf
}
# fmt:on

Significant optimization is possible by adding a key to the start document metadata that describes if orientation info is available and for what geometries. A use_md_key=True kwarg (default) to util.list_orientation_runs() would support the new key. Old-style search would still be possible by setting use_md_key=False.

@prjemian prjemian added this to the v1.1 milestone Jun 28, 2022
@prjemian prjemian self-assigned this Jun 28, 2022
@prjemian prjemian modified the milestones: v1.2, v2.0 Nov 1, 2023
@prjemian prjemian added the hklpy2 For hklpy2 label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant