Patch function data type#709
Conversation
|
Warning Review limit reached
More reviews will be available in 14 minutes and 6 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR standardizes data type metadata across dascore by extending the ChangesData type metadata standardization
Possibly related PRs
Suggested labels
🚥 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #709 +/- ##
=======================================
Coverage 99.93% 99.93%
=======================================
Files 140 140
Lines 12171 12179 +8
=======================================
+ Hits 12163 12171 +8
Misses 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
✅ Documentation built: |
Description
This PR updates DASCore's
data_typehandling for patch functions, following the direction discussed in #704.patch_functionnow supports explicit outputdata_typehandling:data_type=Nonedata_type.data_type=""data_type.data_type="some_value"data_typeto that value.The default remains
Noneto preserve existing behavior for user/downstream code. DASCore patch functions can now opt in to clearing stale labels or setting known derived-product labels.New/updated function outputs:
data_typedft(output="FFT"),stft,spectrogram,rfftfourier_transformdft(output="AS")amplitude_spectrumdft(output="PS")power_spectrumdft(output="PSD")power_spectral_densityfbefrequency_band_energystaltastaltakurtosiskurtosisenvelopeenvelopecorrelate,correlate_shiftcorrelationtau_ptau_pdispersion_phase_shiftdispersionphase_weighted_stackphase_weighted_stackintegrate,differentiate,hilbert,normalize,standardize,angle,full,any,all""This also normalizes DASCore-assigned
data_typevalues to snake_case, adds them toVALID_DATA_TYPES, updates default colormap keys, and preserves the pre-STFTdata_typesoistft()round trips do not leavefourier_transformon restored patches.Closes #704, #511.
Meaning of
data_typedata_typeis an optional human-readable label for the kind of data contained in a patch. It is not the canonical source of physical meaning.The canonical physical interpretation should come from:
data_units: what physical units the data are in.coords/ coordinate units: what axes the data are sampled over.history: how the data were transformed.data_typeshould be used as a lightweight descriptor or classifier, useful for display defaults, plotting choices, grouping, and quick user inspection. It should not be used for correctness-critical logic unless the function explicitly documents that requirement, as in existing functions that requiredata_type="velocity"before converting velocity to strain rate.The practical policy is:
data_typebehaviordata_type.data_type.data_typeto"".required_attrs={"data_type": ...}.patch_function@patch_function(data_type="...").@patch_function(data_type="").@patch_function()/data_type=None.The guiding principle is: stale or misleading
data_typeis worse than missingdata_type. However, we do not clear data_type by default for patch functions in case this will break existing user code.Checklist
I have (if applicable):
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation
Tests