Fom#
- lumopt2.fom.fom.Fom(sim_results: FieldResults | PortResults | list, fct: callable = None)#
Factory function that returns either a
FieldFomorPortFominstance.Inspects the types in
sim_resultsand instantiates the appropriate subclass. All monitors must be of the same type.- Parameters:
- sim_results
FieldResultsorPortResultsorlistofthose One or more monitor result objects.
- fct
callable(),optional User-supplied scalar function of the monitor values. If
None, a sensible default is used:mean()for field-based monitors andPNorm()(with default parameters) for port-based monitors.
- sim_results
- Returns:
FieldFomorPortFomAppropriate FOM subclass instance.
- Raises:
ValueErrorIf
sim_resultsis empty.ValueErrorIf
sim_resultscontains objects that are neitherFieldResultsnorPortResults.ValueErrorIf monitors are of mixed types (some field, some port).