Skip to content
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

Update MLI docstrings part 1 #692

Merged
merged 9 commits into from
Sep 10, 2024
Merged

Conversation

AlyssaCote
Copy link
Contributor

@AlyssaCote AlyssaCote commented Sep 4, 2024

I added and updated the MLI docstrings so that everything renders correctly and they are more consistent. This means I needed to make some decisions on what "consistent" means, because there were many different combinations going on. Feel free to push back on these! I just went with what looked like the best/what we were doing the most.

  • The docstring description uses punctuation to end the description.
  • The :param:, :returns:, etc do not use punctuation to end their description line UNLESS the line needs multiple sentences, in which case, use punctuation. (I think this happens once or twice).
  • All description lines are capitalized.

example:

def serialize_response(response: response_capnp.ResponseBuilder) -> bytes:
        """
        Serializes a built response message.

        :param response: Response to be serialized
        :return: Serialized response bytes
        """
        return response.to_bytes()

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 5.26316% with 18 lines in your changes missing coverage. Please review.

Please upload report for BASE (mli-feature@a3795e7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
smartsim/_core/mli/infrastructure/worker/worker.py 0.00% 18 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##             mli-feature     #692   +/-   ##
==============================================
  Coverage               ?   69.50%           
==============================================
  Files                  ?      103           
  Lines                  ?     8750           
  Branches               ?        0           
==============================================
  Hits                   ?     6082           
  Misses                 ?     2668           
  Partials               ?        0           
Files with missing lines Coverage Δ
..._core/mli/infrastructure/control/device_manager.py 0.00% <ø> (ø)
..._core/mli/infrastructure/control/error_handling.py 0.00% <ø> (ø)
...e/mli/infrastructure/control/request_dispatcher.py 0.00% <ø> (ø)
..._core/mli/infrastructure/control/worker_manager.py 0.00% <ø> (ø)
...sim/_core/mli/infrastructure/environment_loader.py 0.00% <ø> (ø)
smartsim/_core/mli/message_handler.py 99.52% <100.00%> (ø)
smartsim/_core/mli/infrastructure/worker/worker.py 0.00% <0.00%> (ø)

@AlyssaCote AlyssaCote requested a review from mellis13 September 4, 2024 20:06
Copy link
Contributor

@mellis13 mellis13 left a comment

Choose a reason for hiding this comment

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

Only a couple of very small comments. Thanks for fixing this up!

:param key: the key of the model to check for existence
:returns: whether the model is available on the device
:param key: The key of the model to check for existence
:returns: Whether the model is available on the device
"""
return key in self._models

Copy link
Contributor

Choose a reason for hiding this comment

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

Does get need docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Fixed. (Definitely check this one.)

@@ -109,9 +114,9 @@ def _load_model_on_device(

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the previous line would be more correct as:
```Load the model needed to execute a batch on the managed device.``

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!


the model needed to run the batch of requests is
guaranteed to be available on the model
The model needed to run the batch of requests is
Copy link
Contributor

Choose a reason for hiding this comment

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

should on the model be on the device?

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 think so! Fixed.

@AlyssaCote AlyssaCote merged commit 28bfd8f into CrayLabs:mli-feature Sep 10, 2024
43 of 46 checks passed
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.

2 participants