eWaterCycle / eWaterCycle/ewatercycle
Add set_value_as_xarray to models
- 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
Assessment
This issue has not been assessed yet.