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

Define eu usecase #167

Merged
merged 15 commits into from
Jul 13, 2023
Merged

Define eu usecase #167

merged 15 commits into from
Jul 13, 2023

Conversation

SarahAlidoost
Copy link
Member

@SarahAlidoost SarahAlidoost commented Jul 12, 2023

refs #157

@sverhoeven
Copy link
Collaborator

sverhoeven commented Jul 12, 2023

Need to check what happens when nc files with different year ranges are opened correctly.

Goes fine, time dim size is sum of both files (5844+4199=10043) while lat/lon dim have same size.

```bash
springtime src/springtime/recipes/model_comparison_EU_usecase.yaml
Downloading dataset:  pep_obs
File already exists: /tmp/data/PEP725/Syringa vulgaris
Dataset pep_obs loaded with 1520 rows
Dataset pep_obs resampled to 1520 rows
Downloading dataset:  eobs
Loading E-OBS for 1519 points
Loading mean_temperature for 1995-2010
Loaded mean_temperature for 1995-2010 in 0.6662800312042236 seconds
Loading maximum_temperature for 1995-2010
Loaded maximum_temperature for 1995-2010 in 1.1530470848083496 seconds
Loading minimum_temperature for 1995-2010
Loaded minimum_temperature for 1995-2010 in 1.1344733238220215 seconds
Dataset eobs loaded with 554435 rows
Dataset eobs resampled to 1519 rows
Traceback (most recent call last):
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1870, in safe_sort
    sorter = values.argsort()
TypeError: '<' not supported between instances of 'Point' and 'Point'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1870, in safe_sort
    sorter = values.argsort()
TypeError: '<' not supported between instances of 'Point' and 'Point'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/arrays/categorical.py", line 441, in __init__
    codes, categories = factorize(values, sort=True)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 832, in factorize
    uniques, codes = safe_sort(
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1883, in safe_sort
    ordered = _sort_mixed(values)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1936, in _sort_mixed
    nums = np.sort(values[~str_pos & ~none_pos])
  File "<__array_function__ internals>", line 180, in sort
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 1004, in sort
    a.sort(axis=axis, kind=kind, order=order)
TypeError: '<' not supported between instances of 'Point' and 'Point'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/stefanv/mambaforge/envs/springtime/bin/springtime", line 8, in <module>
    sys.exit(cli())
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/stefanv/git/springtime/springtime/src/springtime/main.py", line 200, in cli
    main(recipe)
  File "/home/stefanv/git/springtime/springtime/src/springtime/main.py", line 194, in main
    Workflow.from_recipe(recipe).execute()
  File "/home/stefanv/git/springtime/springtime/src/springtime/main.py", line 145, in execute
    df = main_df.join(others, how="outer")
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/frame.py", line 9979, in join
    return self._join_compat(
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/frame.py", line 10063, in _join_compat
    joined = merge(
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 124, in merge
    return op.get_result(copy=copy)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 773, in get_result
    join_index, left_indexer, right_indexer = self._get_join_info()
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 1012, in _get_join_info
    join_index, left_indexer, right_indexer = left_ax.join(
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/util/_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 228, in join
    join_index, lidx, ridx = meth(self, other, how=how, level=level, sort=sort)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 4667, in join
    return self._join_non_unique(other, how=how)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 4814, in _join_non_unique
    left_idx, right_idx = get_join_indexers(
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 1585, in get_join_indexers
    zipped = zip(*mapped)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 1582, in <genexpr>
    _factorize_keys(left_keys[n], right_keys[n], sort=sort, how=how)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 2341, in _factorize_keys
    llab, rlab = _sort_labels(uniques, llab, rlab)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 2368, in _sort_labels
    _, new_labels = algos.safe_sort(uniques, labels, na_sentinel=-1)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1881, in safe_sort
    ordered = _sort_tuples(values, original_values)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1968, in _sort_tuples
    indexer = lexsort_indexer(arrays, orders=True)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/sorting.py", line 350, in lexsort_indexer
    cat = Categorical(k, ordered=True)
  File "/home/stefanv/mambaforge/envs/springtime/lib/python3.10/site-packages/pandas/core/arrays/categorical.py", line 447, in __init__
    raise TypeError(
TypeError: 'values' is not ordered, please explicitly specify the categories order by passing in a categories argument.
```
@sverhoeven sverhoeven marked this pull request as ready for review July 13, 2023 09:34
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.

2 participants