PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
162 stars 44 forks source link

Slicing selection not aligned on "Python standards" #308

Open OBeaude opened 3 months ago

OBeaude commented 3 months ago

Starting recently with Linopy, I discovered that, applying a slicing operation on a variable (with .loc[idx_start: idx_end] method), does select the last index idx_end, which seems non-aligned on some standards of key Python packages (e.g., numpy, pandas).

Is it directly related to xarray basis of Linopy - and in turn, not easy to be corrected, or could it evolve in a future version of Linopy?

Thank you

FabianHofmann commented 2 months ago

thank you for raising the issue, this is indeed something unexpected. this will be something for a breaking change in version 1.0

aurelije commented 2 months ago

@FabianHofmann milestone should be v1.0

FabianHofmann commented 2 months ago

thanks :), fixed it