Skip to content

non-deterministic data values returned when reading from a BP5 file #1571

Answered by ax3l
BenWibking asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @BenWibking ,

I think you forgot to flush the read:
https://openpmd-api.readthedocs.io/en/0.15.2/usage/firstread.html#register-chunk

import openpmd_api as io

series = io.Series("plt00000.bp", io.Access.read_only)
my_iter = series.iterations[0]
mesh = my_iter.meshes

# note 1: do not use our magic value :D
# note 2: select the data you want to read
comp = mesh['gasDensity'][io.Mesh_Record_Component.SCALAR][()]

# add this to read the selected data from disk
series.flush()

my_list = list(comp)

print("first try:")
# this gives one value
print(comp[0])

print("second try (produces different output from the above, and different on each run):")
# this is different from the above
print(comp[0

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@BenWibking
Comment options

@ax3l
Comment options

@franzpoeschel
Comment options

@BenWibking
Comment options

Answer selected by ax3l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #1570 on December 16, 2023 00:14.