def __init__(self, path=None): self.actives = {} self.datasets = path_manager.PathManager() self.path = path if path is not None: doc = self.readDoc(path) portfolio_node = self.getNode(doc, 'Portfolio') self.description = self.getNodeValueIfExists( portfolio_node, 'Description', None) self.read_datasets(portfolio_node) self.isNew = False else: self.description = "" self.isNew = True
def __init__(self, path = None): #todo include meta data self.datasets = path_manager.PathManager() self.path = path if path != None: doc = self.readDoc(path) portfolioNode = self.getNode(doc, 'Portfolio') self.description = self.getNodeValueIfExists(portfolioNode, 'Description', None) self.readDatasets(portfolioNode) self.isNew = False else: self.description = "" self.isNew = True
def __init__(self, path=None): self.datasets = path_manager.PathManager() self.specified_power_curve = path_manager.SinglePathManager() self.nominal_wind_speed_distribution = path_manager.SinglePathManager() self.specified_power_deviation_matrix = path_manager.SinglePathManager( ) self.path = path defaultExtrapolationMode = 'None' if path != None: self.isNew = False doc = self.readDoc(path) configurationNode = self.getNode(doc, 'Configuration') self.Name = self.getNodeValueIfExists(configurationNode, 'Name', None) self.powerCurveMinimumCount = self.getNodeInt( configurationNode, 'PowerCurveMinimumCount') if self.nodeExists(configurationNode, 'NegativePowerPeriodTreatment'): self.negative_power_period_treatment = self.get_power_treatment( configurationNode, 'NegativePowerPeriodTreatment') else: self.negative_power_period_treatment = 'Remove' if self.nodeExists(configurationNode, 'NegativePowerBinAverageTreatment'): self.negative_power_bin_average_treatment = self.get_power_treatment( configurationNode, 'NegativePowerBinAverageTreatment') else: self.negative_power_bin_average_treatment = 'Remove' if self.nodeExists(configurationNode, 'InterpolationMode'): self.interpolationMode = self.getNodeValue( configurationNode, 'InterpolationMode') else: self.interpolationMode = 'Linear' if self.interpolationMode == "Cubic": self.interpolationMode = "Cubic Spline" self.powerCurveMode = self.getNodeValue(configurationNode, 'PowerCurveMode') if self.nodeExists(configurationNode, 'PowerCurveExtrapolationMode'): self.powerCurveExtrapolationMode = self.getNodeValue( configurationNode, 'PowerCurveExtrapolationMode') else: if self.nodeExists(configurationNode, 'PowerCurvePaddingMode'): self.powerCurveExtrapolationMode = self.getNodeValue( configurationNode, 'PowerCurvePaddingMode') else: self.powerCurveExtrapolationMode = defaultExtrapolationMode #backwards compatibility if self.powerCurveExtrapolationMode == "Observed": self.powerCurveExtrapolationMode = "Last Observed" if self.nodeExists(configurationNode, 'PowerCurveBins'): powerCurveBinsNode = self.getNode(configurationNode, 'PowerCurveBins') self.powerCurveFirstBin = self.getNodeFloat( powerCurveBinsNode, 'FirstBinCentre') self.powerCurveLastBin = self.getNodeFloat( powerCurveBinsNode, 'LastBinCentre') self.powerCurveBinSize = self.getNodeFloat( powerCurveBinsNode, 'BinSize') else: self.setDefaultPowerCurveBins() self.readDatasets(configurationNode) self.read_inner_range(configurationNode) self.readTurbine(configurationNode) self.nominal_wind_speed_distribution.relative_path = self.getNodeValueIfExists( configurationNode, 'NominalWindSpeedDistribution', None) self.readDensityCorrection(configurationNode) self.readREWS(configurationNode) self.readTurbRenorm(configurationNode) self.readPowerDeviationMatrix(configurationNode) self.readProductionByHeight(configurationNode) self.readWebService(configurationNode) self.read_alternative_corrections(configurationNode) else: self.isNew = True self.Name = "" self.powerCurveMinimumCount = 10 self.powerCurveMode = 'Specified' self.powerCurveExtrapolationMode = defaultExtrapolationMode self.negative_power_period_treatment = 'Remove' self.negative_power_bin_average_treatment = 'Remove' self.setDefaultPowerCurveBins() self.set_default_inner_range() self.rewsActive = False self.rewsVeer = True self.rewsUpflow = False self.rewsExponent = 3.0 self.turbRenormActive = False self.densityCorrectionActive = False self.powerDeviationMatrixActive = False self.productionByHeightActive = False self.web_service_active = False self.web_service_url = '' self.interpolationMode = 'Cubic Spline' self.calculated_power_deviation_matrix_dimensions = self.default_calculated_power_deviation_matrix_dimensions( ) self.power_deviation_matrix_minimum_count = 0 self.power_deviation_matrix_method = 'Average of Deviations' self.alternative_corrections = []