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

functionality for getting reports updated #140

Merged
merged 2 commits into from
Apr 29, 2022

Conversation

AlanGrenfell
Copy link
Contributor

some refactoring to avoid duplication and fixing some failing tests

Copy link
Collaborator

@hannahburkhardt hannahburkhardt left a comment

Choose a reason for hiding this comment

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

This is great, thank you!
Could you run the changed files through black for formatting?

upper_bound: Optional[datetime.date] = None,
) -> Dict[datetime.date, float]:
"""Returns measurements of a given name between two dates."""
def _upper_lower_bound_helper(self, lower_bound, upper_bound):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def _upper_lower_bound_helper(self, lower_bound, upper_bound):
def _ensure_upper_lower_bound(self, lower_bound, upper_bound):

Using verbs to name methods often makes code easier to read

upper_bound: Optional[datetime.date] = None,
) -> Dict[datetime.date, float]:
"""Returns measurements of a given name between two dates."""
upper_bound, lower_bound = self._upper_lower_bound_helper(lower_bound, upper_bound)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
upper_bound, lower_bound = self._upper_lower_bound_helper(lower_bound, upper_bound)
upper_bound, lower_bound = self._ensure_upper_lower_bound(lower_bound, upper_bound)

"""
Returns report data of a given name and category between two dates.
"""
upper_bound, lower_bound = self._upper_lower_bound_helper(lower_bound, upper_bound)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
upper_bound, lower_bound = self._upper_lower_bound_helper(lower_bound, upper_bound)
upper_bound, lower_bound = self._ensure_upper_lower_bound(lower_bound, upper_bound)

@AlanGrenfell
Copy link
Contributor Author

thanks for the feedback, updated

@hannahburkhardt hannahburkhardt merged commit 4c402a4 into coddingtonbear:master Apr 29, 2022
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.

None yet

2 participants