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

Adds BaseModel and SystemModel #4491

Merged
merged 30 commits into from
Mar 22, 2023
Merged

Adds BaseModel and SystemModel #4491

merged 30 commits into from
Mar 22, 2023

Conversation

hjoaquim
Copy link
Contributor

@hjoaquim hjoaquim commented Mar 15, 2023

BaseModel

Adds common functionality to our data classes by adding a parent class BaseModel.

Applied to:

  • ProfileModel
  • PreferencesModel
  • CredentialsModel
  • SystemModel

SystemModel

  • Create SystemModel
  • Move config_terminal.py variables into SystemModel
  • Move OpenBB variables being read from the os to SystemModel --> TBD in a different PR

@hjoaquim hjoaquim requested a review from montezdesousa March 15, 2023 12:53
@reviewpad reviewpad bot added the feat XS Extra small feature label Mar 15, 2023
@hjoaquim hjoaquim marked this pull request as ready for review March 15, 2023 15:42
Copy link
Contributor

@montezdesousa montezdesousa left a comment

Choose a reason for hiding this comment

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

I think we might need to add this to CredentiasModel and PreferencesModel, for some reason it's not doing repr as in the parent. Maybe pydantic overrides this if not specified.

    def __repr__(self) -> str:
        return super().__repr__()

You can test in a Jupyter notebook with CredentialsModel() for e.g.

@hjoaquim hjoaquim marked this pull request as draft March 15, 2023 18:53
@reviewpad reviewpad bot added feat M Medium T-Shirt size feature and removed feat XS Extra small feature labels Mar 20, 2023
@hjoaquim hjoaquim changed the title Adding BaseModel Adds BaseModel and SystemModel Mar 20, 2023
@hjoaquim hjoaquim requested a review from montezdesousa March 20, 2023 14:25
@hjoaquim hjoaquim marked this pull request as ready for review March 21, 2023 09:50
openbb_terminal/config_terminal.py Outdated Show resolved Hide resolved
openbb_terminal/core/models/system_model.py Outdated Show resolved Hide resolved
openbb_terminal/core/models/system_model.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

❗ No coverage uploaded for pull request base (develop@26ec83e). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #4491   +/-   ##
==========================================
  Coverage           ?   55.27%           
==========================================
  Files              ?      588           
  Lines              ?    53451           
  Branches           ?        0           
==========================================
  Hits               ?    29546           
  Misses             ?    23905           
  Partials           ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hjoaquim hjoaquim requested a review from montezdesousa March 22, 2023 11:12
@hjoaquim hjoaquim added this pull request to the merge queue Mar 22, 2023
@hjoaquim hjoaquim merged commit 937d033 into develop Mar 22, 2023
jmaslek pushed a commit that referenced this pull request Apr 13, 2023
* adding BaseModel

* initial version of the system model

* creating setup functions and removing constants from config_terminal

* removing log_supress const

* fix test

* merge

* system handler

* fix import

* centralized configs setup

* repr to use the BaseModel

* updating i18n dict location

* ignoring warning on wrong type-var

* ruff

* Update openbb_terminal/core/models/system_model.py

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>

* Update openbb_terminal/core/models/system_model.py

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>

* import literal

* loading env files before the plot backend is called

* fix tests/openbb_terminal/test_terminal_helper.py

* tests need to have i18n initialized

* fix seeking_alpha tests

---------

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
@piiq piiq deleted the feature/base-class branch April 24, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat M Medium T-Shirt size feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants