Fix #116 and #129: label import bug and matplotlib backend conflict#176
Fix #116 and #129: label import bug and matplotlib backend conflict#176
Conversation
…ernal CSVs The old code used pd.read_csv(path, index_col=0) which assumes every CSV has a DEG-style unnamed numeric index column. External CSVs without one had their first data column silently consumed as the index. Now reads without index_col and explicitly detects/drops unnamed index columns. Added tests for DEG-style, external-no-index, and external-with-background CSV formats.
…ing functions The agg backend was set at import time in flow_generator/train.py, feature_extractor/train.py, and sequence/train.py. This killed interactive matplotlib for anyone importing these modules (e.g. in notebooks or scripts that call plt.show()). Moving the call inside the training functions preserves headless behavior during training while allowing interactive use when importing.
|
Claude finished @jbohnslav's task in 1m 38s —— View job Code Review
Both fixes are clean and address the root causes. A few observations below. Fix #116 —
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1d95860d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Fixes
Fix #116:
add_label_to_project()silently deletes first behavior columnThe old code used
pd.read_csv(path, index_col=0)which assumes every CSV has a DEG-style unnamed numeric index column. External CSVs without one had their first data column silently consumed as the index.Fix: Read without
index_coland explicitly detect/drop unnamed index columns.Tests added: Three new test cases covering DEG-style CSVs, external CSVs without index, and external CSVs with background but no index.
Fix #129: matplotlib backend conflict when importing training modules
plt.switch_backend('agg')was called at module level inflow_generator/train.py,feature_extractor/train.py, andsequence/train.py. This killed interactive matplotlib for anyone importing these modules in notebooks or scripts.Fix: Moved the call inside the training functions. Training still uses the
aggbackend; importing the module no longer overrides the user's backend.Testing
All 28 tests pass (
pytest -v -m 'not gpu'), including 3 new tests for #116.