-
Notifications
You must be signed in to change notification settings - Fork 9
style: convert variables to lowercase #159
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
base: john-development
Are you sure you want to change the base?
Conversation
7118dd2
to
a1560a4
Compare
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.
this is sooo much better. Please see my comments. Mostly on the docstrings, which are way more easily understood now.
When these things are fixed I am inclined to merge this, but we probably should revisit it. In general, we would prefer to write tests before we do the decsign and the functions, but this may not be a good strategy here. @john-halloran what are your thoughts on this.
src/diffpy/snmf/snmf_class.py
Outdated
The data to be decomposed. Shape is (length_of_signal, number_of_conditions). | ||
Y0 : ndarray | ||
init_weights : ndarray |
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.
this should be init_weights : ndarray. Optional. Default = None
Though if the None
gets processed to something else below then it is more informational to specify the default as what this thing gets processed to, if you see what I mean.
Please give the same treatment to all the optional variables.
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 want to ask for clarity on this one. "None" means the program will generate its own init_weights, but that is still ultimately an "ndarray". Should I still just write "Default = None"? To explain what it gets processed to, should that be inline there or in the docstring itself? If you can an example would be helpful.
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.
no, if None is processed to something else, put what the "something else" is as that is the defacto default. I just wanted to give a concrete example. In that case we are not putting the "type" of the default, but its actual value.
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.
here is an example
def func(thing=None):
''''thing : string Optional Default = "Sunny Morning"
The thing that describes outside
If thing is None:
thing = "Sunny Morning"
I think for understandability, it will be good to get this renaming out of the way asap, but otherwise I agree with all of this. Tests will be the next thing I work on and that will happen before any further development on the algorithms, to avoid our results drifting from the known-working state they are in currently. |
Everything should be renamed now, so if you see anything still capitalized, flag that in your review. Feel free to merge once all your feedback is addressed. Thanks for the help so far! |
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.
really good. Just one or two things and I can merge
src/diffpy/snmf/main.py
Outdated
@@ -1,19 +1,19 @@ | |||
import numpy as np | |||
from snmf_class import SNMFOptimizer | |||
|
|||
init_comps_file = np.loadtxt("input/X0.txt", dtype=float) | |||
init_components_file = np.loadtxt("input/X0.txt", dtype=float) |
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.
hate to do this, but we probably need to rename all those files......
src/diffpy/snmf/snmf_class.py
Outdated
The data to be decomposed. Shape is (length_of_signal, number_of_conditions). | ||
Y0 : ndarray | ||
init_weights : ndarray |
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.
no, if None is processed to something else, put what the "something else" is as that is the defacto default. I just wanted to give a concrete example. In that case we are not putting the "type" of the default, but its actual value.
src/diffpy/snmf/snmf_class.py
Outdated
The data to be decomposed. Shape is (length_of_signal, number_of_conditions). | ||
Y0 : ndarray | ||
init_weights : ndarray |
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.
here is an example
def func(thing=None):
''''thing : string Optional Default = "Sunny Morning"
The thing that describes outside
If thing is None:
thing = "Sunny Morning"
Okay, that stuff should be in. Let me know if I had the right idea. |
This is a mostly complete conversion of variables to lowercase. Have tested to make sure behavior remains the same with before renaming. I'm still working on a few minor variables. The cleanup of old files is no longer included in this PR.