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

Fast directory walk option #1093

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Fast directory walk option #1093

merged 2 commits into from
Jan 16, 2025

Conversation

AERAdler
Copy link
Contributor

Makes it possible to skip the slowest step in most update_obsdb runs, crawling the entire directory from base_dir to evaluate the age of each book. If running with the command-line option --fastwalk, the code will assume the dirs are are the form base_dir/obs|oper/17493 and will figure out which 5 number directories it needs to look into.

@AERAdler AERAdler requested a review from mhasself January 16, 2025 07:37
Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

abv_codes = np.arange(abv_tback, abv_tnow+1)
#Build the combinations base_dir/booktype/\d{5}
base_dir = [f"{os.path.join(x[0], x[1], str(x[2]))}" for x in product(base_dir, accept_type, abv_codes)]
logger.debug(f"Looking in the following directories only: {str(base_dir)}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this warning or info.

@AERAdler AERAdler merged commit 3dde22f into master Jan 16, 2025
3 checks passed
@AERAdler AERAdler deleted the tree_look_speedup branch January 18, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants