Fix hi l1a tests broken by upgrade to cdflib 1.3.9#3008
Open
tmplummer wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes IMAP-Hi L1A dataset finalization to be compatible with cdflib 1.3.9 by bypassing schema validation when fetching CDF metadata for certain coordinate variables, preventing attribute/schema enforcement issues during CDF writing.
Changes:
- Pass
check_schema=Falsewhen retrieving CDF variable attributes forepochin histogram and memdump dataset finalizers. - Pass
check_schema=Falsewhen retrieving CDF variable attributes for the histogram angle coordinate.
Comments suppressed due to low confidence (1)
imap_processing/hi/hi_l1a.py:415
- For the
anglecoordinate,hi_hist_angleattributes inimap_hi_variable_attrs.yamlinclude adtype(uint16). Currently thatdtypestays inattrs(so it may be written out as a CDF attribute) andnp.arange(2, 360, 4)will default to int64. Consider copying the attrs, poppingdtype, and explicitly creating/casting the coordinate data to that dtype before assigning attrs, to keep metadata clean and ensure the coordinate type matches the spec.
attrs = attr_mgr.get_variable_attributes("hi_hist_angle", check_schema=False)
dataset.coords.update(
{
"angle": xr.DataArray(
np.arange(2, 360, 4),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Change Summary
Overview
Hi L1A processing was broken by upgrading to cdflib 1.3.9. The problem was actually that Hi L1A code was not passing
check_schema=Falseto the CDF attributes manager for epoch and other coordinate variables. This PR fixes that.Testing: No testing changes because existing tests failed once I updated my cdflib.
Closes: #3006