[doc] example code for reading the default MD_DIMS#3470
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR adds a documentation note to the backend API guide clarifying how to interpret 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the developer backend API documentation to make the implied default MD_DIMS (“CTZYX” with leading dimensions dropped to match data.ndim) easier to apply by providing an explicit Python access pattern.
Changes:
- Added a
.. note::describing thatMD_DIMSmay be unset and how to derive the default order. - Included a Python one-liner showing how to read
MD_DIMSwith a fallback derived fromdata.ndim.
| ``dims = data.metadata.get(model.MD_DIMS, "CTZYX"[-data.ndim::])`` | ||
|
|
The default value is explained in _metadata.py in English. Explicitly give the equivalent Python version, as it's not obvious to come up with it.
1d2cf21 to
daae076
Compare
The default value is explained in _metadata.py in English.
Explicitly give the equivalent Python version, as it's not obvious to
come up with it.