A design day object representing the annual 99.0% heating design day.
503827
def annual_heating_design_day_990(self):
        """"""
        if bool(self._winter_des_day_dict) is True:
            return DesignDay.from_ashrae_dict_heating(
                self._winter_des_day_dict, self.location, True,
                self._stand_press_at_elev)
        else:
            return None
384413
def display(self):
        
        print('Stats for %s from %s - %s' % (self.name, self.start, self.end))
        if type(self.rf) is float:
            print('Annual risk-free rate considered: %s' % (fmtp(self.rf)))
        print('Summary:')
        data = [[fmtp(self.total_return), fmtn(self.daily_sharpe),
                 fmtp(self.cagr), fmtp(self.max_drawdown)]]
        print(tabulate(data, headers=['Total Return', 'Sharpe',
                                      'CAGR', 'Max Drawdown']))

        print('\nAnnualized Returns:')
        data = [[fmtp(self.mtd), fmtp(self.three_month), fmtp(self.six_month),
                 fmtp(self.ytd), fmtp(self.one_year), fmtp(self.three_year),
                 fmtp(self.five_year), fmtp(self.ten_year),
                 fmtp(self.incep)]]
        print(tabulate(data,
                       headers=['mtd', '3m', '6m', 'ytd', '1y',
                                '3y', '5y', '10y', 'incep.']))

        print('\nPeriodic:')
        data = [
            ['sharpe', fmtn(self.daily_sharpe), fmtn(self.monthly_sharpe),
             fmtn(self.yearly_sharpe)],
            ['mean', fmtp(self.daily_mean), fmtp(self.monthly_mean),
             fmtp(self.yearly_mean)],
            ['vol', fmtp(self.daily_vol), fmtp(self.monthly_vol),
             fmtp(self.yearly_vol)],
            ['skew', fmtn(self.daily_skew), fmtn(self.monthly_skew),
             fmtn(self.yearly_skew)],
            ['kurt', fmtn(self.daily_kurt), fmtn(self.monthly_kurt),
             fmtn(self.yearly_kurt)],
            ['best', fmtp(self.best_day), fmtp(self.best_month),
             fmtp(self.best_year)],
            ['worst', fmtp(self.worst_day), fmtp(self.worst_month),
             fmtp(self.worst_year)]]
        print(tabulate(data, headers=['daily', 'monthly', 'yearly']))

        print('\nDrawdowns:')
        data = [
            [fmtp(self.max_drawdown), fmtp(self.avg_drawdown),
             fmtn(self.avg_drawdown_days)]]
        print(tabulate(data, headers=['max', 'avg', '# days']))

        print('\nMisc:')
        data = [['avg. up month', fmtp(self.avg_up_month)],
                ['avg. down month', fmtp(self.avg_down_month)],
                ['up year %', fmtp(self.win_year_perc)],
                ['12m up %', fmtp(self.twelve_month_win_perc)]]
        print(tabulate(data))
869860
def get_design(self, design_name):
    

    try:
      r = requests.request(
        "GET",
        "%s/%s/_design/%s" % (
          self.host,
          self.database_name,
          design_name
        ),
        auth=self.auth
      )

      return self.result(r.text)

    except:
      raise
537909
function() {
    var value = this.value;
    var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
    this.calendar.cfg.setProperty("selected",selectedValue,false);
	this.calendar.render();
}
906804
def monthly_cooling_design_days_004(self):
        """"""
        if self.monthly_found is False or self._monthly_db_04 == [] \
                or self._monthly_wb_04 == []:
                    return []
        else:
            db_conds = [DryBulbCondition(x, y) for x, y in zip(
                self._monthly_db_04, self._monthly_db_range_50)]
            hu_conds = [HumidityCondition(
                'Wetbulb', x, self._stand_press_at_elev) for x in self._monthly_wb_04]
            ws_conds = self.monthly_wind_conditions
            sky_conds = self.monthly_clear_sky_conditions
            return [DesignDay(
                '0.4% Cooling Design Day for {}'.format(self._months[i]),
                'SummerDesignDay', self._location,
                db_conds[i], hu_conds[i], ws_conds[i], sky_conds[i])
                    for i in xrange(12)]
7511
def spark_shape(points, shapes, fill=None, color='blue', width=5, yindex=0, heights=None):
    
    assert len(points) == len(shapes) + 1
    data = [{'marker': {'color': 'white'}, 'x': [points[0], points[-1]], 'y': [yindex, yindex]}]

    if fill is None:
        fill = [False] * len(shapes)

    if heights is None:
        heights = [0.4] * len(shapes)

    lays = []
    for i, (shape, height) in enumerate(zip(shapes, heights)):
        if shape is None:
            continue
        if fill[i]:
            fillcolor = color
        else:
            fillcolor = 'white'
        lays.append(
            dict(
                type=shape,
                x0=points[i],
                x1=points[i + 1],
                y0=yindex - height,
                y1=yindex + height,
                xref='x',
                yref='y',
                fillcolor=fillcolor,
                line=dict(color=color, width=width),
            )
        )

    layout = dict(shapes=lays)

    return Chart(data=data, layout=layout)
730173
def _create_datadict(cls, internal_name):
        
        if internal_name == "LOCATION":
            return Location()
        if internal_name == "DESIGN CONDITIONS":
            return DesignConditions()
        if internal_name == "TYPICAL/EXTREME PERIODS":
            return TypicalOrExtremePeriods()
        if internal_name == "GROUND TEMPERATURES":
            return GroundTemperatures()
        if internal_name == "HOLIDAYS/DAYLIGHT SAVINGS":
            return HolidaysOrDaylightSavings()
        if internal_name == "COMMENTS 1":
            return Comments1()
        if internal_name == "COMMENTS 2":
            return Comments2()
        if internal_name == "DATA PERIODS":
            return DataPeriods()
        raise ValueError(
            "No DataDictionary known for {}".format(internal_name))
245297
def design(npos):
    
    if npos == 15:
        #
        # rotatable design of Jelinek for kappabridge (see Tauxe, 1998)
        #
        A = np.array([[.5, .5, 0, -1., 0, 0], [.5, .5, 0, 1., 0, 0], [1, .0, 0, 0, 0, 0], [.5, .5, 0, -1., 0, 0], [.5, .5, 0, 1., 0, 0], [0, .5, .5, 0, -1., 0], [0, .5, .5, 0, 1., 0], [0, 1., 0, 0, 0, 0],
                      [0, .5, .5, 0, -1., 0], [0, .5, .5, 0, 1., 0], [.5, 0, .5, 0, 0, -1.], [.5, 0, .5, 0, 0, 1.], [0, 0, 1., 0, 0, 0], [.5, 0, .5, 0, 0, -1.], [.5, 0, .5, 0, 0, 1.]])  # design matrix for 15 measurment positions
    elif npos == 6:
        A = np.array([[1., 0, 0, 0, 0, 0], [0, 1., 0, 0, 0, 0], [0, 0, 1., 0, 0, 0], [.5, .5, 0, 1., 0, 0], [
                     0, .5, .5, 0, 1., 0], [.5, 0, .5, 0, 0, 1.]])  # design matrix for 6 measurment positions

    else:
        print("measurement protocol not supported yet ")
        return
    B = np.dot(np.transpose(A), A)
    B = linalg.inv(B)
    B = np.dot(B, np.transpose(A))
    return A, B
315120
def to_json(self):
        """"""
        return {
            'location': self.location.to_json(),
            'design_days': [des_d.to_json() for des_d in self.design_days]
        }
902152
def annual_cooling_design_day_004(self):
        """"""
        self._load_header_check()
        if bool(self._cooling_dict) is True:
            avg_press = self.atmospheric_station_pressure.average
            avg_press = None if avg_press == 999999 else avg_press
            return DesignDay.from_ashrae_dict_cooling(
                self._cooling_dict, self.location, False, avg_press)
        else:
            return None
1010061
def designPrimers(p3_args, input_log=None, output_log=None, err_log=None):
    ''' 
    '''
    sp = subprocess.Popen([pjoin(PRIMER3_HOME, 'primer3_core')],
                          stdout=subprocess.PIPE, stdin=subprocess.PIPE,
                          stderr=subprocess.STDOUT)
    p3_args.setdefault('PRIMER_THERMODYNAMIC_PARAMETERS_PATH',
                       pjoin(PRIMER3_HOME, 'primer3_config/'))
    in_str = _formatBoulderIO(p3_args)
    if input_log:
        input_log.write(in_str)
        input_log.flush()
    out_str, err_str = sp.communicate(input=in_str)
    if output_log:
        output_log.write(out_str)
        output_log.flush()
    if err_log and err_str is not None:
        err_log.write(err_str)
        err_log.flush()
    return _parseBoulderIO(out_str)
1175718
private void updateDesign( DataSetDesign dataSetDesign,
                               IConnection conn, String queryText )
        throws OdaException
    {
        IQuery query = conn.newQuery( null );
        query.prepare( queryText );
        
        // TODO a runtime driver might require a query to first execute before
        // its metadata is available
//      query.setMaxRows( 1 );
//      query.executeQuery();
        
        try
        {
            IResultSetMetaData md = query.getMetaData();
            updateResultSetDesign( md, dataSetDesign );
        }
        catch( OdaException e )
        {
            // no result set definition available, reset previous derived metadata
            dataSetDesign.setResultSets( null );
            e.printStackTrace();
        }
        
        // proceed to get parameter design definition
        try
        {
            IParameterMetaData paramMd = query.getParameterMetaData();
            updateParameterDesign( paramMd, dataSetDesign );
        }
        catch( OdaException ex )
        {
            // no parameter definition available, reset previous derived metadata
            dataSetDesign.setParameters( null );
            ex.printStackTrace();
        }
        
        /*
         * See DesignSessionUtil for more convenience methods
         * to define a data set design instance.  
         */     
    }
201931
def designAARM(npos):
    #
    
    if npos != 9:
        print('Sorry - only 9 positions available')
        return
    Dec = [315., 225., 180., 135., 45., 90., 270.,
           270., 270., 90., 0., 0., 0., 180., 180.]
    Dip = [0., 0., 0., 0., 0., -45., -45., 0.,
           45., 45., 45., -45., -90., -45., 45.]
    index9 = [0, 1, 2, 5, 6, 7, 10, 11, 12]
    H = []
    for ind in range(15):
        Dir = [Dec[ind], Dip[ind], 1.]
        H.append(dir2cart(Dir))  # 15 field directionss
#
# make design matrix A
#
    A = np.zeros((npos * 3, 6), 'f')
    tmpH = np.zeros((npos, 3), 'f')  # define tmpH
    if npos == 9:
        for i in range(9):
            k = index9[i]
            ind = i * 3
            A[ind][0] = H[k][0]
            A[ind][3] = H[k][1]
            A[ind][5] = H[k][2]
            ind = i * 3 + 1
            A[ind][3] = H[k][0]
            A[ind][1] = H[k][1]
            A[ind][4] = H[k][2]
            ind = i * 3 + 2
            A[ind][5] = H[k][0]
            A[ind][4] = H[k][1]
            A[ind][2] = H[k][2]
            for j in range(3):
                tmpH[i][j] = H[k][j]
        At = np.transpose(A)
        ATA = np.dot(At, A)
        ATAI = linalg.inv(ATA)
        B = np.dot(ATAI, At)
    else:
        print("B matrix not yet supported")
        return
    return B, H, tmpH
363022
def layout(self, slide):
        

        image = Image.new('RGB', (WIDTH, HEIGHT), 'black')
        draw = ImageDraw.Draw(image)
        draw.font = self.font
        
        self.vertical_layout(draw, slide)
        
        self.horizontal_layout(draw, slide)

        return slide
1124803
def monthly_cooling_design_days_100(self):
        """"""
        if self.monthly_found is False or self._monthly_db_100 == [] \
                or self._monthly_wb_100 == []:
                    return []
        else:
            db_conds = [DryBulbCondition(x, y) for x, y in zip(
                self._monthly_db_100, self._monthly_db_range_50)]
            hu_conds = [HumidityCondition(
                'Wetbulb', x, self._stand_press_at_elev) for x in self._monthly_wb_100]
            ws_conds = self.monthly_wind_conditions
            sky_conds = self.monthly_clear_sky_conditions
            return [DesignDay(
                '10% Cooling Design Day for {}'.format(self._months[i]),
                'SummerDesignDay', self._location,
                db_conds[i], hu_conds[i], ws_conds[i], sky_conds[i])
                    for i in xrange(12)]
1292621
function(data, restrictions, callback) {

            var image;

            if (restrictions instanceof Function) {
                callback = restrictions;
                restrictions = null;
            }

            if (data instanceof BlobImage || data instanceof iFrameUpload) {
                image = data;
            } else if (_.isString(data)) {
                image = new RemoteImage({
                    src: data
                });
            } else {
                image = new FileSystemImage({
                    file: data
                });
            }

            var uploadDesign = new UploadDesign({
                image: image
            });

            this._uploadDesign(uploadDesign, restrictions, callback);

            return uploadDesign;

        }
1061720
def horizontal_layout(self, draw, slide):
        
        padding = self.padding
        heading = slide['heading']

        top = padding
        left = padding

        top += heading['height'] + padding

        rows = slide['rows']

        for row in rows:

            images = row.get('images', 0)

            items = row['items']
            
            used_width = sum(x.get('width', 0) for x in items)

            available_width = WIDTH - (
                used_width + ((1 + len(items)) * padding))

            if images:
                image_width = available_width // images

            # OK, now set left for all items and image_width for images
            left = padding
            for item in row['items']:

                if item.get('image'):
                    item['width'] = image_width

                item['left'] = left    

                left += item['width'] + padding

        return