ebonite.core.analyzer.requirement module

class ebonite.core.analyzer.requirement.RequirementAnalyzer[source]

Bases: object

Analyzer for RequirementHook hooks

hooks = []
classmethod analyze(obj: Union[ebonite.core.objects.requirements.Requirements, ebonite.core.objects.requirements.Requirement, List[ebonite.core.objects.requirements.Requirement], str, List[str]]) → ebonite.core.objects.requirements.Requirements[source]

Run RequirementHook hooks to analyze obj

Parameters:obj – objects to analyze
Returns:Instance of Requirements
class ebonite.core.analyzer.requirement.RequirementHook[source]

Bases: ebonite.core.analyzer.base.Hook

must_process(obj: ebonite.core.objects.requirements.Requirement) → bool[source]

Must return True if obj must be processed by this hook. “must” means you sure that no other hook should handle this object, for example this hook is for sklearn objects and obj is exactly that.

Parameters:obj – object to analyze
Returns:True or False
can_process(obj: ebonite.core.objects.requirements.Requirement) → bool[source]

Must return True if obj can be processed by this hook

Parameters:obj – object to analyze
Returns:True or False
process(obj: ebonite.core.objects.requirements.Requirement, **kwargs) → ebonite.core.objects.requirements.Requirements[source]

Analyzes obj and returns result. Result type is determined by specific Hook class sub-hierarchy

Parameters:
  • obj – object to analyze
  • kwargs – additional information to be used for analysis
Returns:

analysis result