Merge RBMDataSet and RBMDataSetElPaso into unified class#33
Merge RBMDataSet and RBMDataSetElPaso into unified class#33sahiljhawar merged 24 commits intomainfrom
Conversation
…taSet class Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
- Replace variable mapping dictionary with direct VariableLiteral usage - Remove ElPaso-specific type annotations and use generic DummyLike types - Improve error handling for computed properties (P, InvV) with proper validation - Simplify update_from_dict() method to use direct key matching instead of mapping - Add find_similar_variable() helper method for better error suggestions - Remove unused imports and replace ElPasoMFMEnum with DummyEnum
|
@copilot I have made changes to the RBMDataset code, change the tests accordingly. |
- Remove MockVariable wrapper class as it's no longer needed - Update tests to use direct VariableLiteral keys instead of mapped names - Simplify update_from_dict tests to pass data arrays directly - Add tests for invalid key error handling - Remove obsolete variable mapping tests - All 136 tests passing Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Updated all tests to match your refactored implementation. The tests now use |
|
@copilot RBMDataSetElPaso does not exist anymore. There should be only one test file for RBMDataSet which tests all the changed functionality |
Since RBMDataSetElPaso no longer exists as a separate class, consolidate all tests into a single test file. The merged file now contains: - File-based loading tests (original test_RBMDataset.py) - Dictionary-based loading tests (from test_RBMDatasetElPaso.py) All 73 tests for RBMDataSet now in one file with clear naming: - Original tests remain unchanged - Dict mode tests prefixed with "test_dict_mode_" for clarity - Total: 136 tests passing across all RBMDataSet test files Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Merged |
- Remove obsolete test_dict_mode_variable_mapping_exposed function
- Add get_loaded_variables() method to return list of currently loaded variable names - Refactor __eq__ method to handle both file loading and dict variable
Plan to merge RBMDataset and RBMDatasetElpaso classes
update_from_dictmethod in RBMDataSet✅ Task Complete: Successfully Merged and Refactored RBMDataSet
Summary of Changes
Original Merge: Combined
RBMDataSetandRBMDataSetElPasointo a unified class supporting both file-based and dictionary-based loading.Refactoring by @sahiljhawar:
VariableLiteralusageupdate_from_dict()to use direct key matchingDummyEnumfor generic type handlingVariableNotFoundErrorfind_similar_variable()helper for better error messagesTest Updates:
MockVariablewrapper classVariableLiteralkeys directlytest_RBMDatasetElPaso.pyintotest_RBMDataset.py- single test file now contains all 73 tests for the unified RBMDataSet classTest Organization
test_RBMDataset.py now contains:
update_from_dict()(prefixed withtest_dict_mode_)All 136 tests passing across all RBMDataSet test files ✅
Usage Examples
File Loading Mode:
Dictionary Loading Mode:
Migration Notes
For code using the merged class with dictionary loading:
VariableLiteralkeys directly (e.g., "Flux", "energy_channels", "time")VariableNotFoundErrorwith helpful suggestionsAll tests passing: 136 tests across all RBMDataSet test files ✅
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.