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

Audit SDK and View/Model functions #3384

Merged
merged 25 commits into from
Nov 17, 2022
Merged

Audit SDK and View/Model functions #3384

merged 25 commits into from
Nov 17, 2022

Conversation

colin99d
Copy link
Contributor

@colin99d colin99d commented Nov 11, 2022

Description

A tool the automatically compares the SDK and view/model functions. This allows users to see if either one has duplicate functions, and then see how they map to each other.

To run use python sdk_audit.py

How has this been tested?

Ran the functionality

Also ran openbb.crypto.dd.balance("BTC") to test that my change did not break the command.

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.

@colin99d colin99d added the feat S Small T-Shirt size Feature label Nov 11, 2022
@Chavithra Chavithra self-requested a review November 12, 2022 13:54
Copy link
Contributor

@Chavithra Chavithra left a comment

Choose a reason for hiding this comment

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

Hi @colin99d,

So document can be generated but I see duplicate lines and functions without docstring.

Example:

covid_model.get_global_cases
covid_model.get_case_slopes

@colin99d
Copy link
Contributor Author

Hi @colin99d,

So document can be generated but I see duplicate lines and functions without docstring.

Example:

covid_model.get_global_cases
covid_model.get_case_slopes

Hey Chavi,

I just generated a new csv. Both of the functions you listed are only included once, and both have docstrings. Did you change anything before running?

2 similar comments
@colin99d
Copy link
Contributor Author

Hi @colin99d,

So document can be generated but I see duplicate lines and functions without docstring.

Example:

covid_model.get_global_cases
covid_model.get_case_slopes

Hey Chavi,

I just generated a new csv. Both of the functions you listed are only included once, and both have docstrings. Did you change anything before running?

@colin99d
Copy link
Contributor Author

Hi @colin99d,

So document can be generated but I see duplicate lines and functions without docstring.

Example:

covid_model.get_global_cases
covid_model.get_case_slopes

Hey Chavi,

I just generated a new csv. Both of the functions you listed are only included once, and both have docstrings. Did you change anything before running?

@colin99d
Copy link
Contributor Author

colin99d commented Nov 14, 2022

Ok, I did find some errors:

  • Removing "py" everywhere in module string and not just on ending (I made the code smarter and this bug if fixed)
  • SDK calls functions that are inside a _helpers.py file. This breaks the MVC format, and my script cannot find them. This should be fixed by moving the function into a view or model.
  • Linking the SDK to a place where the function is imported, instead of where it is defined. openbb_terminal.cryptocurrency.due_diligence.binance_view.get_balance is defined in the model, but we import it from the view.
  • Identical functions are listed for different trails.
    Below is an image of the remaining blank docstrings:

Screenshot 2022-11-14 at 8 48 58 AM

Here are pictures of identical functions for different trails:

Screenshot 2022-11-14 at 9 09 59 AM

@Chavithra Chavithra self-requested a review November 17, 2022 12:04
Copy link
Contributor

@Chavithra Chavithra left a comment

Choose a reason for hiding this comment

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

Looks ok to me.
Although this version not compatible with Windows.

Edit: it should have Windows support now.

@Chavithra Chavithra merged commit 963ca9b into main Nov 17, 2022
@Chavithra Chavithra deleted the audit_sdk branch November 17, 2022 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat S Small T-Shirt size Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants