Skip to content

Add set_value_as_xarray to models #182

@sverhoeven

Description

@sverhoeven

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

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

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)   

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