-
Notifications
You must be signed in to change notification settings - Fork 10
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
Vocab refresh: Update networkx
graphs
#883
base: develop
Are you sure you want to change the base?
Conversation
networkx
graphs
a79d2ad
to
efa55cd
Compare
@@ -375,23 +352,26 @@ def create_rel_graphs(save_to_pickle: bool) -> DiGraph: | |||
return G # , Gu | |||
|
|||
|
|||
def load_relationship_graph(save_if_not_exists=True): | |||
def is_graph_up_to_date(graph_path: str = GRAPH_PATH) -> bool: |
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.
FYI: is_graph_up_to_date()
# break # End of file reached | ||
timer(f'loading {graph_path}') | ||
up_to_date = True if not update_if_outdated else is_graph_up_to_date(GRAPH_PATH) | ||
if os.path.isfile(graph_path) and up_to_date: |
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.
If not true, triggers creation / save of new graph.
# d += 1 | ||
# n = p | ||
# raise Exception(f"can't find root for {node}") | ||
REL_GRAPH = load_relationship_graph() |
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.
Activates: On server start
Since this file gets imported during server start, this line runs.
# d += 1 | ||
# n = p | ||
# raise Exception(f"can't find root for {node}") | ||
REL_GRAPH = load_relationship_graph() |
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.
TODO: Activate on cron or hitting of home route
- Update: When app starts and also every time home route is hit, it will now update relationship_graph if it is out of date. General updates - Codestyle and comment updates - Moved some code that was causing PyCharm debugger to run tests inside of a non-test file.
efa55cd
to
19e8b58
Compare
addresses #856
DB Refresh: relationship_graph fix