Skip to content

Autoplotter doesn't like single-point data sets #49

@james-trayford

Description

@james-trayford

...as far as I can tell.

Currently circumventing by plotting the same point twice. Example traceback for a plot where the data set is a single point

Unable to create plot h2_frac_func_stellar_mass due to exception: Illegal slicing argument for scalar dataspace.
Traceback:
  File "/cosma/home/dp004/wmfw23/.local/lib/python3.6/site-packages/velociraptor/autoplotter/objects.py", line 1028, in create_plots
    file_extension=file_extension,
  File "/cosma/home/dp004/wmfw23/.local/lib/python3.6/site-packages/velociraptor/autoplotter/objects.py", line 864, in make_plot
    redshift_bracket=observational_data_redshift_bracket,
  File "/cosma/home/dp004/wmfw23/.local/lib/python3.6/site-packages/velociraptor/observations/__init__.py", line 98, in load_observations
    data.load(filename)
  File "/cosma/home/dp004/wmfw23/.local/lib/python3.6/site-packages/velociraptor/observations/objects.py", line 284, in load
    filename, dataset_name=f"{prefix}values", group_name="x"
  File "/cosma/home/dp004/wmfw23/.local/lib/python3.6/site-packages/unyt-2.7.1-py3.6.egg/unyt/array.py", line 1408, in from_hdf5
    data = dataset[:]
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/cosma/local/Python/3.6.5/lib/python3.6/site-packages/h5py-2.10.0-py3.6-linux-x86_64.egg/h5py/_hl/dataset.py", line 540, in __getitem__
    selection = sel2.select_read(fspace, args)
  File "/cosma/local/Python/3.6.5/lib/python3.6/site-packages/h5py-2.10.0-py3.6-linux-x86_64.egg/h5py/_hl/selections2.py", line 103, in select_read
    return ScalarReadSelection(fspace, args)
  File "/cosma/local/Python/3.6.5/lib/python3.6/site-packages/h5py-2.10.0-py3.6-linux-x86_64.egg/h5py/_hl/selections2.py", line 88, in __init__
    raise ValueError("Illegal slicing argument for scalar dataspace")

presumably this can be fixed with an explicit array declaration in dataset.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions