Skip to content

Multiple HeaderArray key normalization triggers normalization (aliasing) #310

@tasansal

Description

@tasansal

If any of the list[str] keys are missing from the dtype.names, normalization gets triggered for ALL keys. However, the normalization should only be applied for the missing keys, and pre-existing keys should be retrieved from the HeaderArray without aliasing. After this check, if key's alias still doesn't exist, that is when we should raise; specifically for the missing keys.

segy/src/segy/arrays.py

Lines 130 to 134 in 566924c

elif isinstance(item, list) and all(isinstance(i, str) for i in item):
if all(key in self.dtype.names for key in item):
return super().__getitem__(item)
item = self._normalize_and_validate_keys(item)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions