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

DH Code Review #1

Open
wants to merge 46 commits into
base: empty
Choose a base branch
from
Open

DH Code Review #1

wants to merge 46 commits into from

Conversation

jdamerow
Copy link

@jdamerow jdamerow commented Jun 8, 2022

The ticket for this code review is: DHCodeReview/DHCodeReview#3

This repository is ready for review.

Copy link
Collaborator

@maehr maehr left a comment

Choose a reason for hiding this comment

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

  • General remarks on scripts/pipeline/calculate_simple.py
  • README.md is missing important pieces: (Also check https://www.makeareadme.com/)
    • Installation instructions: Is there a clearly-stated list of dependencies? Ideally these should be handled with an automated package management solution.
    • Example usage and data: Do the authors include examples of how to use the software (ideally to solve real-world analysis problems). Do the authors include example data to be used to test the software?
    • Functionality documentation: Is the core functionality of the software documented to a satisfactory level (e.g., API method documentation)?
  • LICENSE.md is missing.
  • Functionality is hard to judge because of unconventional API (i.e. parameters.txt) and missing documentation
    • Installation: Does installation proceed as outlined in the documentation?
    • Functionality: Have the functional claims of the software been confirmed?
  • Nice to Have things that are missing
    • Automated tests: Are there automated tests or manual steps described so that the functionality of the software can be verified?
    • Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support?

@@ -0,0 +1,371 @@
# -*- coding: utf-8 -*-
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

The filename does not indicate the functionality and there is very little information in the docstring. Checkout https://realpython.com/documenting-python-code/#package-and-module-docstrings


@author: KeliDu
"""
# =================================
Copy link
Collaborator

Choose a reason for hiding this comment

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

The code is self-explanatory at this point. You can remove this comment.


@author: KeliDu
"""
# =================================
Copy link
Collaborator

Choose a reason for hiding this comment

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

The code is self-explanatory at this point. You can remove this comment.

# =================================

import os
import re
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove unused import

# =================================

import os
import re
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove unused import

tf_frame1 = tf_frame.T.filter(regex=ids1, axis=1)
tf_frame2 = tf_frame.T.filter(regex=ids2, axis=1)
print("\nbinary1\n", binary1.head())
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this comment for?

"""
# Define logaddition and division-by-zero avoidance addition
logaddition = logaddition+1
divaddition = 0.00000000001
Copy link
Collaborator

Choose a reason for hiding this comment

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

very unorthodox and not properly documented

"""
# Define logaddition and division-by-zero avoidance addition
logaddition = logaddition+1
divaddition = 0.00000000001
Copy link
Collaborator

Choose a reason for hiding this comment

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

very unorthodox and not properly documented

return devprops


def calculate_scores(docprops1, docprops2, absolute1, absolute2, relfreqs1, relfreqs2, logaddition, segmentlength, idlists, tf_framefreqs1, tf_framefreqs2):
Copy link
Collaborator

Choose a reason for hiding this comment

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

many positional arguments

return devprops


def calculate_scores(docprops1, docprops2, absolute1, absolute2, relfreqs1, relfreqs2, logaddition, segmentlength, idlists, tf_framefreqs1, tf_framefreqs2):
Copy link
Collaborator

Choose a reason for hiding this comment

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

many positional arguments

@@ -0,0 +1,371 @@
# -*- coding: utf-8 -*-
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

The filename does not indicate the functionality and there is very little information in the docstring. Checkout https://realpython.com/documenting-python-code/#package-and-module-docstrings

@jdamerow
Copy link
Author

@maehr this is great, thanks so much! What do you think the author should definitely address to get a code review completed badge?

@maehr
Copy link
Collaborator

maehr commented Jun 16, 2022

Most importantly documentation. But I recommend refactoring and simplifying of the code base to make it easier to understand (and maintain).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants