use warning replace error when some assets not in groupby
the parameter groupby of function utils.get_clean_factor_and_forward_returns should contain all assets in factor
but sometimes there are some assets not in group. in this case utils.get_clean_factor_and_forward_returns will raise an error
KeyError: "Assets ['xxx'] not in group mapping"
under these circumstances, people who use alphalens have to stop and find out which asset is not in group mapping and find a way to avoid this error
Just like the following
use warning replace error when some assets not in groupby
the parameter
groupby
of functionutils.get_clean_factor_and_forward_returns
should contain allassets
infactor
but sometimes there are someassets
not in group. in this caseutils.get_clean_factor_and_forward_returns
will raise an errorunder these circumstances, people who use
alphalens
have to stop and find out which asset is not in group mapping and find a way to avoid this error Just like the followingThere ar 6
tickers
, butfactor_groups
just includes 5 when we useget_clean_factor_and_forward_returns
it will raise an errornow use warning to replace error to continue compute