Closed kkaris closed 3 years ago
How do you guys feel about applying black/isort since this is basically a full re-write? would make it easier to keep a consistent style
:shipit:
Just discovered that I messed up something in the latest docs build off of dev/master
, basically nothing shows up: https://indra-network-search.readthedocs.io/en/latest/modules/query.html
Compare to the build from package
a month ago: https://indra-network-search.readthedocs.io/en/package/modules/query.html
I'll have to figure that out before merging.
Error in doc build:
...
File "/Users/cthoyt/dev/indra_network_search/indra_network_search/data_models/__init__.py", line 112, in <module>
class FilterOptions(BaseModel):
File "/Users/cthoyt/dev/indra_network_search/indra_network_search/data_models/__init__.py", line 115, in FilterOptions
stmt_filter: List[constr(to_lower=True)] = []
File "pydantic/types.py", line 246, in pydantic.types.constr
TypeError: constr() got an unexpected keyword argument 'to_lower'
Error in doc build:
... File "/Users/cthoyt/dev/indra_network_search/indra_network_search/data_models/__init__.py", line 112, in <module> class FilterOptions(BaseModel): File "/Users/cthoyt/dev/indra_network_search/indra_network_search/data_models/__init__.py", line 115, in FilterOptions stmt_filter: List[constr(to_lower=True)] = [] File "pydantic/types.py", line 246, in pydantic.types.constr TypeError: constr() got an unexpected keyword argument 'to_lower'
That seems very odd, the current version of pydantic has that keyword argument: https://pydantic-docs.helpmanual.io/usage/types/#arguments-to-constr
~Will hold off on merge until tox test, docs build and build branch is merged: #19~ Skipping #19
This PR finalizes the release of the new INDRA Network Search utilizing FastAPI for the backend and Vue.js for the frontend.
Main differences from previous service:
Structure of Repository
The modules are structured around the following components:
indra_network_search/rest_api.py
, uses FastAPI, which among other things allow for asynchronous handling of requests and comprehensive type checking of incoming requests.indra_network_search/data_models
use Pydantic's BaseModels and handle quick and easy data validation for incoming queries as well as outgoing results.indra_network_search/query.py
to handle the mapping of an incoming rest query to the options of that algorithm and also get relevant data from outside sources, e.g. curations or hashes associated with edges for mesh-context searches that are needed to run the query.indra_network_search/result_handler.py
that takes care of assembling and sometimes filtering the data and provide a structure that can be sent as JSON to the client running the frontend.indra_network_search/query_handler.py
is a class that takes an incoming rest query and figures out which query classes need to be instantiated and passed to the Python API.indra_network_search/search_api.py
. This API creates an interface for rest queries to the different graph algorithms.Vue.js Frontend
The frontend is built with Vue.js providing a better structure and easier development than raw JavaScript + HTML. One benefit over using Flask + Jinja templates is the complete independence from the service running the FastAPI server, making it possible to have less downtime and quick patching. The frontend is available in
indra_network_search/frontend
.