コード例 #1
0
"""
Tests for pvpower formulas
"""

from datetime import datetime, timedelta
import numpy as np
import pytz
from carousel.core import UREG, logging, models
from pvpower.sandia_performance_model import (UtilityFormulas,
                                              IrradianceFormulas)
from pvpower import sandia_performance_model, sandia_perfmod_newstyle
from pvpower.tests import MODEL_PATH
import os

LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
TZ = 'US/Pacific'
PST = pytz.timezone(TZ)
UTIL_FORMULAS = UtilityFormulas()
IRRAD_FORMULAS = IrradianceFormulas()
DTSTART = datetime(2007, 1, 1, 0, 0, 0)
MONTHLY_ENERGY = [
    186000.0, 168000.0, 186000.0, 180000.0, 186000.0, 180000.0, 186000.0,
    186000.0, 180000.0, 186000.0, 180000.0, 186000.0
]
ZENITH = [
    84.67227032399542, 75.69700469024768, 68.32442897476993, 63.22974106430276,
    61.01563669117582, 62.00067006350331, 66.0382089666321, 72.60444584135432,
    81.04253480488877
]
AZIMUTH = [
コード例 #2
0
ファイル: simulations.py プロジェクト: mikofski/Carousel
the simulation. It gets all its info from the model, which in turn gets it from
each layer which gets info from the layers' sources.
"""

from carousel.core import logging, CommonBase, Registry, UREG, Q_, Parameter
from carousel.core.exceptions import CircularDependencyError, MissingDataError
import json
import errno
import os
import sys
import numpy as np
import Queue
import functools
from datetime import datetime

LOGGER = logging.getLogger(__name__)


def mkdir_p(path):
    """
    http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
    :param path: path to make recursively
    """
    try:
        os.makedirs(path)
    except OSError as exc:
        if exc.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise exc