Skip to content
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

1045 hi l1b modify processing workflow to use xarraydatasetupdate #1054

Conversation

subagonsouth
Copy link
Contributor

Change Summary

Overview

These are all just changes to address a comment that @laspsandoval made in a recent Hi PR. I was using xarray.Dataset.assign() to add new variables to a dataset and Laura pointed out that I should use update() to do an in-place modification of the dataset rather than using assign() which does a copy() behind the scenes. I don't like to mutate inputs to functions, so I now output a dictionary containing the xarray.Dataarray objects to be added to the dataset and then call .update() in the outer function to add those to the output xarray.Dataset.

Closes: #1045

@subagonsouth subagonsouth added Ins: Hi Related to the IMAP-Hi instrument CDF Related to CDF files labels Oct 28, 2024
@subagonsouth subagonsouth self-assigned this Oct 28, 2024
@subagonsouth subagonsouth force-pushed the 1045-hi-l1b-modify-processing-workflow-to-use-xarraydatasetupdate branch from 6755641 to 9622ab0 Compare October 29, 2024 15:32
Copy link
Contributor

@laspsandoval laspsandoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this all looks good and have no suggestions. Nice work!

@subagonsouth subagonsouth merged commit 8502799 into IMAP-Science-Operations-Center:dev Oct 31, 2024
17 checks passed
@subagonsouth subagonsouth deleted the 1045-hi-l1b-modify-processing-workflow-to-use-xarraydatasetupdate branch November 1, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDF Related to CDF files Ins: Hi Related to the IMAP-Hi instrument
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Hi L1B - modify processing workflow to use xarray.Dataset.update
2 participants