feat: Add constrained search tutorial#37
Conversation
programs/constrained_search/utils/sequential_threshold_processing.py
Outdated
Show resolved
Hide resolved
| def get_micrograph_id(filename: str) -> str: | ||
| """ | ||
| Extract micrograph ID from filename. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| filename : str | ||
| Filename to extract micrograph ID from | ||
|
|
||
| Returns | ||
| ------- | ||
| micrograph_id : str | ||
| Micrograph ID | ||
| """ | ||
| base_name = os.path.basename(filename) | ||
| # Extract the part before _results.csv | ||
| parts = base_name.split("_results.csv")[0] | ||
| return parts |
There was a problem hiding this comment.
This can actually be grabbed from the micrograph column in the csv file rather than assuming some relative naming scheme between the results file and the micrograph
There was a problem hiding this comment.
By 'micrograph_id' I'm not meaning micrograph. It's the base of all the results files. By extracting it from a results file directly, the results file does not need to have the same base as the micrograph. It does however assume that the results file ends in results.csv.
I could add an option to specify the suffix.
I could also rename the variable for more clarity.
| def process_directories_sequentially( | ||
| directory_list: list[str], |
There was a problem hiding this comment.
This function is fairly complex and difficult to follow what each part is doing. Should be split up into functional blocks (actually processing the data) and parts which print out some helpful information.
|
Some other things I found when running through the tutorial are
|
There was a problem hiding this comment.
Once the example notebook under docs is completed, this file should be deleted
Fixed name error in example config
Added notebook for constrained search tutorial.
Added a utility script to process successive constrained search results.