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

Bug in Reading QuasiLocalMeasures::qlm_weyl_scalars #26

Open
AuroraDysis opened this issue Sep 2, 2021 · 2 comments
Open

Bug in Reading QuasiLocalMeasures::qlm_weyl_scalars #26

AuroraDysis opened this issue Sep 2, 2021 · 2 comments

Comments

@AuroraDysis
Copy link

The full log of errors is as follows.

psi4 = sim.gf.xyz["qlm_psi4[0]"]
psi4.get_iteration(0)
KeyError: "Can't open attribute (can't locate attribute: 'origin')"
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/tmp/ipykernel_24443/2044816109.py in <module>
      1 psi4 = sim.gf.xyz["qlm_psi4[0]"]
----> 2 psi4.get_iteration(0)

/mnt/beegfs/zhong/spack/opt/spack/linux-ubuntu16.04-baltasar/gcc-10.3.0/python-3.8.11-55gzuixjsxhm4rjhdbiqoybjah7tjj24/lib/python3.8/site-packages/kuibit/cactus_grid_functions.py in get_iteration(self, iteration, default)
    493         if iteration not in self.available_iterations:
    494             return default
--> 495         return self[iteration]
    496 
    497     @lru_cache(128)

/mnt/beegfs/zhong/spack/opt/spack/linux-ubuntu16.04-baltasar/gcc-10.3.0/python-3.8.11-55gzuixjsxhm4rjhdbiqoybjah7tjj24/lib/python3.8/site-packages/kuibit/cactus_grid_functions.py in __getitem__(self, iteration)
    518             raise KeyError(f"Iteration {iteration} not present")
    519 
--> 520         return self._read_iteration_as_HierarchicalGridData(iteration)
    521 
    522     def read_on_grid(self, iteration, grid, resample=False):

/mnt/beegfs/zhong/spack/opt/spack/linux-ubuntu16.04-baltasar/gcc-10.3.0/python-3.8.11-55gzuixjsxhm4rjhdbiqoybjah7tjj24/lib/python3.8/site-packages/kuibit/cactus_grid_functions.py in _read_iteration_as_HierarchicalGridData(self, iteration)
    464                 ):
    465                     uniform_grid_data_components.append(
--> 466                         self._read_component_as_uniform_grid_data(
    467                             path, iteration, ref_level, comp
    468                         )

/mnt/beegfs/zhong/spack/opt/spack/linux-ubuntu16.04-baltasar/gcc-10.3.0/python-3.8.11-55gzuixjsxhm4rjhdbiqoybjah7tjj24/lib/python3.8/site-packages/kuibit/cactus_grid_functions.py in _read_component_as_uniform_grid_data(self, path, iteration, ref_level, component)
   1145                 path, iteration, ref_level, component
   1146             ) as dataset:
-> 1147                 grid = self._grid_from_dataset(
   1148                     dataset, iteration, ref_level, component
   1149                 )

/mnt/beegfs/zhong/spack/opt/spack/linux-ubuntu16.04-baltasar/gcc-10.3.0/python-3.8.11-55gzuixjsxhm4rjhdbiqoybjah7tjj24/lib/python3.8/site-packages/kuibit/cactus_grid_functions.py in _grid_from_dataset(self, dataset, iteration, ref_level, component)
   1067         shape = np.array(dataset.shape[::-1])
   1068 
-> 1069         x0 = dataset.attrs["origin"]
   1070         dx = dataset.attrs["delta"]
   1071         time = dataset.attrs["time"]

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

~/.local/lib/python3.8/site-packages/h5py/_hl/attrs.py in __getitem__(self, name)
     54         """ Read the value of an attribute.
     55         """
---> 56         attr = h5a.open(self._id, self._e(name))
     57 
     58         if is_empty_dataspace(attr):

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/h5a.pyx in h5py.h5a.open()

KeyError: "Can't open attribute (can't locate attribute: 'origin')"
@Sbozzolo
Copy link
Owner

Sbozzolo commented Sep 2, 2021

qlm_psi4 is not a 3D grid function. It is a 2D grid array. Unfortunately, there's no way to distinguish 2D grid arrays with 2D grid functions, so this is a little tricky. How do you output the variable exactly? If you output among the 2D variables, you can open it with sim.gf.xy.

@AuroraDysis
Copy link
Author

qlm_psi4 is not a 3D grid function. It is a 2D grid array. Unfortunately, there's no way to distinguish 2D grid arrays with 2D grid functions, so this is a little tricky. How do you output the variable exactly?

Yes, I know that is not 3D gf. I'm outputing the variable in this way.

IOHDF5::out_every                       = 512
IOHDF5::out_vars                        = "
  QuasiLocalMeasures::qlm_weyl_scalars
"

If you output among the 2D variables, you can open it with sim.gf.xy.

Thanks for your help, I will give it a try.

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

No branches or pull requests

2 participants