Skip to content

the docstring for Golem#447

Merged
shadeofblue merged 3 commits intob0.6from
blue/golem-docstring
Jun 9, 2021
Merged

the docstring for Golem#447
shadeofblue merged 3 commits intob0.6from
blue/golem-docstring

Conversation

@shadeofblue
Copy link
Contributor

No description provided.

@shadeofblue shadeofblue requested review from a team, azawlocki and kmazurek June 9, 2021 10:43
Copy link
Contributor

@kmazurek kmazurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, very clear! I have some questions and minor suggestions though.

yapapi/golem.py Outdated
The first one - `execute_tasks` - instructs Golem to take a sequence of task fragments
that the user wishes to compute on Golem and distributes those among the providers.

The second one - `run_service` - instructs Golem to spawn a certain number of instances
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there's some ambiguity in the use of the word Golem here and in the two previous paragraphs. Is it Golem the Python class? Is it Golem as in local yagna node? Is it Golem as in the network?

yapapi/golem.py Outdated

Whereas a task-based job exists for the purpose of computing the specific
sequence of tasks and is done once the whole sequence has been processed, the
service-based job is created for an indefinite period and the services spawned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potentially indefinite?

yapapi/golem.py Outdated
shutdown.

As `Golem`'s job includes tracking and executing payments for activities spawned by
either mode of operation, it's usually good to have just one instance of `Golem`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have it where/when? I'd add some more context here, e.g. "at any given time" and/or "in a given program" or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, going with "at any given time"

Comment on lines +54 to +56
Additionally, the service interface provides a way to easily define handlers for
certain, discrete phases of a lifetime of each service instance - startup, running and
shutdown.
Copy link
Contributor

@azawlocki azawlocki Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow link to the Service class here? It's docstring should contain more information about the lifecycle of service instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure how to link to another place in the docs, plus, I'd make it a separate PR

Copy link
Contributor

@azawlocki azawlocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the style but had some minor comments regarding the content.

yapapi/golem.py Outdated
Comment on lines +31 to +32
"""
The main entrypoint of the Golem's high-level API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""
The main entrypoint of the Golem's high-level API.
"""The main entrypoint of the Golem's high-level API.

Flake 8 docstrings plugin, if we ever enable it, would require us to change that. That would be also consistent with other multi-line docstrings e.g. in yapapi.executor.

shadeofblue and others added 2 commits June 9, 2021 13:30
Co-authored-by: Kuba Mazurek <jakub.mazurek@golem.network>
@shadeofblue
Copy link
Contributor Author

updated the code, please re-review, @zakaprov @azawlocki

Copy link
Contributor

@azawlocki azawlocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shadeofblue shadeofblue merged commit 5cbd461 into b0.6 Jun 9, 2021
@shadeofblue shadeofblue deleted the blue/golem-docstring branch June 9, 2021 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants