Skip to content

Commit

Permalink
pep8 80 columns fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
huaiweicheng committed Aug 28, 2019
1 parent 23c4a64 commit db74748
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions pyfolio/tears.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,9 @@ def create_round_trip_tear_sheet(returns, positions, transactions,


@plotting.customize
def create_interesting_times_tear_sheet(
returns, benchmark_rets=None, periods=None, legend_loc='best', return_fig=False):
def create_interesting_times_tear_sheet(returns, benchmark_rets=None,
periods=None, legend_loc='best',
return_fig=False):
"""
Generate a number of returns plots around interesting points in time,
like the flash crash and 9/11.
Expand Down Expand Up @@ -902,7 +903,8 @@ def create_interesting_times_tear_sheet(
If True, returns the figure that was plotted on.
"""

rets_interesting = timeseries.extract_interesting_date_ranges(returns, periods)
rets_interesting = timeseries.extract_interesting_date_ranges(
returns, periods)

if not rets_interesting:
warnings.warn('Passed returns do not overlap with any'
Expand Down Expand Up @@ -1091,7 +1093,8 @@ def create_risk_tear_sheet(positions,
style_factors : pd.DataFrame
Daily equity style factors
- DataFrame has a multi-index index, one level is dates and another is style, equities as columns
- DataFrame has a multi-index index, one level is dates and another
is style, equities as columns
- Example:
Equity(24 Equity(62
dt style [AAPL]) [ABT])
Expand Down Expand Up @@ -1201,7 +1204,8 @@ def create_risk_tear_sheet(positions,

j = 0
for name in style_factors_names:
sfe = risk.compute_style_factor_exposures(positions, style_factors.xs(name, level=1))
sfe = risk.compute_style_factor_exposures(
positions, style_factors.xs(name, level=1))
risk.plot_style_factor_exposures(sfe, name, style_axes[j])
j += 1

Expand Down
3 changes: 2 additions & 1 deletion pyfolio/tests/test_capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class CapacityTestCase(TestCase):
columns=['A', 'B'], index=dates)
price.index.name = 'dt'
price['market_data'] = 'price'
market_data = concat([volume, price]).reset_index().set_index(['dt', 'market_data'])
market_data = concat([volume, price]).reset_index().set_index(
['dt', 'market_data'])

def test_days_to_liquidate_positions(self):
dtlp = days_to_liquidate_positions(self.positions,
Expand Down

0 comments on commit db74748

Please sign in to comment.