Skip to content

Improve combine layers + some tiny fixes#410

Merged
OnnoEbbens merged 12 commits intodevfrom
improve_combine_layers
Feb 25, 2025
Merged

Improve combine layers + some tiny fixes#410
OnnoEbbens merged 12 commits intodevfrom
improve_combine_layers

Conversation

@dbrakenhoff
Copy link
Collaborator

Improve combine_layers:

  • accept layer names and layer indices for combine_layers (as both dict and list)
  • raise a useful error message when layers are non-consecutive
  • better docstrings
  • remove unnecessary ordereddict
  • deal with single entries in input (combine_layers_ds and tuples with length < 2 #406)

Other fixes:

  • tiny change in xsec label placement in add_xsec_line_and_labels
  • add xmargin/ymargin to get_extent to expand/shrink extent by some amount in x and y

- check if layers are consecutive and give a useful error message otherwise
- deal with single layer entries (#406)
- accept both string and layer index input in combine_layers as dictionary or list
dictionaries maintain order since python 3.6 i believe
subtract offset from one of the x-sec label locations
Copy link
Collaborator

@OnnoEbbens OnnoEbbens left a comment

Choose a reason for hiding this comment

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

Nice fixes! I think there is some inconsistency with removing the layer dimension from the top. It was already there before this PR. I think it is easily fixed, although it might break some old scripts.

dbrakenhoff and others added 5 commits February 25, 2025 10:54
- allow passing of str or xr.DataArray
- default is "active_domain"
- no warning is shown if it is not present in ds.
@OnnoEbbens OnnoEbbens merged commit 8b2fdc2 into dev Feb 25, 2025
5 checks passed
@OnnoEbbens OnnoEbbens deleted the improve_combine_layers branch February 25, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants