Skip to content

Add python style of subarray I/O to example programs #51

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

Merged
merged 6 commits into from
Sep 5, 2024

Conversation

wkliao
Copy link
Member

@wkliao wkliao commented Sep 5, 2024

For writing attributes,

    # python subarray style
    var.float_att_name = float_att

    # Equivalently, below uses function call
    var.put_att("float_att_name", float_att)

For variables,

    # python subarray style
    end = [start[i] + count[i] for i in range(2)]
    var[start[0]:end[0], start[1]:end[1]] = buf

    # Equivalently, below uses function call
    var.put_var_all(buf, start = start, count = count)

In addition, move example programs of nonblocking APIs to folder examples/nonblocking

@wkliao wkliao merged commit da7e74d into Parallel-NetCDF:main Sep 5, 2024
3 checks passed
@wkliao wkliao deleted the python_index branch September 5, 2024 19:52
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.

1 participant