You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...with lots of new lines starting with .pipe. The fluent code is great for sequences of logic, but the requirement to have .pipe on each line adds verbosity.
This requires (ab)using an existing python operator, such as >> (bitshift operator) or | (or operator). Airflow uses >>, Beam (and bash) use |. While xarray doesn't allow either to be used, other libraries might incorrectly assume their presence implies they work consistently with those definitions.
Python has explicitly not added this, nor reduced the character count of lambda x:, so this would be somewhat a dissent from their standards, and introduce potential confusion to completely new xarray users.
I remember some discussions at pandas on similar topics. I can't find them all, but here's an issue re adding the X term pandas-dev/pandas#13133
The text was updated successfully, but these errors were encountered:
I also use .pipe very heavily in my own code, so I appreciate the motivation here. That said, I've been pretty happy with writing .pipe().
Both >> and | are already operators in xarray/numpy, which complicates using them for another purpose. >> for bitshift may be unusual, but | is definitely widely used for elementwise or.
I realize this is a topic primed for bike-shedding, so I've held off suggesting, but here goes...
Is there any interest in a pipe operator to make xarray syntax easier?
Our internal code has much code like:
...with lots of new lines starting with
.pipe
. The fluent code is great for sequences of logic, but the requirement to have.pipe
on each line adds verbosity.The addition of a pipe operator would allow for:
This requires (ab)using an existing python operator, such as
>>
(bitshift operator) or|
(or operator). Airflow uses>>
, Beam (and bash) use|
. While xarray doesn't allow either to be used, other libraries might incorrectly assume their presence implies they work consistently with those definitions.Python has explicitly not added this, nor reduced the character count of
lambda x:
, so this would be somewhat a dissent from their standards, and introduce potential confusion to completely new xarray users.I remember some discussions at pandas on similar topics. I can't find them all, but here's an issue re adding the
X
term pandas-dev/pandas#13133The text was updated successfully, but these errors were encountered: