Merged
Conversation
Reviewer's GuideThis pull request implements enhancements by adding type hints across modules, introducing validation checks for crucial parameters, and refining code style. Project dependencies have also been updated. Updated Class Diagram for PyTorchModelLoggerclassDiagram
class PyTorchModelLogger {
+__init__(self, ..., input_data_shape: Optional_tuple_int_Ellipsis, ...)
+getMetadata(self, local_vars: Optional_list_tuple_str_Any, model_hyperparameters: Optional_dict_str_Any, **kwargs)
+save_notebook(self)
}
note for PyTorchModelLogger "Type hints updated for parameters in __init__ and getMetadata. Added input validation for some parameters."
note for PyTorchModelLogger.getMetadata "Raises ValueError if local_vars or model_hyperparameters is None."
note for PyTorchModelLogger.save_notebook "Raises ValueError if notebook metadata cannot be fetched."
Updated Class Diagram for DataFedclassDiagram
class API {
%% Base class, details not shown as not modified in this PR
}
class DataFed {
+__init__(self, ..., datafed_path: str, ..., dataset_id_or_path: Optional_str, ...)
+user_id(self) : str
+check_string_for_dot_or_slash(self, s)
+data_record_create(self, ..., record_title: Optional_str, ...)
+data_record_update(self, ..., record_title: Optional_str, ...)
+required_keys(self, dict_list, required_keys)
+getData(self, dataset_id: Optional_str)
}
DataFed --|> API
note for DataFed "Type hints added/updated for several methods. Methods 'check_string_for_dot_or_slash' and 'required_keys' changed from static to instance methods. Input validation added."
note for DataFed.user_id "Property; raises RuntimeError if authenticated user info cannot be fetched."
note for DataFed.data_record_create "Raises ValueError if record_title is None."
note for DataFed.data_record_update "Raises ValueError if record_title is None."
note for DataFed.getData "Raises ValueError if dataset_id_or_path is not set and dataset_id is None."
Updated Class Diagram for UniversalEncoderclassDiagram
class JSONEncoder {
%% Base class from json module, details not shown
}
class UniversalEncoder {
+default(self, o)
}
UniversalEncoder --|> JSONEncoder
note for UniversalEncoder "Parameter 'obj' in 'default' method renamed to 'o'."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @theodore-s-beers - I've reviewed your changes - here's some feedback:
- The 'Bandaid fix' comment regarding
self.data_pathinDataFed.getDatashould be addressed with a more permanent solution. - Consider providing a more descriptive PR title and a brief summary in the description to outline the main changes, as 'Start cleaning things up' is quite general.
- The
required_keysmethod inDataFedno longer referencesselfafter the@staticmethoddecorator was removed; evaluate if it should be a static method or a standalone utility function.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
Going to merge this. There may be details to revert later, given some of the guards I've added, but I think it's better to start by imposing constraints. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Clean up and improve type hints, error handling, and code quality across the DataFed TorchFlow library
Bug Fixes:
Enhancements:
Chores: