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

Normalize database config file vs cursor etc #184

Merged
merged 15 commits into from
Jul 28, 2023
Merged

Normalize database config file vs cursor etc #184

merged 15 commits into from
Jul 28, 2023

Conversation

jimmymathews
Copy link
Collaborator

Addresses #182 .

Copy link
Collaborator

@CarlinLiao CarlinLiao left a 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.

spatialprofilingtoolbox/cggnn/scripts/run.py Outdated Show resolved Hide resolved
spatialprofilingtoolbox/db/feature_matrix_extractor.py Outdated Show resolved Hide resolved
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:
Copy link
Collaborator

@CarlinLiao CarlinLiao Jul 28, 2023

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.)

Copy link
Collaborator Author

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.
"""
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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/db/stratification_puller.py Outdated Show resolved Hide resolved
@jimmymathews
Copy link
Collaborator Author

I think everything is fixed up.

@CarlinLiao
Copy link
Collaborator

Final change approved.

@jimmymathews jimmymathews merged commit 9a57ec8 into main Jul 28, 2023
1 check passed
@CarlinLiao CarlinLiao deleted the issue182 branch July 28, 2023 20:49
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