New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polish docstrings for static operators #426
Polish docstrings for static operators #426
Conversation
rx/__init__.py
Outdated
[case(mapper, { 1: a, 2: b })] | ||
---1--2--3--4--| | ||
-----1----2----3----4---| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the resulting observable should be shifted to the right (+ 3 hyphens), i.e. the 'a' observable is subscribed when the source observable emits 1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---1---|
a----1----2----3----4---|
b----10---20---30---|
[case(mapper, { 1: a, 2: b })]
--------1----2----3----4---|
Do you mean like this? I don't know, I tried to keep the vertical alignment the same... I think the point is to emphasize that the result sequence is the same as a
. But I got this wrong before :-)
rx/__init__.py
Outdated
|
||
.. marble:: | ||
:alt: create | ||
|
||
[ create(a) ] | ||
---1---2---3---4---| | ||
|
||
Args: | ||
subscribe: [Optional] Subscription function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should subscribe
be qualified as Optional
with None
as a default value in the signature? Don't know if it's worth to call create
with no subscribe function thougth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. Sloppy/paste, I guess... I'll amend.
rx/__init__.py
Outdated
[for_in((a, b), lambda i: i+1)] | ||
---2--3--11--21-| | ||
-----2----3----11----21--| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure here, but I think there should be 6 hyphens instead of 4 between 3
and 11
, i.e. 2 from the end of 'a' observable + 4 from the start of the 'b' observable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a----1----2--|
b----10---20--|
[for_in((a, b), lambda i: i+1)]
-----2----3------11----21--|
Like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly 👍
rx/__init__.py
Outdated
observable sequence produces an element. The observables can be | ||
passed either as separate arguments or as a list. | ||
sequence by creating a :class:`tuple` only when the first | ||
observable sequence produces an element.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing period. Sorry to bother you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No bother, thanks!
Good job! 👍
Yes, that could be great, just by adding the common 'pattern'
I agree too. |
e23890e
to
022a4fc
Compare
OK, I've removed the commit about the marble diagrams for now -- I guess I would prefer if @MainRo could take a look, if there's a bit of time, at making them slightly more "balanced" (rather than me risking inadvertently changing something in his effort). It's a really minor point, obviously. And I think I've addressed the other remarks, about trailing period and incorrect I'll see if I can quickly propose something about using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
1 similar comment
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I notice that the
generate_with_relative_time
andgenerate
static ops don't handle a scheduler parameter, but the docstring says:RxPY/rx/__init__.py
Lines 491 to 494 in dc765aa
For the moment I've removed the docstring bit about "using the specified" scheduler. But I wonder if an optional
scheduler
argument should be added here?The newly added marble diagrams for
case
andfor_in
looked a bit "cramped" to my eyes. So I made them slightly wider, but if I missing some particular reason behind this then please let me know (@MainRo)!Another question, all references to
Observable
inrx/__init__.py
are actually torx.core.observable.Observable
-- probably just because it is already available as that class is being re-exportedrx.Observable
.But from an API perspective, should the input Observables not actually be
typing.Observable
, so as not to tie the users to our particular concrete base class?