Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
taozhiwang committed Jun 23, 2024
1 parent a691150 commit 7d03d44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions qlib/model/riskmodel/shrink.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@ def _get_shrink_param_lw_single_factor(self, X: np.ndarray, S: np.ndarray, F: np
v1 = y.T.dot(z) / t - cov_mkt[:, None] * S
roff1 = np.sum(v1 * cov_mkt[:, None].T) / var_mkt - np.sum(np.diag(v1) * cov_mkt) / var_mkt
v3 = z.T.dot(z) / t - var_mkt * S
roff3 = (
np.sum(v3 * np.outer(cov_mkt, cov_mkt)) / var_mkt**2 - np.sum(np.diag(v3) * cov_mkt**2) / var_mkt**2
)
roff3 = np.sum(v3 * np.outer(cov_mkt, cov_mkt)) / var_mkt**2 - np.sum(np.diag(v3) * cov_mkt**2) / var_mkt**2
roff = 2 * roff1 - roff3
rho = rdiag + roff

Expand Down
4 changes: 2 additions & 2 deletions qlib/utils/index_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def _convert_type(self, item):
elif isinstance(item, np.datetime64):
# This happens often when creating index based on np.datetime64 and query with another precision
return item.astype(self.idx_list.dtype)
# NOTE: It is hard to consider every case at first.
# We just try to cover part of cases to make it more user-friendly
# NOTE: It is hard to consider every case at first.
# We just try to cover part of cases to make it more user-friendly
return item

def index(self, item) -> int:
Expand Down

0 comments on commit 7d03d44

Please sign in to comment.