Implement deep cloning for opacities map in RadiationBandOptionsImpl#82
Merged
chengcli merged 5 commits intocli/add_toonfrom Jan 27, 2026
Merged
Implement deep cloning for opacities map in RadiationBandOptionsImpl#82chengcli merged 5 commits intocli/add_toonfrom
chengcli merged 5 commits intocli/add_toonfrom
Conversation
Merged
Co-authored-by: chengcli <69489965+chengcli@users.noreply.github.com>
Co-authored-by: chengcli <69489965+chengcli@users.noreply.github.com>
Co-authored-by: chengcli <69489965+chengcli@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issues based on feedback for clone method PR
Implement deep cloning for opacities map in RadiationBandOptionsImpl
Jan 27, 2026
chengcli
approved these changes
Jan 27, 2026
There was a problem hiding this comment.
Pull request overview
This pull request fixes a shallow copy issue in the RadiationBandOptionsImpl::clone() method by implementing deep cloning for the opacities map. Previously, cloned objects shared OpacityOptionsImpl instances with the original, causing unintended modifications to affect both objects.
Changes:
- Added deep cloning logic for the
opacitiesmap that iterates through each entry and clones it using theOpacityOptions::clone()method - Maintains consistency with existing clone patterns for
disort()andtoon()members
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
The
clone()method inRadiationBandOptionsImplperforms shallow copy of the opacities map, causing the cloned object to shareOpacityOptionsImplinstances with the original. Modifications to opacity options in either object affect both.Changes
OpacityOptionsentry individually using itsclone()methodRadiationBandOptionsImplinstances💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.