Introduce NicknameSettingList for explicit efit tree cascade#559
Open
samc24 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Sameer Chaturvedi <sameerc@mit.edu>
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
NicknameSettingList: user-specifiable cascade of efit tree candidates. Tries each viaopen_tree, catchesmdsExceptions.TreeFOPENR(tree missing) andFetchDataError(nested cascade exhausted), returns the first that opens.efit_nickname_setting=["efit21", "efit18", "analysis"]) and comma-separated CLI strings (--efit-tree "efit21,efit18,analysis"). Tokens that match registered keys (e.g."disruption") dispatch to theirNicknameSettingclass inside the cascade.DisruptionNicknameSetting._cmod_nicknameto delegate to the new primitive -- replaces thedisruption_time is Noneproxy with real fallback driven by tree-open errors. D3D path unchanged (its rundb SQL query is real functionality, not just cascade).MDSConnection.tree_nickname_cascadesstores the originatingNicknameSettingListso a follow-up PR can extend retry to data-path-missing errors inside an opened tree. Currently written for top-levelNicknameSettingListonly; nested cases (dict-wrapped,DisruptionNicknameSettinginternals) are not yet surfaced.Behavior change
For
efit_nickname_setting="disruption"on CMOD, the legacy proxydisruption_time is None → return "analysis"is replaced with a realopen_tree("efit18")attempt, falling back to"analysis"onTreeFOPENR.Validated bit-identical output vs
devon two CMOD test shots:efit18, 83 idx points, identical data."analysis"via proxy; new triesefit18, getsTreeFOPENR, falls back to"analysis". Both produce 88 idx points, identical data.Trade-off: one extra failed MDS
open_treeper non-disrupting shot using"disruption", in exchange for a verbose log line documenting the fallback (Nickname cascade for shot N: selected 'analysis' after failed: efit18) and a path that handles unanticipated tree-availability patterns without proxy maintenance.Out of scope (Phase 2 follow-up)
FetchDataErrorwhen a tree opens but a data path inside it is missing.NicknameSettingDictor insideDisruptionNicknameSetting._cmod_nickname) toMDSConnection.tree_nickname_cascades.efit_nickname_settingvalue.Test plan
tests/test_nickname_setting.py(25 tests, pure-Python with a fakedata_conn, no MDS required).make black && ruff check . && isort --check . && pylint(CI run 26377445449).mfews04with shot 1150805012:uv run disruption-py --efit-tree "doesnotexist,analysis" 1150805012— cascade selectsanalysisafterdoesnotexistfails; verified via TRACE log.uv run disruption-py --efit-tree "disruption,analysis" 1150805012— first item resolves toDisruptionNicknameSetting, succeeds; 83 idx points (same as plain"disruption").devon shots 1150805012 (disrupting) and 1150805013 (non-disrupting) under--efit-tree "disruption".