-
Notifications
You must be signed in to change notification settings - Fork 2
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
Normalize database config file vs cursor etc #184
Conversation
…use cursors and remove config file pollution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests pass but there are a few clerical notes I think should be addressed before merging.
extraction = None | ||
if self.cursor is not None: | ||
extraction = self._extract(specimen=specimen, study=study, continuous_also=continuous_also) | ||
if self.database_config_file is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be an elif
? (Although it wouldn't be an issue if only one of cursor
or database_config_file
were saved in the init, but even then an elif
should probably be used for better clarity.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is a mistake. The IDE suggested changing elif
to if
and I complied, but that was when those extract
lines were return statements. In this form elif
is right.
@@ -1,10 +1,10 @@ | |||
""" | |||
Convenience provision of a feature matrix for each study, the data retrieved | |||
from the SPT database. | |||
Convenience provision of a feature matrix for each study, the data retrieved from the SPT database. | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pydocstyle says module docstrings should be one liners if it fits on one line (include the start and end quotes). If not, there should be a short description that fits on one line and elaboration after two line breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yes I've thought about this sometimes. There is an 8 character ambiguity, since making a one-line comment block into one comment line increases the size of the line by the size of """ """
. In this case, this goes beyond the 100 character line limit I've been using.
It seems that the pydocstyle prescription asks to alter the content of the docstring in this case. This seems like arbitrary carelessness on the part of the style guide, since it follows that docstrings that are between 93 and 100 characters long are not allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I acquiesce and reword to make it more concise, putting further detail in the body if it calls for it. Your effective short description limit is about 10 characters shorter than your chosen line limit setting.
spatialprofilingtoolbox/workflow/common/sparse_matrix_puller.py
Outdated
Show resolved
Hide resolved
spatialprofilingtoolbox/workflow/common/sparse_matrix_puller.py
Outdated
Show resolved
Hide resolved
I think everything is fixed up. |
Final change approved. |
Addresses #182 .