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

Refactor #296

Merged
merged 8 commits into from
May 22, 2024
Merged

Refactor #296

merged 8 commits into from
May 22, 2024

Conversation

tfukaza
Copy link
Owner

@tfukaza tfukaza commented May 21, 2024

No description provided.

Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 45.11692% with 399 lines in your changes are missing coverage. Please review.

Project coverage is 41.62%. Comparing base (bbaeebc) to head (cbf710a).
Report is 7 commits behind head on main.

Files Patch % Lines
harvest/util/helper.py 36.00% 48 Missing ⚠️
harvest/broker/alpaca.py 0.00% 45 Missing ⚠️
harvest/broker/robinhood.py 0.00% 45 Missing ⚠️
harvest/broker/webull.py 0.00% 43 Missing ⚠️
harvest/trader/trader.py 63.46% 38 Missing ⚠️
harvest/broker/polygon.py 0.00% 27 Missing ⚠️
harvest/broker/_base.py 51.85% 26 Missing ⚠️
harvest/broker/yahoo.py 0.00% 24 Missing ⚠️
harvest/broker/dummy.py 51.28% 19 Missing ⚠️
harvest/enum.py 70.76% 19 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #296      +/-   ##
==========================================
- Coverage   47.38%   41.62%   -5.77%     
==========================================
  Files          26       26              
  Lines        4153     3825     -328     
==========================================
- Hits         1968     1592     -376     
- Misses       2185     2233      +48     
Flag Coverage Δ
unittests 41.62% <45.11%> (-5.77%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,2 @@
[settings]
Copy link
Collaborator

Choose a reason for hiding this comment

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

can remove

Copy link
Collaborator

@sean1006 sean1006 left a comment

Choose a reason for hiding this comment

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

rubber 🖃

@tfukaza tfukaza merged commit 2f4e20d into main May 22, 2024
2 of 4 checks passed
@tfukaza tfukaza deleted the refactor branch May 22, 2024 05:07
def fetch_chain_data(self, symbol: str, date: Union[str, dt.datetime]) -> pd.DataFrame:
price = self.fetch_price_history(symbol, self.poll_interval)[symbol].iloc[-1]["close"] / 100

# Types = call, put
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: remove?


# Create a permutation of all the data
data = []
for t in types:
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

I'd import itertools

for type, strike, expiration in itertools.product(types, strikes, expirations):
	data.append([symbol, expiration, type, strike])

# Store the price change since the first price
self.randomness[symbol] = returns.cumsum()
self.randomness[symbol + "_rng"] = rng

# The inital price is arbitarly calculated from the first change in price
# The initial price is arbitrarily calculated from the first change in price
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

debugger.error(self.installation())
raise e
# try:
# exec(f"import {dep}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

rm?

pyyaml == 5.3
tqdm == 4.66.4
tzlocal == 5.2
tzdata == 2024.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will make it difficult for others to use this module. mb >= rather than == for the more general modules like pandas

# for key in broker.req_keys:
# self.assertTrue(key in results)
# self.assertEqual(results[key], "y")

Copy link
Collaborator

Choose a reason for hiding this comment

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

?

@tfukaza tfukaza mentioned this pull request May 22, 2024
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