-
Notifications
You must be signed in to change notification settings - Fork 1
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
Code quality guidelines #10
Comments
What do you think of another convention: separating the presentation layer (graphs) from modules with calculations? price_crossover.py is an example of this convention and imports rsi and bollinger indicators, _plot is an internal function and the main entry point is where the a graph is created. I struggled to find a way to add tests to bollinger_2.py because graphs are created in main. |
That makes sense. I would also like to generalize the charts around the “overlays” vs “indicators” concept. |
Please allow me to propose this convention for consideration: single purpose modules. Need: Examples: cumulative_moving_average.py (formally testma.py) has logic to load validation data, we may want to add a new module to utils/data_validation.py and relocate the logic |
yep, that makes sense.
…On Sat, Jan 30, 2021 at 3:27 PM emican ***@***.***> wrote:
Please allow me to propose this convention for your consideration: single
purpose modules.
Need:
Allow people to focus on the algorithm iterations when reading the modules.
Examples:
Simple moving average is deserving of its own module and it was mixed in
with cumulative moving averages in cumulative_moving_average.py (formally
testma.py)
cumulative_moving_average.py (formally testma.py) has logic to load
validation data, we may want to add a new module to
utils/data_validation.py and relocate the logic
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEAV4CDVAFYY2UVXCGPMFSTS4SBVJANCNFSM4WSQTBXQ>
.
--
-Joe Wojniak
*CONFIDENTIALITY* NOTICE: The contents of this *email* message and any
attachments are intended solely for the addressee(s) and may contain
*confidential *and/or privileged *information* and may be legally protected
from disclosure.
|
I'm not sure how much more code refactoring I'll be doing this weekend.
But, I think single-purpose modules make a lot of sense.
…-Joe W.
On Sat, Jan 30, 2021 at 3:57 PM Joe Wojniak ***@***.***> wrote:
yep, that makes sense.
On Sat, Jan 30, 2021 at 3:27 PM emican ***@***.***> wrote:
> Please allow me to propose this convention for your consideration: single
> purpose modules.
>
> Need:
> Allow people to focus on the algorithm iterations when reading the
> modules.
>
> Examples:
> Simple moving average is deserving of its own module and it was mixed in
> with cumulative moving averages in cumulative_moving_average.py (formally
> testma.py)
>
> cumulative_moving_average.py (formally testma.py) has logic to load
> validation data, we may want to add a new module to
> utils/data_validation.py and relocate the logic
>
> —
> You are receiving this because you were assigned.
> Reply to this email directly, view it on GitHub
> <#10 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEAV4CDVAFYY2UVXCGPMFSTS4SBVJANCNFSM4WSQTBXQ>
> .
>
--
-Joe Wojniak
*CONFIDENTIALITY* NOTICE: The contents of this *email* message and any
attachments are intended solely for the addressee(s) and may contain
*confidential *and/or privileged *information* and may be legally
protected from disclosure.
--
-Joe Wojniak
*CONFIDENTIALITY* NOTICE: The contents of this *email* message and any
attachments are intended solely for the addressee(s) and may contain
*confidential *and/or privileged *information* and may be legally protected
from disclosure.
|
No worries, I can put the changes in one commit so we can easily revert. Next week at the office will be busy so I'm trying to do as much as possible now. |
Good idea Eric |
Here are some things I noticed while reviewing code that should be made rules.
_some_function
can denote a private method, meaning it won't be imported fromfrom qttk import *
imports and users know that it is not intended for them.@time_this
decorator should not wrap functions that will be imported by users. Write your code accordingly.MyClassName
, while function names are snake case e.g.my_function_name
. Variable names are also snake case e.g.my_variable_name
.os.path.join(os.path.dirname(__file__), '..', 'my_data.csv')
assert
statementsif __name__ == '__main__':
clauses to test code within the same file the code is written.test
in them, because that implies adherence to a different testing framework. It is also inappropriate for users to import files with the wordtest
in them.pandas
objects are the backbone data structure of our project.pandas
object in, it should generally return apandas
object with the same index. Avoid unnecessarily manipulating the index of the input.pd.Series
if possible. Return apd.DataFrame
if necessary.my_series.name = 'rsi'
my_df.columns = ['a', 'b', 'c']
The text was updated successfully, but these errors were encountered: