Add unit tests for loading_data.py and model.py - #4
Open
beta-devin-ai-integration[bot] wants to merge 4 commits into
Open
beta-devin-ai-integration[bot] wants to merge 4 commits into
beta-devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Co-Authored-By: Beta-Devin AI <248786709+beta-devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Beta-Devin AI <248786709+beta-devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Beta-Devin AI <248786709+beta-devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…ata) Co-Authored-By: Beta-Devin AI <248786709+beta-devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Raises unit test coverage from a single test file to 24 tests, without modifying any source behavior. Branched off
devin/1783062025-demo-prepso the CI workflow and existing tests are included.tests/test_loading_data.py— testsloading_FD001two ways:synthetic_cmapssfixture that writes tiny synthetictrain_FD001.txt/test_FD001.txt/RUL_FD001.txtfiles into a tmp dir andmonkeypatch.chdirs there (sinceloading_FD001reads./CMAPSSData/relative to cwd). Verifies return types, per-unit group sizes, dropped settings/sensors (s_1, s_5, s_6, s_10, s_16, s_18, s_19), min-max normalization to [0,1], piece-wise RUL (decreasing to 0, clipped at 125),y_testcontents, and no RUL column on the test set.CMAPSSData/files (100 units each in train/test/RUL).tests/test_model.py— pure-logic tests using tiny configs (d_model=16, no training): forward output shapes forTransformer,Gating,Encoder,EncoderLayer,MultiHeadAttention,FeedForward, and theattentionfunction;PositionalEncoderoutput verified against the sin/cos formula;get_clonesindependence;Normzero-mean output;Gating.init_weightsbounds; and a backward pass producing nonzero gradients.conftest.py— adds arepo_rootfixture (was an empty file; no behavior change)..github/workflows/ci.yml:pip install torch --index-url https://download.pytorch.org/whl/cpu) so the model tests run in CI.pandas<3: pandas 3 silently no-ops the chainedtrain_norm['RUL'].clip(upper=125, inplace=True)inloading_data.py, so RUL is no longer clipped. The repo'srequirements.txtpins pandas 1.x, so pinning CI (rather than changing source behavior) keeps this PR test-only.No source files were modified.
Link to Devin session: https://cognition.beta.devinenterprise.com/sessions/a50633ee4f7d422eaed79d5271b084d6
Requested by: @claudiahubert
Devin Review