-
Notifications
You must be signed in to change notification settings - Fork 565
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
Dataset class documentation refers to non-existant .graphs() method #495
Comments
i think you're right and it should refer to |
The program semantics will be Ivan's call, my edits were in pursuit of better PEP8 conformance and confined to the syntax level. |
I am sorry guys, you are absolutely right; my mistake. I have added I have added Note that I have simply copied Cc: @gjhiggins, @joernhees |
I removed this intentionally in 1ed4feb as it does exactly what the |
I dont feel very strongly about whether we reintroduce the method or fix the docs, but the method should just call .contexts, not duplicate the code. |
see my comment on whether to use As for duplication or not: as I said, just saying
does not work because
would work, but I did not have the time to test that (thinking about it further this should probably work!). There is probably a standard python idiom for this, but I do not know from the top of my head. |
i don't understand why just returning wouldn't work? In [3]: class Foo(object):
...: def gen(self, t):
...: yield 'my generator'
...: yield 'yields'
...: for _ in range(10):
...: yield '12 things'
...: def recall(self, t):
...: return self.gen(t)
...: alias = gen
...:
In [4]: foo = Foo()
In [5]: foo.gen(21)
Out[5]: <generator object gen at 0x105a2fe60>
In [6]: foo.recall(21)
Out[6]: <generator object gen at 0x105a2fc30>
In [7]: foo.alias(21)
Out[7]: <generator object gen at 0x105a2fe10>
In [8]: for s in foo.gen(21):
...: print s
...:
my generator
yields
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
In [9]: for s in foo.recall(21):
print s
...:
my generator
yields
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
In [10]: for s in foo.alias(21):
print s
....:
my generator
yields
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things
12 things Anyhow, i accidentally didn't refresh these tabs since yesterday and just made Any objections / anything else to re-introduce? Otherwise i'd merge #504 soon and we can move on. |
For some reasons it did not work for me yesterday; but then maybe (probably) I did a mistake. Your fix is obvious (should have thought about it), so please merge and close it! Thanks |
;) done |
In a few places the Dataset class docstring refers to a
Dataset.graphs()
method. But there's no such thing. Should it refer toDataset.contexts()
instead? Or shouldDataset.graphs()
be added as an alias ofDataset.contexts()
?The text was updated successfully, but these errors were encountered: