You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **filter_kwargs are passed to the new Constructs.filter method for further selection flexibility.
This makes sense, as you can already match on multiple identities by providing a re.Pattern object, so it doesn't makes sense to restrict this to, say, *["latitude", "longitude"]
Consequences
The only possibly bad effect that this could have is for the default argument to be consumed by the *identity arguments if it is given as a positional parameter. For example, to Specify a default of None:
>>>f.construct('altitude', None) # ok at v1.8.8.0>>>f.construct('altitude', None) # NOT ok with proposed change>>>f.construct('altitude', default=None) # ok with proposed change and at v1.8.8.0
Regardless of this potential for code breaking, I think this change will be beneficial.
The text was updated successfully, but these errors were encountered:
Current situation
The
construct
andconstruct_key
methods take a single positionalidentity
argument (https://github.com/NCAS-CMS/cfdm/blob/v1.8.8.0/cfdm/mixin/constructaccess.py#L301):Proposed change
The
construct
andconstruct_key
methods take any number of positional arguments, as well as new keyword arguments:The
**filter_kwargs
are passed to the newConstructs.filter
method for further selection flexibility.This makes sense, as you can already match on multiple identities by providing a
re.Pattern
object, so it doesn't makes sense to restrict this to, say,*["latitude", "longitude"]
Consequences
The only possibly bad effect that this could have is for the
default
argument to be consumed by the*identity
arguments if it is given as a positional parameter. For example, to Specify a default ofNone
:Regardless of this potential for code breaking, I think this change will be beneficial.
The text was updated successfully, but these errors were encountered: