Fix path resolution for configs and cache#1
Open
cjmielke wants to merge 5 commits intomahmoodlab:mainfrom
Open
Fix path resolution for configs and cache#1cjmielke wants to merge 5 commits intomahmoodlab:mainfrom
cjmielke wants to merge 5 commits intomahmoodlab:mainfrom
Conversation
include conf dir in installed package
Find config.yaml in installed library path
need cache too for organs.json
Find organ_ids.json in installed package
whoops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi MahmoodLab! SEAL is great work as usual, and thanks for the HuggingFace approval!
We noticed that the library relies on hard-coded relative paths (e.g., conf/config.yaml and cache/organ_ids.json). While this works perfectly when running scripts directly from the root of the cloned repository, it causes FileNotFoundErrors for users who install the package via pip and import it elsewhere.
This PR makes the library fully usable as an installed Python package while strictly preserving the existing behavior for local development and cluster deployments.
Changes Made:
Updated pyproject.toml: Configured the build system to include the conf/ and cache/ directories so they are bundled with the installed package.
Added Fallback Path Resolution: Refactored the file loading logic (e.g., in load_img_model_from_checkpoint and find_organ_ids) using pathlib. The code now dynamically checks for the files in two places: