Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reshape data array inside data section reader function #460

Merged
merged 2 commits into from Apr 24, 2021

Conversation

kinverarity1
Copy link
Owner

@kinverarity1 kinverarity1 commented Apr 24, 2021

This adds two things:

  1. the argument n_columns to the function signature for read_data_section_iterative (i.e. the normal data section reader) function.

  2. code to (attempt) to re-shape the numpy array read by the data section reader into a 2D array.

If the file is wrapped and therefore the number of columns is unclear (i.e. inspect_data_section() returns -1), then the data section reader code does not currently attempt to reshape the array.

The reason for this is so that the data section reader function can be further modified to return a 2D numpy record array with different dtypes per column.

This adds two things:

(1) the argument `n_columns` to the function signature
    for read_data_section_iterative (i.e. the normal data section reader)
    function.

(2) code to (attempt) to re-shape the numpy array read by the
    data section reader into a 2D array.

If the file is wrapped and therefore the number of columns is unclear
(i.e. inspect_data_section() returns -1), then the data section
reader code does not currently attempt to reshape the file.

The reason for this is so that the data section reader function
can be further modified to return a 2D numpy record array with
different dtypes per column.
@kinverarity1 kinverarity1 added the data-section-parser A bug or enhancement relating to the data section parser label Apr 24, 2021
@kinverarity1 kinverarity1 merged commit 6c93cb5 into master Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-section-parser A bug or enhancement relating to the data section parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant