Skip to content

Field selection: use select_by_* methods instead of indexing #119

@sadielbartholomew

Description

@sadielbartholomew

The docs examples always select the relevant fields from the read-in Field List using indexing, but this is less explicit and more brittle than selection using one of cf-python's dedicated select_by_ methods, so we should replace any cases where the Field List is non-singular with filtering by selection method.

I suggest that we still use indexing for those singular Field Lists to highlight that indexing is an alternative possibility which represents the simplest way to extract the field when it's the only one there, but otherwise always use some select_by_* method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions