eWaterCycle / eWaterCycle/ewatercycle

Add set_value_as_xarray to models

Open
#182 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
41
Forks
6
Avg merge
8d 23h
Merged PRs (30d)
2

Description

As counter part of `model.get_value_as_xarray()` it would be nice to have `model.set_value_as_xarray()` method.

As now for example in docs/examples/Irrigation.ipynb we have to flatten an xarray with
```python
soil_moisture = experiment.get_value_as_xarray('upper_soil_saturation_degree', )
soil_moisture[31:41, 18:28] = 1
experiment.set_value('upper_soil_saturation_degree', soil_moisture.values.flatten())
```

It would be nicer if you could do
```python
soil_moisture = experiment.get_value_as_xarray('upper_soil_saturation_degree', )
soil_moisture[31:41, 18:28] = 1
experiment.set_value_as_xarray('upper_soil_saturation_degree', soil_moisture)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.