Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@justinpolygon
Copy link
Collaborator

Added example code snippets for crypto, forex, and indices.

@justinpolygon justinpolygon marked this pull request as ready for review March 29, 2023 12:53
examples/rest/crypto-snapshots_all_tickers.py Show resolved Hide resolved
examples/rest/crypto-snapshots_all_tickers.py Show resolved Hide resolved
@justinpolygon
Copy link
Collaborator Author

@jbonzo FYI - it looks like it's actually the linter that made the changes and added the spacing across the lines. So, I changed the code like we chatted about to be:

>                 percent_change = ((item.prev_day.close - item.prev_day.open)/item.prev_day.open*100)
>                 print("{:<15}{:<15}{:<15}{:.2f} %".format(item.ticker,item.prev_day.open,item.prev_day.close,percent_change))

Then, the link check failed here https://github.com/polygon-io/client-python/actions/runs/4601386532/jobs/8129177080?pr=415 so I run poetry run black polygon test_* examples to make the suggested changes and it give me this:

<                 percent_change = (
<                     (item.prev_day.close - item.prev_day.open)
<                     / item.prev_day.open
<                     * 100
<                 )
<                 print(
<                     "{:<15}{:<15}{:<15}{:.2f} %".format(
<                         item.ticker,
<                         item.prev_day.open,
<                         item.prev_day.close,
<                         percent_change,
<                     )
<                 )

Updated code style to pass lint check.
@jbonzo
Copy link
Collaborator

jbonzo commented Apr 3, 2023

@jbonzo FYI - it looks like it's actually the linter that made the changes and added the spacing across the lines. So, I changed the code like we chatted about to be:


>                 percent_change = ((item.prev_day.close - item.prev_day.open)/item.prev_day.open*100)

>                 print("{:<15}{:<15}{:<15}{:.2f} %".format(item.ticker,item.prev_day.open,item.prev_day.close,percent_change))

Then, the link check failed here https://github.com/polygon-io/client-python/actions/runs/4601386532/jobs/8129177080?pr=415 so I run poetry run black polygon test_* examples to make the suggested changes and it give me this:


<                 percent_change = (

<                     (item.prev_day.close - item.prev_day.open)

<                     / item.prev_day.open

<                     * 100

<                 )

<                 print(

<                     "{:<15}{:<15}{:<15}{:.2f} %".format(

<                         item.ticker,

<                         item.prev_day.open,

<                         item.prev_day.close,

<                         percent_change,

<                     )

<                 )

Ah. Thats unfortunate. Ok then.

@justinpolygon justinpolygon merged commit 5d8560c into master Apr 3, 2023
@justinpolygon justinpolygon deleted the jw-add-cfi branch April 3, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.