-
Notifications
You must be signed in to change notification settings - Fork 5
Arax pathfinder #64
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
Merged
Merged
Arax pathfinder #64
Changes from 11 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
cba10f7
Using Pathfinder package with local sqlite files
mohsenht 5539e3d
Using Pathfinder package with mysql server
mohsenht cf94d6d
Settings for arax pathfinder
mohsenht 4999dff
Black style errors
mohsenht 767e51b
Black style errors
mohsenht 540f220
New pathfinder package release update.
mohsenht cd4cf5a
Inject shepherd-arax provenance in all edge sources field
mohsenht ce1a5e6
Temporary faster pathfinder by decreasing parameters
mohsenht 7cd663a
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht 8ec57a9
Arax Pathfinder tested with 4 hops
mohsenht 82852c4
Async Arax Pathfinder
mohsenht 6b537e5
Pathfinder package updated
mohsenht 9919306
Pathfinder package updated
mohsenht ab7049e
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht 4771f90
resolved conflicts
mohsenht 107614b
resolved conflicts
mohsenht 268d226
resolved conflicts
mohsenht c6b79c3
Update to latest main code
maximusunc f98c6e9
Run black
maximusunc 298aee5
PloverDB url updated to point to CI
mohsenht 17d4187
Merge remote-tracking branch 'origin/arax-pathfinder' into arax-pathf…
mohsenht 70758cb
PRUNE more
mohsenht b048766
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht 60b7d4a
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht a7ab6be
Async call
mohsenht d344b95
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht ebff3e6
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht a3eb40d
ARAX Pathfinder Package 2.4.3. Adaptable with Retriever
mohsenht 7bc9ba2
Auto download sqlite files for developers
mohsenht a3f35df
Merge branch 'main' of github.com:BioPack-team/shepherd into arax-pat…
mohsenht b823e96
redundant plover_url config removed.
mohsenht 5195035
ssh path generalized for all developers
mohsenht c699d27
readme correction
mohsenht cbd9ad5
Fetch sqlite files over Https instead of scp
mohsenht 7a0730f
arax_pathfinder_dbs git ignored
mohsenht d41090f
Run black
maximusunc ff282dc
Fix test import
maximusunc 8c26f47
Move arax_pathfinder onto a process pool and run_task_lifecycle
claude 78d17af
Add script for testing against pathfinder
maximusunc a782c5f
Set arax pathfinder resources
maximusunc e6ff46d
Merge pull request #137 from BioPack-team/claude/async-arax-pathfinde…
mohsenht 6fbd183
Add arax pathfinder to release
maximusunc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import uvicorn | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| uvicorn.run( | ||
| "shepherd_server.server:APP", | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Any, Dict | ||
|
|
||
|
|
||
| SHEPHERD_ARAX_SOURCE = { | ||
| "resource_id": "infores:shepherd-arax", | ||
| "resource_role": "aggregator_knowledge_source", | ||
| "source_record_urls": None, | ||
| "upstream_resource_ids": ["infores:arax"], | ||
| } | ||
|
|
||
|
|
||
| def add_shepherd_arax_to_edge_sources(trapi_response: Dict[str, Any]) -> Dict[str, Any]: | ||
| message = trapi_response.get("message") | ||
| if not isinstance(message, dict): | ||
| return trapi_response | ||
|
|
||
| kg = message.get("knowledge_graph") | ||
| if not isinstance(kg, dict): | ||
| return trapi_response | ||
|
|
||
| edges = kg.get("edges") | ||
| if not isinstance(edges, dict): | ||
| return trapi_response | ||
|
|
||
| for edge_id, edge_obj in edges.items(): | ||
| if not isinstance(edge_obj, dict): | ||
| continue | ||
|
|
||
| sources = edge_obj.get("sources") | ||
| if sources is None: | ||
| edge_obj["sources"] = [dict(SHEPHERD_ARAX_SOURCE)] | ||
| continue | ||
|
|
||
| if not isinstance(sources, list): | ||
| continue | ||
|
|
||
| already_present = any( | ||
| isinstance(s, dict) and s.get("resource_id") == "infores:shepherd-arax" | ||
| for s in sources | ||
| ) | ||
| if not already_present: | ||
| sources.append(dict(SHEPHERD_ARAX_SOURCE)) | ||
|
|
||
| return trapi_response |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Use RENCI python base image | ||
| FROM ghcr.io/translatorsri/renci-python-image:3.11.5 | ||
|
|
||
| # Add image info | ||
| LABEL org.opencontainers.image.source https://github.com/BioPack-team/shepherd | ||
|
|
||
| ENV PYTHONHASHSEED=0 | ||
|
|
||
| # set up requirements | ||
| WORKDIR /app | ||
|
|
||
| # make sure all is writeable for the nru USER later on | ||
| RUN chmod -R 777 . | ||
|
|
||
| # Install requirements | ||
| COPY ./shepherd_utils ./shepherd_utils | ||
| COPY ./pyproject.toml . | ||
| RUN pip install . | ||
|
|
||
| COPY ./workers/arax_pathfinder/requirements.txt . | ||
| RUN pip install -r requirements.txt | ||
|
|
||
| # switch to the non-root user (nru). defined in the base image | ||
| USER nru | ||
|
|
||
| # Copy in files | ||
| COPY ./workers/arax_pathfinder ./ | ||
|
|
||
| # Set up base for command and any variables | ||
| # that shouldn't be modified | ||
| # ENTRYPOINT ["uvicorn", "shepherd_server.server:APP"] | ||
|
|
||
| # Variables that can be overriden | ||
| CMD ["python", "worker.py"] |
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| catrax-pathfinder==1.1.1 | ||
| biolink-helper-pkg==1.0.0 |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.