-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve Code Style #119
Improve Code Style #119
Conversation
@rohanbabbar04 Are you running a tool that made these suggestions? I'm not sure what warnings you were seeing. |
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 have a couple minor suggestions for improvement.
@@ -35,10 +35,12 @@ def __init__( | |||
name="Image Viewer", | |||
context="JobContext", | |||
template="cards/image_viewer.html", | |||
img_globs=["*.png", "*.jpg", "*.gif"], | |||
img_globs=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.
If the goal is to make this argument immutable, we can use a tuple rather than None
. Tuples are immutable. I would like to keep the default argument something that has a clear value, since it appears in the documentation.
img_globs=None, | |
img_globs=("*.png", "*.jpg", "*.gif"), |
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.
Noted
@@ -50,12 +50,14 @@ def __init__( | |||
name="Video Viewer", | |||
context="JobContext", | |||
template="cards/video_viewer.html", | |||
video_globs=["*.mp4", "*.m4v"], | |||
video_globs=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.
Same as above, use a tuple for an immutable argument.
video_globs=None, | |
video_globs=("*.mp4", "*.m4v"), |
for more information, see https://pre-commit.ci
Hi @rohanbabbar04, I need a little more information about where you're seeing these warnings before reviewing. |
I will not say like |
@rohanbabbar04 Did you just read the entire code base and look for things to change or did you use some kind of automated tool? We use the pre-commit framework to automate most of the package’s requirements related to code quality. If these suggestions come from a tool, can that tool be added to the pre-commit configuration? |
Since this PR doesn’t actually fix any warnings, a more descriptive title would be helpful. Perhaps “Improve code style.” |
Done |
* Updated Requirements.txt * Initialization Warning Solved * Renaming solved * Initialization Warning Removed * Renamed assetfile to asset_file * Three expressions can be compared together Removing and * Reverted reqs * Reverted reqs * Added a tuple instead of None * Revert "Added a tuple instead of None" This reverts commit 5e56b44. * Changed None to a tuple * Indentation solved * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Trigger CI. Co-authored-by: rohanbabbar <rohanbabbar0408@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bradley Dice <bdice@bradleydice.com>
Description
signac_dashboard/__main__.py
, removed appendsignac_dashboard/modules/image_viewer.py
andsignac_dashboard/modules/video_viewer.py
signac_dashboard/modules/notes.py
andsignac_dashboard/dashboard.py
Motivation and Context
These are some of the warnings which can be improved upon
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist:
If necessary: