-
Notifications
You must be signed in to change notification settings - Fork 4
Merge RBMDataSet and RBMDataSetElPaso into unified class #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.