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

Hovmöller diagrams seemingly don't work anymore #15

Open
JanStreffing opened this issue Jun 18, 2024 · 0 comments
Open

Hovmöller diagrams seemingly don't work anymore #15

JanStreffing opened this issue Jun 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@JanStreffing
Copy link
Contributor

On branch: https://github.com/FESOM/fdiag/tree/feat/prep_for_2.6 in script https://github.com/FESOM/fdiag/blob/feat/prep_for_2.6/workflows/prep_fesom2.6/reference_vs_remove_PARMS.yml

hovm_difference:
    Eurasian basin:
        temp:
            levels: [-0.1, 0.1, 41]
            maxdepth: 1000

results in:

!!! Performing hovm_difference !!!
Passed unknown parameter: workflow_name
Passed unknown parameter: climatology_path
Passed unknown parameter: climatology_year
Passed unknown parameter: bbox
Passed unknown parameter: res
Passed unknown parameter: mapproj
Passed unknown parameter: figsize_small
Passed unknown parameter: start_year
Passed unknown parameter: end_year
Passed unknown parameter: start_year_short
Passed unknown parameter: end_year_short
Passed unknown parameter: years_short
Passed unknown parameter: workflow_settings
Passed unknown parameter: ofolder_notebooks
Passed unknown parameter: ofolder_figures
Executing:  35%|█████████████████████████████████████▊                                                                     | 6/17 [00:55<01:41,  9.19s/cell]
Traceback (most recent call last):
  File "/work/ab0246/a270092/software/miniconda3/envs/fdiag/bin/fdiag", line 33, in <module>
    sys.exit(load_entry_point('fdiag', 'console_scripts', 'fdiag')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/ab0246/a270092/software/fdiag/fdiag/fdiag.py", line 242, in fdiag
    webpage = analyses[analysis](settings, analysis)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/ab0246/a270092/software/fdiag/fdiag/drivers.py", line 234, in drive_hovm_difference
    pm.execute_notebook(
  File "/work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/papermill/execute.py", line 131, in execute_notebook
    raise_for_execution_errors(nb, output_path)
  File "/work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/papermill/execute.py", line 251, in raise_for_execution_errors
    raise error
papermill.exceptions.PapermillExecutionError:
---------------------------------------------------------------------------
Exception encountered at "In [6]":
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[6], line 4
      2 mask = pf.get_mask(mesh, region)
      3 data_reference = pf.get_data(reference_path, variable, reference_years, mesh, how=None, silent=True, compute=False)
----> 4 hofm_reference = pf.hovm_data(data_reference, mesh, mask = mask)
      5 for exp_path, exp_name  in zip(input_paths, input_names):
      6     data = pf.get_data(exp_path, variable, years, mesh, how=None, compute=False, silent=True)

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/pyfesom2/diagnostics.py:243, in hovm_data(data, mesh, meshdiag, runid, mask)
    241 if mask is not None:
    242     nod_area = nod_area[:, mask]
--> 243     data = data[:, mask, :]
    245 if isinstance(data, xr.DataArray):
    246     nod_area = nod_area.where(nod_area != 0)

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/dataarray.py:876, in DataArray.__getitem__(self, key)
    873     return self._getitem_coord(key)
    874 else:
    875     # xarray-style array indexing
--> 876     return self.isel(indexers=self._item_key_to_dict(key))

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/dataarray.py:1509, in DataArray.isel(self, indexers, drop, missing_dims, **indexers_kwargs)
   1504     return self._from_temp_dataset(ds)
   1506 # Much faster algorithm for when all indexers are ints, slices, one-dimensional
   1507 # lists, or zero or one-dimensional np.ndarray's
-> 1509 variable = self._variable.isel(indexers, missing_dims=missing_dims)
   1510 indexes, index_variables = isel_indexes(self.xindexes, indexers)
   1512 coords = {}

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/variable.py:1033, in Variable.isel(self, indexers, missing_dims, **indexers_kwargs)
   1030 indexers = drop_dims_from_indexers(indexers, self.dims, missing_dims)
   1032 key = tuple(indexers.get(dim, slice(None)) for dim in self.dims)
-> 1033 return self[key]

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/variable.py:800, in Variable.__getitem__(self, key)
    797 dims, indexer, new_order = self._broadcast_indexes(key)
    798 indexable = as_indexable(self._data)
--> 800 data = indexing.apply_indexer(indexable, indexer)
    802 if new_order:
    803     data = np.moveaxis(data, range(len(new_order)), new_order)

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/indexing.py:1027, in apply_indexer(indexable, indexer)
   1025     return indexable.vindex[indexer]
   1026 elif isinstance(indexer, OuterIndexer):
-> 1027     return indexable.oindex[indexer]
   1028 else:
   1029     return indexable[indexer]

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/indexing.py:367, in IndexCallable.__getitem__(self, key)
    366 def __getitem__(self, key: Any) -> Any:
--> 367     return self.getter(key)

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/xarray/core/indexing.py:1620, in DaskIndexingAdapter._oindex_get(self, indexer)
   1618 key = indexer.tuple
   1619 try:
-> 1620     return self.array[key]
   1621 except NotImplementedError:
   1622     # manual orthogonal indexing
   1623     value = self.array

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/dask/array/core.py:1975, in Array.__getitem__(self, index)
   1967     index = (index,)
   1969 from dask.array.slicing import (
   1970     normalize_index,
   1971     slice_with_bool_dask_array,
   1972     slice_with_int_dask_array,
   1973 )
-> 1975 index2 = normalize_index(index, self.shape)
   1976 dependencies = {self.name}
   1977 for i in index2:

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/dask/array/slicing.py:922, in normalize_index(idx, shape)
    920 for axis, (i, d) in enumerate(zip(idx, none_shape)):
    921     if d is not None:
--> 922         check_index(axis, i, d)
    923 idx = tuple(map(sanitize_index, idx))
    924 idx = tuple(map(normalize_slice, idx, none_shape))

File /work/ab0246/a270092/software/miniconda3/envs/fdiag/lib/python3.12/site-packages/dask/array/slicing.py:985, in check_index(axis, ind, dimension)
    980             raise IndexError(
    981                 f"Boolean array with size {ind.size} is not long enough "
    982                 f"for axis {axis} with size {dimension}"
    983             )
    984     elif (ind >= dimension).any() or (ind < -dimension).any():
--> 985         raise IndexError(
    986             f"Index is out of bounds for axis {axis} with size {dimension}"
    987         )
    988 elif isinstance(ind, slice):
    989     return

IndexError: Index is out of bounds for axis 1 with size 47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants