Skip to content

Commit

Permalink
add template to creative debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed Nov 1, 2024
1 parent 9eabfa1 commit edadf52
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/batch_edge_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import call_api from '@biothings-explorer/call-apis';
import { redisClient } from '@biothings-explorer/utils';
import QEdge2APIEdgeHandler, { APIEdge } from './qedge2apiedge';
import NodesUpdateHandler from './update_nodes';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
const debug = Debug('bte:biothings-explorer-trapi:batch_edge_query');
import CacheHandler from './cache_handler';
import { threadId } from 'worker_threads';
Expand Down
2 changes: 1 addition & 1 deletion src/cache_handler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { redisClient } from '@biothings-explorer/utils';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
const debug = Debug('bte:biothings-explorer-trapi:cache_handler');
import { LogEntry, StampedLog } from '@biothings-explorer/utils';
import async from 'async';
Expand Down
2 changes: 1 addition & 1 deletion src/edge_manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import { LogEntry, StampedLog } from '@biothings-explorer/utils';
import BTEError from './exceptions/bte_error';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
const debug = Debug('bte:biothings-explorer-trapi:edge-manager');
import * as config from './config';
import BatchEdgeQueryHandler, { BatchEdgeQueryOptions } from './batch_edge_query';
Expand Down
2 changes: 1 addition & 1 deletion src/graph/graph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import kg_edge from './kg_edge';
import kg_node from './kg_node';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import { LogEntry, StampedLog } from '@biothings-explorer/utils';
import KGNode from './kg_node';
import KGEdge from './kg_edge';
Expand Down
2 changes: 1 addition & 1 deletion src/graph/knowledge_graph.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import {
TrapiAttribute,
TrapiKnowledgeGraph,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import QueryGraph from './query_graph';
import KnowledgeGraph from './graph/knowledge_graph';
import TrapiResultsAssembler from './results_assembly/query_results';
import InvalidQueryGraphError from './exceptions/invalid_query_graph_error';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
const debug = Debug('bte:biothings-explorer-trapi:main');
import Graph from './graph/graph';
import EdgeManager from './edge_manager';
Expand Down
5 changes: 3 additions & 2 deletions src/inferred_mode/inferred_mode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Debug from 'debug';
import { Debug, withDebugContext } from "@biothings-explorer/utils"
import {
biolink,
getUnique,
Expand Down Expand Up @@ -648,7 +648,8 @@ export default class InferredQueryHandler {
handler.setQueryGraph(queryGraph);
const failedHandlerLogs: { [index: number]: StampedLog[] } = {};
try {
await timeoutPromise(handler.query(AbortSignal.timeout(this.CREATIVE_TIMEOUT)), this.CREATIVE_TIMEOUT);
const query = withDebugContext(` Template-${i + 1}`, handler.query.bind(handler));
await timeoutPromise(query(AbortSignal.timeout(this.CREATIVE_TIMEOUT)), this.CREATIVE_TIMEOUT);
} catch (error) {
handler.logs.forEach((log) => {
log.message = `[Template-${i + 1}]: ${log.message}`;
Expand Down
2 changes: 1 addition & 1 deletion src/inferred_mode/pathfinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import InferredQueryHandler from './inferred_mode';
import { scaled_sigmoid, inverse_scaled_sigmoid } from '../results_assembly/score';
import * as utils from '@biothings-explorer/utils';
import { LogEntry, StampedLog, Telemetry, removeBioLinkPrefix } from '@biothings-explorer/utils';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import generateTemplates from './pf_template_generator';
import { enrichTrapiResultsWithPfocrFigures } from '../results_assembly/pfocr';
const debug = Debug('bte:biothings-explorer-trapi:pathfinder');
Expand Down
2 changes: 1 addition & 1 deletion src/qedge2apiedge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _ from 'lodash';
import { LogEntry, StampedLog } from '@biothings-explorer/utils';
import * as config from './config';
const CURIE_WITH_PREFIXES = ['MONDO', 'DOID', 'UBERON', 'EFO', 'HP', 'CHEBI', 'CL', 'MGI', 'NCIT'];
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import QEdge from './query_edge';
import MetaKG from '@biothings-explorer/smartapi-kg';
import { SmartAPIKGOperationObject } from '@biothings-explorer/smartapi-kg';
Expand Down
2 changes: 1 addition & 1 deletion src/query_edge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import helper from './helper';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import { Record, RecordNode, FrozenRecord } from '@biothings-explorer/api-response-transform';
import QNode from './query_node';
import { QNodeInfo } from './query_node';
Expand Down
2 changes: 1 addition & 1 deletion src/query_graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import QEdge from './query_edge';
import InvalidQueryGraphError from './exceptions/invalid_query_graph_error';
import * as utils from '@biothings-explorer/utils';
import { LogEntry, StampedLog } from '@biothings-explorer/utils';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import QNode from './query_node';
import { resolveSRI } from 'biomedical_id_resolver';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion src/query_node.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import _ from 'lodash';
import * as utils from '@biothings-explorer/utils';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import InvalidQueryGraphError from './exceptions/invalid_query_graph_error';
import { SRIBioEntity } from 'biomedical_id_resolver';
const debug = Debug('bte:biothings-explorer-trapi:QNode');
Expand Down
2 changes: 1 addition & 1 deletion src/results_assembly/pfocr.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
const debug = Debug('bte:biothings-explorer-trapi:pfocr');
import _ from 'lodash';
import { LogEntry, StampedLog, intersection, biolink, toArray, removeBioLinkPrefix } from '@biothings-explorer/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/results_assembly/query_results.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LogEntry, StampedLog } from '@biothings-explorer/utils';
import { TrapiResult } from '@biothings-explorer/types';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import { zip } from 'lodash';
const debug = Debug('bte:biothings-explorer-trapi:QueryResult');
import { getScores, calculateScore, ScoreCombos } from './score';
Expand Down
2 changes: 1 addition & 1 deletion src/results_assembly/score.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import axios from 'axios';
const debug = Debug('bte:biothings-explorer-trapi:score');
import os from 'os';
Expand Down
2 changes: 1 addition & 1 deletion src/update_nodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolveSRI } from 'biomedical_id_resolver';
import Debug from 'debug';
import { Debug } from "@biothings-explorer/utils";
import { ResolverInput, SRIResolverOutput } from 'biomedical_id_resolver';
import { Record } from '@biothings-explorer/api-response-transform';
import QEdge from './query_edge';
Expand Down

0 comments on commit edadf52

Please sign in to comment.