def __init__(self):
     """
   Constructor
 """
     self.__undescribedFiles, self.__describedFiles = self.noDescriptionTestsAndInformationOnTheOther(
     )
     self.__totTestFiles = len(self.__undescribedFiles) + len(
         self.__describedFiles.keys())
     self.__allDescribed = len(self.__undescribedFiles) == 0
     self.__ravenDir = os.path.join(get_raven_loc(), '..')
     self.__userPath = os.path.abspath(os.path.join(self.__ravenDir, ".."))
Exemplo n.º 2
0
import copy
import shutil
import time
import xml.etree.ElementTree as ET

import numpy as np
import dill as pk

# load utils
## don't pop from path so we can use it later
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src'))
import _utils as hutils
sys.path.pop()

# get raven location
RAVEN_LOC = hutils.get_raven_loc()
CF_LOC = hutils.get_cashflow_loc(raven_path=RAVEN_LOC)

sys.path.append(os.path.join(CF_LOC, '..'))
from CashFlow.src.main import get_project_length
from CashFlow.src import CashFlows
sys.path.pop()

sys.path.append(os.path.join(RAVEN_LOC, '..'))
from utils import xmlUtils
from InputTemplates.TemplateBaseClass import Template as TemplateBase
sys.path.pop()


class Template(TemplateBase):
    """
Exemplo n.º 3
0
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
import sys
from CashFlows import CashFlowGroup
import _utils as hutils

raven_path = hutils.get_raven_loc()
sys.path.append(raven_path)


class CashFlowUser:
    """
    Base class for objects that want to access the functionality of the CashFlow objects.
    Generally this means the CashFlowUser will have an "economics" xml node used to define it,
    and will have a group of cash flows associated with it (e.g. a "component")

    In almost all cases, initialization methods should be called as part of the inheritor's method call.
  """
    @classmethod
    def get_input_specs(cls, spec):
        """
      Collects input specifications for this class.
      Note this needs to be called as part of an inheriting class's specification definition
      @ In, spec, InputData, specifications that need cash flow added to it
      @ Out, input_specs, InputData, specs
    """
        # this unit probably has some economics
        spec.addSub(CashFlowGroup.get_input_specs())
        return spec

    def __init__(self):
Exemplo n.º 4
0
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
"""
  Evaluated signal values for use in HERON
"""
from __future__ import unicode_literals, print_function
import os
import sys
import abc
from base import Base
from scipy import interpolate
import _utils as hutils
framework_path = hutils.get_raven_loc()
sys.path.append(framework_path)
from utils import InputData, utils, InputTypes

class Placeholder(Base):
  """
    Objects that hold a place in the HERON workflow
    but don't hold value until converted into the RAVEN workflow.
  """
  def __init__(self, **kwargs):
    """
      Constructor.
      @ In, kwargs, dict, passthrough args
      @ Out, None
    """
    Base.__init__(self, **kwargs)
    self.name = None         # identifier
    self._source = None      # name of file? the signal should come from
Exemplo n.º 5
0
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
"""
Tests by running an executable.
"""
import os
import sys

LOGOS_LOC = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(LOGOS_LOC)
import _utils as logos_utils

sys.path.pop()

# get RAVEN base testers
RAVEN_FRAMEWORK_LOC = logos_utils.get_raven_loc()
TESTER_LOC = os.path.join(RAVEN_FRAMEWORK_LOC, '..', 'scripts', 'TestHarness',
                          'testers')
sys.path.append(TESTER_LOC)
from RavenFramework import RavenFramework as RavenTester

sys.path.pop()


class LogosRun(RavenTester):
    """
    A Logos stand-alone test interface.
  """
    @staticmethod
    def get_valid_params():
        """
Exemplo n.º 6
0
#!/usr/bin/env python
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
"""
  Runs HERON.
"""

import os
import sys
import argparse
import input_loader
from base import Base
import _utils as hutils
raven_path = os.path.abspath(os.path.join(
    hutils.get_raven_loc(),
    '..'))  #os.path.dirname(__file__)#'~/projects/raven/raven_framework'
sys.path.append(raven_path)
from MessageHandler import MessageHandler
sys.path.pop()


class HERON(Base):
    def __init__(self):
        """
      Constructor.
      @ In, None
      @ Out, None
    """
        Base.__init__(self)
        self._components = []  # units involved in this study
        self._sources = [