Closed fwitte closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 85.78%. Comparing base (
3c11dc5
) to head (8678fa7
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I blindly overlook the section, I was only reading the variables one... Nevertheless, including how to slice variable.lower.loc[slice, other]
instead of variable.loc[slice, other].lower
might be useful
@fwitte thank you for your contribution. Setting the bounds on a selection of variables does not work, as the .loc
function returns a copy of the original data. Therefore, the bound will only set to the copy and not the variable selection itself. Would you mind adding a note there, that this case is not supported (yet)?
I blindly overlook the section, I was only reading the variables one... Nevertheless, including how to slice
variable.lower.loc[slice, other]
instead ofvariable.loc[slice, other].lower
might be useful
no worries
It does work, if you access the xarray.DataArray
like this: variable.lower.loc[slice, other]
, not sure if it is intentional.
I added the hint and explanation, which of both version work. It is now in the Variables section. If this is of interest, let me know if I should reopen the PR and/or move the information to the Modifying the Model section.
Have a nice day
I was trying to modify variable bounds instead of creating additional constraints for already instantiated variables and could not find a subsection in the respective chapter. It does not work with something like
variable.loc[slice, other_slice].lower = 42
and I did not immediately understand why, so I thought a hint on how to do this might be useful.If this is bad practice, I would be happy to get a rejection of the PR (and also be curious why it would be :)).
Thank you!