-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ENH] Add new query param for nodes that defaults to a prepopulated index #30
Conversation
Pull Request Test Coverage Report for Build 6938616496
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alyssadai for this big PR. I left a couple of comments, mostly for clarity. Take a look.
Good to go otherwise: 🧑🍳
@@ -89,7 +96,7 @@ async def get_terms(data_element_URI: str): | |||
cross_node_results = [] | |||
params = {data_element_URI: data_element_URI} | |||
|
|||
for node_url in util.parse_nodes_as_dict(util.NEUROBAGEL_NODES).keys(): | |||
for node_url in util.FEDERATION_NODES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean that the get_terms
request will always go out to all known nodes, regardless of any subselection the user might have made? in other words, wouldn't we also want to restrict this by
node_urls : list[str]
List of Neurobagel nodes to send the query to.
as above in async def get
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened a separate issue for this
as I think this could benefit from some further discussion.
Right now, I think only the query tool uses this endpoint (/attributes/{data_element_URI}
) to get all the instances of a given controlled term like nb:Assessment
(across the known graphs) to populate the dropdown options for the UI. I imagine this would be separate from/before the user actually selects specific nodes in the app to send a query to - not sure if we want the query tool to have dynamically changing dropdown options as a result.
from typing import Optional, Union | ||
|
||
from pydantic import BaseModel | ||
from fastapi import Query | ||
from pydantic import BaseModel, Field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isort? mind opening an issue to add this to the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isort is already included in the precommit hooks for this repo! 🙂
federation-api/.pre-commit-config.yaml
Lines 25 to 29 in f85c44b
- repo: https://github.com/pycqa/isort | |
rev: 5.12.0 | |
hooks: | |
- id: isort | |
args: ["--profile", "black", "--filter-files"] |
I think this is the expected import order following
- standard library imports
- related third party imports
- local application/library specific imports
Co-authored-by: Sebastian Urchs <[email protected]>
🚀 PR was released in |
Changes proposed in this pull request:
Changes to existing code:
NB_NODES
environment variable renamed toLOCAL_NB_NODES
fed.env
to differentiate from the node API.env
fileLOCAL_NB_NODES
format in READMELOCAL_NB_NODES
updated to be whitespace-insensitive/
to URLs into a util function, reused belowNew code:
set
of the public nodes from https://github.com/neurobagel/menu/blob/main/node_directory/neurobagel_public_nodes.json and the local nodes/nodes/
endpoint updated to return values from federation indexChecklist
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see https://neurobagel.org/contributing/pull_requests for more info)Closes #XXXX
For new features:
For bug fixes: