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

Fix economy plot #3346

Merged
merged 19 commits into from
Nov 15, 2022
Merged

Fix economy plot #3346

merged 19 commits into from
Nov 15, 2022

Conversation

hjoaquim
Copy link
Contributor

@hjoaquim hjoaquim commented Nov 8, 2022

Description

  • Summary of the change / bug fix. / Link # issue, if applicable.

    Fix [Bug] /economy/ $ plot --y1 T20YIE #3347
    Fix [Bug] economy default report is broken #3413

    • Adds an argument to get data from the view to avoid duplicate requests on the call_fred
    • Fred data is now prepared the same way in fred and plot by using a new function fred_view.format_data_to_plot - avoiding seeing different formatted plots.
    • Little rewriting on fred_model.get_aggregated_series_data that adds readability
    • Little rewriting on fred_view.display_fred_series that adds readability - also, removed the special case for when there was only one series_ids being treated (if len(series_ids) == 1) - so everything is handled the same way
    • Adds dataset_yaxis_1 = dataset_yaxis_1.dropna() and dataset_yaxis_1 = dataset_yaxis_1.dropna() to plot_view.show_plot as if we combine multiple datasets (columns) without this
  • Screenshot of the feature or the bug before/after fix, if applicable.
    image

  • Relevant motivation and context.
    🐛 💀

  • List any dependencies that are required for this change.
    NA

How has this been tested?

  • Please describe the tests that you ran to verify your changes.
  • Provide instructions so we can reproduce.
  • Please also list any relevant details for your test configuration.
  • Make sure affected commands still run in terminal
  • Ensure the SDK still works
    On a jupyter notebook:
from openbb_terminal.sdk import openbb
openbb.economy.fred_series(["T20YIEM"])
openbb.economy.fred_series(["T20YIEM"], chart=True)
openbb.economy.fred_ids(search_query="treasuries")
openbb.economy.fred_notes(search_query="treasuries")
  • Check any related reports
    (it was fixed a broken import)
    On the terminal:
reports
economy

Checklist:

Others

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

@hjoaquim hjoaquim added the bug Fix bug label Nov 8, 2022
@hjoaquim hjoaquim self-assigned this Nov 8, 2022
@hjoaquim hjoaquim marked this pull request as ready for review November 14, 2022 18:00
Copy link
Collaborator

@jmaslek jmaslek left a comment

Choose a reason for hiding this comment

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

noice

@reviewpad reviewpad bot added the feat S Small T-Shirt size Feature label Nov 14, 2022
@hjoaquim hjoaquim merged commit 438c2eb into OpenBB-finance:main Nov 15, 2022
@hjoaquim hjoaquim deleted the fix_economy_plot branch November 15, 2022 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug feat S Small T-Shirt size Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] economy default report is broken [Bug] /economy/ $ plot --y1 T20YIE
2 participants