|
46 | 46 | import numpy as np |
47 | 47 | import h5py |
48 | 48 |
|
49 | | -# Silence GPDM's module-level logger BEFORE importing the gpdm package. |
50 | | -# gpdm/core.py calls logging.basicConfig(level=INFO) at module load time, |
51 | | -# which would direct INFO messages to stderr. run_python() treats any stderr |
52 | | -# output as a fatal error, so we must set the level to CRITICAL before the |
53 | | -# import triggers basicConfig. |
| 49 | +# Silence GPDM's logger so no INFO messages reach stderr. |
| 50 | +# run_python() treats any stderr output as a fatal error. |
54 | 51 | logging.getLogger("gpdm").setLevel(logging.CRITICAL) |
55 | 52 |
|
56 | | -# Set matplotlib to non-interactive Agg backend before gpdm import, |
57 | | -# since gpdm/core.py imports matplotlib.pyplot at module load time. |
| 53 | +# Set matplotlib to non-interactive Agg backend before any plotting imports. |
58 | 54 | import matplotlib |
59 | 55 | matplotlib.use('Agg') |
60 | 56 |
|
@@ -344,8 +340,7 @@ def run_gpdm(params): |
344 | 340 | except Exception: |
345 | 341 | pass # non-fatal: analysis result still returned without image |
346 | 342 |
|
347 | | - # --- Step 6: Build grid response for the D3 visualization (termdb/gpdm) --- |
348 | | - # termdb/dmr ignores this; termdb/gpdm needs it for all 4 visualization panels. |
| 343 | + # --- Step 6: Build grid response for visualization --- |
349 | 344 | grid_df = analysis.to_dataframe() |
350 | 345 |
|
351 | 346 | def safe_list(arr): |
@@ -389,7 +384,7 @@ def safe_list(arr): |
389 | 384 | return { |
390 | 385 | 'status': 'ok', |
391 | 386 | 'dmrs': annot_dmrs, |
392 | | - 'naive_dmrs': [], # naive model not run; kept for termdb/gpdm client compatibility |
| 387 | + 'naive_dmrs': [], # naive model not run; placeholder for future use |
393 | 388 | 'grid': grid, |
394 | 389 | 'metadata': { |
395 | 390 | 'n_probes': int(len(positions)), |
@@ -442,7 +437,7 @@ def default(self, obj): |
442 | 437 | # - Always exit with code 0 (non-zero exit causes run_python to reject the result) |
443 | 438 | # |
444 | 439 | # Errors are communicated as {"error": "message"} in the JSON stdout so the |
445 | | - # Node route handler (termdb.gpdm.ts) can surface them to the client. |
| 440 | + # Node route handler (termdb.dmr.ts) can surface them to the client. |
446 | 441 | try: |
447 | 442 | # Read the complete stdin payload (run_python pipes the request body here) |
448 | 443 | input_data = sys.stdin.read() |
|
0 commit comments