simapy 4.6.0.dev0__py3-none-any.whl → 4.6.1.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simapy/sima/package_info.py +1 -1
- simapy/sima/windpark/__init__.py +5 -0
- simapy/sima/windpark/blueprints/generator.py +7 -1
- simapy/sima/windpark/blueprints/performancerelation.py +2 -5
- simapy/sima/windpark/blueprints/performancerelationitem.py +21 -0
- simapy/sima/windpark/blueprints/windparkturbine.py +1 -0
- simapy/sima/windpark/blueprints/windturbinemotion.py +21 -0
- simapy/sima/windpark/generator.py +82 -1
- simapy/sima/windpark/incomingwind.py +3 -3
- simapy/sima/windpark/motiontype.py +15 -0
- simapy/sima/windpark/performancerelation.py +22 -59
- simapy/sima/windpark/performancerelationitem.py +120 -0
- simapy/sima/windpark/shaftdirection.py +15 -0
- simapy/sima/windpark/wakeflowmodel.py +15 -0
- simapy/sima/windpark/windparkturbine.py +15 -1
- simapy/sima/windpark/windturbinemotion.py +124 -0
- simapy/sima_reader.py +14 -0
- simapy/sima_writer.py +2 -2
- simapy/sre.py +39 -21
- {simapy-4.6.0.dev0.dist-info → simapy-4.6.1.dev0.dist-info}/METADATA +14 -2
- {simapy-4.6.0.dev0.dist-info → simapy-4.6.1.dev0.dist-info}/RECORD +24 -17
- {simapy-4.6.0.dev0.dist-info → simapy-4.6.1.dev0.dist-info}/WHEEL +1 -1
- {simapy-4.6.0.dev0.dist-info → simapy-4.6.1.dev0.dist-info}/LICENSE +0 -0
- {simapy-4.6.0.dev0.dist-info → simapy-4.6.1.dev0.dist-info}/top_level.txt +0 -0
simapy/sima/package_info.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
packages =
|
|
1
|
+
packages = {'command': 1, 'condition': 19,'custom': 12,'doc': 11,'environment': 22,'graph': 4,'hla': 24,'hydro': 28,'metocean': 10,'optimization': 1,'post': 27,'report': 11,'riflex': 43,'signals': 2, 'sima': 24,'simo': 45,'wamit': 14,'windpark': 1,'windturbine': 10,'workflow': 19}
|
simapy/sima/windpark/__init__.py
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
from .bladeelement import BladeElement # noqa
|
|
3
3
|
from .generator import Generator # noqa
|
|
4
4
|
from .performancerelation import PerformanceRelation # noqa
|
|
5
|
+
from .performancerelationitem import PerformanceRelationItem # noqa
|
|
5
6
|
from .turbulenceboxscaling import TurbulenceBoxScaling # noqa
|
|
6
7
|
from .windparktask import WindParkTask # noqa
|
|
7
8
|
from .windparkturbine import WindParkTurbine # noqa
|
|
9
|
+
from .windturbinemotion import WindTurbineMotion # noqa
|
|
8
10
|
from .windturbinetype import WindTurbineType # noqa
|
|
9
11
|
from .areaaveragingoption import AreaAveragingOption # noqa
|
|
10
12
|
from .deficitanalysisoption import DeficitAnalysisOption # noqa
|
|
@@ -15,12 +17,15 @@ from .focus import Focus # noqa
|
|
|
15
17
|
from .incomingwind import IncomingWind # noqa
|
|
16
18
|
from .lowpassfrequencyoption import LowPassFrequencyOption # noqa
|
|
17
19
|
from .meanderinganalysisoption import MeanderingAnalysisOption # noqa
|
|
20
|
+
from .motiontype import MotionType # noqa
|
|
18
21
|
from .multipledeficitmethod import MultipleDeficitMethod # noqa
|
|
19
22
|
from .nearwakelengthmodel import NearWakeLengthModel # noqa
|
|
20
23
|
from .poweroption import PowerOption # noqa
|
|
21
24
|
from .scalingoption import ScalingOption # noqa
|
|
25
|
+
from .shaftdirection import ShaftDirection # noqa
|
|
22
26
|
from .stabilityclass import StabilityClass # noqa
|
|
23
27
|
from .turbinedirection import TurbineDirection # noqa
|
|
24
28
|
from .turbulenceboxoption import TurbulenceBoxOption # noqa
|
|
25
29
|
from .viscosityfilter import ViscosityFilter # noqa
|
|
30
|
+
from .wakeflowmodel import WakeFlowModel # noqa
|
|
26
31
|
from .weightoption import WeightOption # noqa
|
|
@@ -62,4 +62,10 @@ class GeneratorBlueprint(NamedBlueprint,ConditionSelectableBlueprint):
|
|
|
62
62
|
self.add_attribute(Attribute("applyLowPassFilter","boolean","",default=True))
|
|
63
63
|
self.add_attribute(Attribute("applyAreaAveraging","boolean","",default=False))
|
|
64
64
|
self.add_attribute(EnumAttribute("lowPassFrequencyOption","sima/windpark/LowPassFrequencyOption","Lowpass cutoff frequency option"))
|
|
65
|
-
self.add_attribute(Attribute("lowPassFrequency","number","Cutoff frequency",default=0.0))
|
|
65
|
+
self.add_attribute(Attribute("lowPassFrequency","number","Cutoff frequency",default=0.0))
|
|
66
|
+
self.add_attribute(Attribute("useYawMisalignment","boolean","",default=False))
|
|
67
|
+
self.add_attribute(Attribute("interpolateYawMisalignment","boolean","Option for interpolation on specified yaw misalignment performance relations",default=False))
|
|
68
|
+
self.add_attribute(EnumAttribute("wakeFlowModel","sima/windpark/WakeFlowModel",""))
|
|
69
|
+
self.add_attribute(Attribute("yawIncrement","number","Yaw misalignment increment used in deficit computation",default=0.0))
|
|
70
|
+
self.add_attribute(EnumAttribute("shaftDirectionDefinition","sima/windpark/ShaftDirection","Kind of shaft direction definition"))
|
|
71
|
+
self.add_attribute(BlueprintAttribute("windTurbineMotions","sima/windpark/WindTurbineMotion","",True,Dimension("*")))
|
|
@@ -14,8 +14,5 @@ class PerformanceRelationBlueprint(MOAOBlueprint):
|
|
|
14
14
|
super().__init__(name,package_path,description)
|
|
15
15
|
self.add_attribute(Attribute("description","string","",default=""))
|
|
16
16
|
self.add_attribute(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*")))
|
|
17
|
-
self.add_attribute(Attribute("
|
|
18
|
-
self.add_attribute(
|
|
19
|
-
self.add_attribute(Attribute("bladePitch","number","",default=0.0))
|
|
20
|
-
self.add_attribute(Attribute("power","number","",default=0.0))
|
|
21
|
-
self.add_attribute(Attribute("thrust","number","",default=0.0))
|
|
17
|
+
self.add_attribute(Attribute("yawAngle","number","Yaw misalignment",default=0.0))
|
|
18
|
+
self.add_attribute(BlueprintAttribute("items","sima/windpark/PerformanceRelationItem","",True,Dimension("*")))
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Generated with PerformanceRelationItemBlueprint
|
|
3
|
+
from dmt.blueprint import Blueprint
|
|
4
|
+
from dmt.dimension import Dimension
|
|
5
|
+
from dmt.attribute import Attribute
|
|
6
|
+
from dmt.enum_attribute import EnumAttribute
|
|
7
|
+
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
+
from ...sima.blueprints.moao import MOAOBlueprint
|
|
9
|
+
|
|
10
|
+
class PerformanceRelationItemBlueprint(MOAOBlueprint):
|
|
11
|
+
""""""
|
|
12
|
+
|
|
13
|
+
def __init__(self, name="PerformanceRelationItem", package_path="sima/windpark", description=""):
|
|
14
|
+
super().__init__(name,package_path,description)
|
|
15
|
+
self.add_attribute(Attribute("description","string","",default=""))
|
|
16
|
+
self.add_attribute(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*")))
|
|
17
|
+
self.add_attribute(Attribute("windSpeed","number","",default=0.0))
|
|
18
|
+
self.add_attribute(Attribute("rotorSpeed","number","",default=0.0))
|
|
19
|
+
self.add_attribute(Attribute("bladePitch","number","",default=0.0))
|
|
20
|
+
self.add_attribute(Attribute("power","number","",default=0.0))
|
|
21
|
+
self.add_attribute(Attribute("thrust","number","",default=0.0))
|
|
@@ -20,4 +20,5 @@ class WindParkTurbineBlueprint(NamedObjectBlueprint):
|
|
|
20
20
|
self.add_attribute(Attribute("y","number","Global y-coordinate of the hub",default=0.0))
|
|
21
21
|
self.add_attribute(Attribute("z","number","Global z-coordinate of the hub",default=0.0))
|
|
22
22
|
self.add_attribute(Attribute("shaftAngle","number","",default=0.0))
|
|
23
|
+
self.add_attribute(EnumAttribute("shaftDirection","sima/windpark/ShaftDirection","Kind of shaft direction definition"))
|
|
23
24
|
self.add_attribute(Attribute("target","boolean","",default=False))
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Generated with WindTurbineMotionBlueprint
|
|
3
|
+
from dmt.blueprint import Blueprint
|
|
4
|
+
from dmt.dimension import Dimension
|
|
5
|
+
from dmt.attribute import Attribute
|
|
6
|
+
from dmt.enum_attribute import EnumAttribute
|
|
7
|
+
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
+
from ...sima.blueprints.moao import MOAOBlueprint
|
|
9
|
+
|
|
10
|
+
class WindTurbineMotionBlueprint(MOAOBlueprint):
|
|
11
|
+
""""""
|
|
12
|
+
|
|
13
|
+
def __init__(self, name="WindTurbineMotion", package_path="sima/windpark", description=""):
|
|
14
|
+
super().__init__(name,package_path,description)
|
|
15
|
+
self.add_attribute(Attribute("description","string","",default=""))
|
|
16
|
+
self.add_attribute(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*")))
|
|
17
|
+
self.add_attribute(BlueprintAttribute("turbine","sima/windpark/WindParkTurbine","",False))
|
|
18
|
+
self.add_attribute(Attribute("timeColumn","integer","Column number for time",default=0))
|
|
19
|
+
self.add_attribute(Attribute("shaftDirectionColumn","integer","Column or time series number for shaft direction",default=0))
|
|
20
|
+
self.add_attribute(EnumAttribute("motionType","sima/windpark/MotionType","Kind of motion time series input"))
|
|
21
|
+
self.add_attribute(Attribute("file","string","File name for hub positions"))
|
|
@@ -20,12 +20,15 @@ from .meanderinganalysisoption import MeanderingAnalysisOption
|
|
|
20
20
|
from .multipledeficitmethod import MultipleDeficitMethod
|
|
21
21
|
from .nearwakelengthmodel import NearWakeLengthModel
|
|
22
22
|
from .poweroption import PowerOption
|
|
23
|
+
from .shaftdirection import ShaftDirection
|
|
23
24
|
from .stabilityclass import StabilityClass
|
|
24
25
|
from .turbulenceboxoption import TurbulenceBoxOption
|
|
25
26
|
from .turbulenceboxscaling import TurbulenceBoxScaling
|
|
26
27
|
from .viscosityfilter import ViscosityFilter
|
|
28
|
+
from .wakeflowmodel import WakeFlowModel
|
|
27
29
|
from .weightoption import WeightOption
|
|
28
30
|
from .windparkturbine import WindParkTurbine
|
|
31
|
+
from .windturbinemotion import WindTurbineMotion
|
|
29
32
|
from .windturbinetype import WindTurbineType
|
|
30
33
|
|
|
31
34
|
class Generator(Named,ConditionSelectable):
|
|
@@ -119,9 +122,19 @@ class Generator(Named,ConditionSelectable):
|
|
|
119
122
|
Lowpass cutoff frequency option
|
|
120
123
|
lowPassFrequency : float
|
|
121
124
|
Cutoff frequency(default 0.0)
|
|
125
|
+
useYawMisalignment : bool
|
|
126
|
+
(default False)
|
|
127
|
+
interpolateYawMisalignment : bool
|
|
128
|
+
Option for interpolation on specified yaw misalignment performance relations(default False)
|
|
129
|
+
wakeFlowModel : WakeFlowModel
|
|
130
|
+
yawIncrement : float
|
|
131
|
+
Yaw misalignment increment used in deficit computation(default 0.0)
|
|
132
|
+
shaftDirectionDefinition : ShaftDirection
|
|
133
|
+
Kind of shaft direction definition
|
|
134
|
+
windTurbineMotions : List[WindTurbineMotion]
|
|
122
135
|
"""
|
|
123
136
|
|
|
124
|
-
def __init__(self , description="", airDensity=1.3, kinematicViscosity=1.824e-05, meanderingOption=MeanderingAnalysisOption.COMP, powerOption=PowerOption.COMP, deficitOption=DeficitAnalysisOption.COMP, focusOption=Focus.TARGET, angleChange=3.0, maxLaps=30, deficitFileContents=DeficitFileContents.INDUCTION_PROFILE, ambientMixingParameter=0.0, deficitParameter=0.0, multipleDeficitMethod=MultipleDeficitMethod.MAXOP, nearWakeLengthModel=NearWakeLengthModel.ROTOR_DIAMETERS, viscosityFilter=ViscosityFilter.MADSEN, incomingWind=IncomingWind.
|
|
137
|
+
def __init__(self , description="", airDensity=1.3, kinematicViscosity=1.824e-05, meanderingOption=MeanderingAnalysisOption.COMP, powerOption=PowerOption.COMP, deficitOption=DeficitAnalysisOption.COMP, focusOption=Focus.TARGET, angleChange=3.0, maxLaps=30, deficitFileContents=DeficitFileContents.INDUCTION_PROFILE, ambientMixingParameter=0.0, deficitParameter=0.0, multipleDeficitMethod=MultipleDeficitMethod.MAXOP, nearWakeLengthModel=NearWakeLengthModel.ROTOR_DIAMETERS, viscosityFilter=ViscosityFilter.MADSEN, incomingWind=IncomingWind.AMBIENT, speedIncrement=0.25, deficitDepthFactor=0.6, deficitGradientFactor=0.35, cutOffFilterLengthFactor=2.0, windVelocity=0.0, windDirection=0.0, turbulenceIntencity=0.0, stabilityClass=StabilityClass.NONE, turbulenceBoxOption=TurbulenceBoxOption.DTUMANN, outputPrefix='diwa', includePowerResult=False, powerResultFormat=FileFormat.BINARY, includeVisualization=False, visualizationFormat=FileFormat.BINARY, animationTime=0.0, areaAveragingOption=AreaAveragingOption.RADIAL, filterLengthOption=FilterLengthOption.ROTOR, weightOption=WeightOption.UNIFORM, weightConst=1.0, applyLowPassFilter=True, applyAreaAveraging=False, lowPassFrequencyOption=LowPassFrequencyOption.CALC, lowPassFrequency=0.0, useYawMisalignment=False, interpolateYawMisalignment=False, wakeFlowModel=WakeFlowModel.JIMENEZ, yawIncrement=0.0, shaftDirectionDefinition=ShaftDirection.YAW, **kwargs):
|
|
125
138
|
super().__init__(**kwargs)
|
|
126
139
|
self.description = description
|
|
127
140
|
self.scriptableValues = list()
|
|
@@ -173,6 +186,12 @@ class Generator(Named,ConditionSelectable):
|
|
|
173
186
|
self.applyAreaAveraging = applyAreaAveraging
|
|
174
187
|
self.lowPassFrequencyOption = lowPassFrequencyOption
|
|
175
188
|
self.lowPassFrequency = lowPassFrequency
|
|
189
|
+
self.useYawMisalignment = useYawMisalignment
|
|
190
|
+
self.interpolateYawMisalignment = interpolateYawMisalignment
|
|
191
|
+
self.wakeFlowModel = wakeFlowModel
|
|
192
|
+
self.yawIncrement = yawIncrement
|
|
193
|
+
self.shaftDirectionDefinition = shaftDirectionDefinition
|
|
194
|
+
self.windTurbineMotions = list()
|
|
176
195
|
for key, value in kwargs.items():
|
|
177
196
|
if not isinstance(value, Dict):
|
|
178
197
|
setattr(self, key, value)
|
|
@@ -691,3 +710,65 @@ class Generator(Named,ConditionSelectable):
|
|
|
691
710
|
def lowPassFrequency(self, value: float):
|
|
692
711
|
"""Set lowPassFrequency"""
|
|
693
712
|
self.__lowPassFrequency = float(value)
|
|
713
|
+
|
|
714
|
+
@property
|
|
715
|
+
def useYawMisalignment(self) -> bool:
|
|
716
|
+
""""""
|
|
717
|
+
return self.__useYawMisalignment
|
|
718
|
+
|
|
719
|
+
@useYawMisalignment.setter
|
|
720
|
+
def useYawMisalignment(self, value: bool):
|
|
721
|
+
"""Set useYawMisalignment"""
|
|
722
|
+
self.__useYawMisalignment = bool(value)
|
|
723
|
+
|
|
724
|
+
@property
|
|
725
|
+
def interpolateYawMisalignment(self) -> bool:
|
|
726
|
+
"""Option for interpolation on specified yaw misalignment performance relations"""
|
|
727
|
+
return self.__interpolateYawMisalignment
|
|
728
|
+
|
|
729
|
+
@interpolateYawMisalignment.setter
|
|
730
|
+
def interpolateYawMisalignment(self, value: bool):
|
|
731
|
+
"""Set interpolateYawMisalignment"""
|
|
732
|
+
self.__interpolateYawMisalignment = bool(value)
|
|
733
|
+
|
|
734
|
+
@property
|
|
735
|
+
def wakeFlowModel(self) -> WakeFlowModel:
|
|
736
|
+
""""""
|
|
737
|
+
return self.__wakeFlowModel
|
|
738
|
+
|
|
739
|
+
@wakeFlowModel.setter
|
|
740
|
+
def wakeFlowModel(self, value: WakeFlowModel):
|
|
741
|
+
"""Set wakeFlowModel"""
|
|
742
|
+
self.__wakeFlowModel = value
|
|
743
|
+
|
|
744
|
+
@property
|
|
745
|
+
def yawIncrement(self) -> float:
|
|
746
|
+
"""Yaw misalignment increment used in deficit computation"""
|
|
747
|
+
return self.__yawIncrement
|
|
748
|
+
|
|
749
|
+
@yawIncrement.setter
|
|
750
|
+
def yawIncrement(self, value: float):
|
|
751
|
+
"""Set yawIncrement"""
|
|
752
|
+
self.__yawIncrement = float(value)
|
|
753
|
+
|
|
754
|
+
@property
|
|
755
|
+
def shaftDirectionDefinition(self) -> ShaftDirection:
|
|
756
|
+
"""Kind of shaft direction definition"""
|
|
757
|
+
return self.__shaftDirectionDefinition
|
|
758
|
+
|
|
759
|
+
@shaftDirectionDefinition.setter
|
|
760
|
+
def shaftDirectionDefinition(self, value: ShaftDirection):
|
|
761
|
+
"""Set shaftDirectionDefinition"""
|
|
762
|
+
self.__shaftDirectionDefinition = value
|
|
763
|
+
|
|
764
|
+
@property
|
|
765
|
+
def windTurbineMotions(self) -> List[WindTurbineMotion]:
|
|
766
|
+
""""""
|
|
767
|
+
return self.__windTurbineMotions
|
|
768
|
+
|
|
769
|
+
@windTurbineMotions.setter
|
|
770
|
+
def windTurbineMotions(self, value: List[WindTurbineMotion]):
|
|
771
|
+
"""Set windTurbineMotions"""
|
|
772
|
+
if not isinstance(value, Sequence):
|
|
773
|
+
raise ValueError("Expected sequense, but was " , type(value))
|
|
774
|
+
self.__windTurbineMotions = value
|
|
@@ -5,11 +5,11 @@ from enum import auto
|
|
|
5
5
|
|
|
6
6
|
class IncomingWind(Enum):
|
|
7
7
|
""""""
|
|
8
|
-
|
|
8
|
+
AMBIENT = auto()
|
|
9
9
|
INCOMING = auto()
|
|
10
10
|
|
|
11
11
|
def label(self):
|
|
12
|
-
if self == IncomingWind.
|
|
13
|
-
return "
|
|
12
|
+
if self == IncomingWind.AMBIENT:
|
|
13
|
+
return "Ambient"
|
|
14
14
|
if self == IncomingWind.INCOMING:
|
|
15
15
|
return "Incoming"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generated with MotionType
|
|
2
|
+
#
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from enum import auto
|
|
5
|
+
|
|
6
|
+
class MotionType(Enum):
|
|
7
|
+
""""""
|
|
8
|
+
POSI = auto()
|
|
9
|
+
DYND = auto()
|
|
10
|
+
|
|
11
|
+
def label(self):
|
|
12
|
+
if self == MotionType.POSI:
|
|
13
|
+
return "Global positions"
|
|
14
|
+
if self == MotionType.DYND:
|
|
15
|
+
return "Dynamic displacements"
|
|
@@ -7,6 +7,7 @@ from .blueprints.performancerelation import PerformanceRelationBlueprint
|
|
|
7
7
|
from typing import Dict
|
|
8
8
|
from ..sima import MOAO
|
|
9
9
|
from ..sima import ScriptableValue
|
|
10
|
+
from .performancerelationitem import PerformanceRelationItem
|
|
10
11
|
|
|
11
12
|
class PerformanceRelation(MOAO):
|
|
12
13
|
"""
|
|
@@ -15,27 +16,17 @@ class PerformanceRelation(MOAO):
|
|
|
15
16
|
description : str
|
|
16
17
|
(default "")
|
|
17
18
|
scriptableValues : List[ScriptableValue]
|
|
18
|
-
|
|
19
|
-
(default 0.0)
|
|
20
|
-
|
|
21
|
-
(default 0.0)
|
|
22
|
-
bladePitch : float
|
|
23
|
-
(default 0.0)
|
|
24
|
-
power : float
|
|
25
|
-
(default 0.0)
|
|
26
|
-
thrust : float
|
|
27
|
-
(default 0.0)
|
|
19
|
+
yawAngle : float
|
|
20
|
+
Yaw misalignment(default 0.0)
|
|
21
|
+
items : List[PerformanceRelationItem]
|
|
28
22
|
"""
|
|
29
23
|
|
|
30
|
-
def __init__(self , description="",
|
|
24
|
+
def __init__(self , description="", yawAngle=0.0, **kwargs):
|
|
31
25
|
super().__init__(**kwargs)
|
|
32
26
|
self.description = description
|
|
33
27
|
self.scriptableValues = list()
|
|
34
|
-
self.
|
|
35
|
-
self.
|
|
36
|
-
self.bladePitch = bladePitch
|
|
37
|
-
self.power = power
|
|
38
|
-
self.thrust = thrust
|
|
28
|
+
self.yawAngle = yawAngle
|
|
29
|
+
self.items = list()
|
|
39
30
|
for key, value in kwargs.items():
|
|
40
31
|
if not isinstance(value, Dict):
|
|
41
32
|
setattr(self, key, value)
|
|
@@ -70,51 +61,23 @@ class PerformanceRelation(MOAO):
|
|
|
70
61
|
self.__scriptableValues = value
|
|
71
62
|
|
|
72
63
|
@property
|
|
73
|
-
def
|
|
74
|
-
""""""
|
|
75
|
-
return self.
|
|
76
|
-
|
|
77
|
-
@windSpeed.setter
|
|
78
|
-
def windSpeed(self, value: float):
|
|
79
|
-
"""Set windSpeed"""
|
|
80
|
-
self.__windSpeed = float(value)
|
|
81
|
-
|
|
82
|
-
@property
|
|
83
|
-
def rotorSpeed(self) -> float:
|
|
84
|
-
""""""
|
|
85
|
-
return self.__rotorSpeed
|
|
64
|
+
def yawAngle(self) -> float:
|
|
65
|
+
"""Yaw misalignment"""
|
|
66
|
+
return self.__yawAngle
|
|
86
67
|
|
|
87
|
-
@
|
|
88
|
-
def
|
|
89
|
-
"""Set
|
|
90
|
-
self.
|
|
68
|
+
@yawAngle.setter
|
|
69
|
+
def yawAngle(self, value: float):
|
|
70
|
+
"""Set yawAngle"""
|
|
71
|
+
self.__yawAngle = float(value)
|
|
91
72
|
|
|
92
73
|
@property
|
|
93
|
-
def
|
|
74
|
+
def items(self) -> List[PerformanceRelationItem]:
|
|
94
75
|
""""""
|
|
95
|
-
return self.
|
|
96
|
-
|
|
97
|
-
@bladePitch.setter
|
|
98
|
-
def bladePitch(self, value: float):
|
|
99
|
-
"""Set bladePitch"""
|
|
100
|
-
self.__bladePitch = float(value)
|
|
76
|
+
return self.__items
|
|
101
77
|
|
|
102
|
-
@
|
|
103
|
-
def
|
|
104
|
-
""""""
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def power(self, value: float):
|
|
109
|
-
"""Set power"""
|
|
110
|
-
self.__power = float(value)
|
|
111
|
-
|
|
112
|
-
@property
|
|
113
|
-
def thrust(self) -> float:
|
|
114
|
-
""""""
|
|
115
|
-
return self.__thrust
|
|
116
|
-
|
|
117
|
-
@thrust.setter
|
|
118
|
-
def thrust(self, value: float):
|
|
119
|
-
"""Set thrust"""
|
|
120
|
-
self.__thrust = float(value)
|
|
78
|
+
@items.setter
|
|
79
|
+
def items(self, value: List[PerformanceRelationItem]):
|
|
80
|
+
"""Set items"""
|
|
81
|
+
if not isinstance(value, Sequence):
|
|
82
|
+
raise ValueError("Expected sequense, but was " , type(value))
|
|
83
|
+
self.__items = value
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# This an autogenerated file
|
|
2
|
+
#
|
|
3
|
+
# Generated with PerformanceRelationItem
|
|
4
|
+
from typing import Dict,Sequence,List
|
|
5
|
+
from dmt.blueprint import Blueprint
|
|
6
|
+
from .blueprints.performancerelationitem import PerformanceRelationItemBlueprint
|
|
7
|
+
from typing import Dict
|
|
8
|
+
from ..sima import MOAO
|
|
9
|
+
from ..sima import ScriptableValue
|
|
10
|
+
|
|
11
|
+
class PerformanceRelationItem(MOAO):
|
|
12
|
+
"""
|
|
13
|
+
Keyword arguments
|
|
14
|
+
-----------------
|
|
15
|
+
description : str
|
|
16
|
+
(default "")
|
|
17
|
+
scriptableValues : List[ScriptableValue]
|
|
18
|
+
windSpeed : float
|
|
19
|
+
(default 0.0)
|
|
20
|
+
rotorSpeed : float
|
|
21
|
+
(default 0.0)
|
|
22
|
+
bladePitch : float
|
|
23
|
+
(default 0.0)
|
|
24
|
+
power : float
|
|
25
|
+
(default 0.0)
|
|
26
|
+
thrust : float
|
|
27
|
+
(default 0.0)
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self , description="", windSpeed=0.0, rotorSpeed=0.0, bladePitch=0.0, power=0.0, thrust=0.0, **kwargs):
|
|
31
|
+
super().__init__(**kwargs)
|
|
32
|
+
self.description = description
|
|
33
|
+
self.scriptableValues = list()
|
|
34
|
+
self.windSpeed = windSpeed
|
|
35
|
+
self.rotorSpeed = rotorSpeed
|
|
36
|
+
self.bladePitch = bladePitch
|
|
37
|
+
self.power = power
|
|
38
|
+
self.thrust = thrust
|
|
39
|
+
for key, value in kwargs.items():
|
|
40
|
+
if not isinstance(value, Dict):
|
|
41
|
+
setattr(self, key, value)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def blueprint(self) -> Blueprint:
|
|
46
|
+
"""Return blueprint that this entity represents"""
|
|
47
|
+
return PerformanceRelationItemBlueprint()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def description(self) -> str:
|
|
52
|
+
""""""
|
|
53
|
+
return self.__description
|
|
54
|
+
|
|
55
|
+
@description.setter
|
|
56
|
+
def description(self, value: str):
|
|
57
|
+
"""Set description"""
|
|
58
|
+
self.__description = value
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def scriptableValues(self) -> List[ScriptableValue]:
|
|
62
|
+
""""""
|
|
63
|
+
return self.__scriptableValues
|
|
64
|
+
|
|
65
|
+
@scriptableValues.setter
|
|
66
|
+
def scriptableValues(self, value: List[ScriptableValue]):
|
|
67
|
+
"""Set scriptableValues"""
|
|
68
|
+
if not isinstance(value, Sequence):
|
|
69
|
+
raise ValueError("Expected sequense, but was " , type(value))
|
|
70
|
+
self.__scriptableValues = value
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def windSpeed(self) -> float:
|
|
74
|
+
""""""
|
|
75
|
+
return self.__windSpeed
|
|
76
|
+
|
|
77
|
+
@windSpeed.setter
|
|
78
|
+
def windSpeed(self, value: float):
|
|
79
|
+
"""Set windSpeed"""
|
|
80
|
+
self.__windSpeed = float(value)
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def rotorSpeed(self) -> float:
|
|
84
|
+
""""""
|
|
85
|
+
return self.__rotorSpeed
|
|
86
|
+
|
|
87
|
+
@rotorSpeed.setter
|
|
88
|
+
def rotorSpeed(self, value: float):
|
|
89
|
+
"""Set rotorSpeed"""
|
|
90
|
+
self.__rotorSpeed = float(value)
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def bladePitch(self) -> float:
|
|
94
|
+
""""""
|
|
95
|
+
return self.__bladePitch
|
|
96
|
+
|
|
97
|
+
@bladePitch.setter
|
|
98
|
+
def bladePitch(self, value: float):
|
|
99
|
+
"""Set bladePitch"""
|
|
100
|
+
self.__bladePitch = float(value)
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def power(self) -> float:
|
|
104
|
+
""""""
|
|
105
|
+
return self.__power
|
|
106
|
+
|
|
107
|
+
@power.setter
|
|
108
|
+
def power(self, value: float):
|
|
109
|
+
"""Set power"""
|
|
110
|
+
self.__power = float(value)
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def thrust(self) -> float:
|
|
114
|
+
""""""
|
|
115
|
+
return self.__thrust
|
|
116
|
+
|
|
117
|
+
@thrust.setter
|
|
118
|
+
def thrust(self, value: float):
|
|
119
|
+
"""Set thrust"""
|
|
120
|
+
self.__thrust = float(value)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generated with ShaftDirection
|
|
2
|
+
#
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from enum import auto
|
|
5
|
+
|
|
6
|
+
class ShaftDirection(Enum):
|
|
7
|
+
""""""
|
|
8
|
+
POSI = auto()
|
|
9
|
+
YAW = auto()
|
|
10
|
+
|
|
11
|
+
def label(self):
|
|
12
|
+
if self == ShaftDirection.POSI:
|
|
13
|
+
return "Global XY plane"
|
|
14
|
+
if self == ShaftDirection.YAW:
|
|
15
|
+
return "Yaw misalignment"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generated with WakeFlowModel
|
|
2
|
+
#
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from enum import auto
|
|
5
|
+
|
|
6
|
+
class WakeFlowModel(Enum):
|
|
7
|
+
""""""
|
|
8
|
+
JIMENEZ = auto()
|
|
9
|
+
BASTANKHAH = auto()
|
|
10
|
+
|
|
11
|
+
def label(self):
|
|
12
|
+
if self == WakeFlowModel.JIMENEZ:
|
|
13
|
+
return "Jimenez"
|
|
14
|
+
if self == WakeFlowModel.BASTANKHAH:
|
|
15
|
+
return "Bastankhah"
|
|
@@ -8,6 +8,7 @@ from .blueprints.windparkturbine import WindParkTurbineBlueprint
|
|
|
8
8
|
from typing import Dict
|
|
9
9
|
from ..sima import NamedObject
|
|
10
10
|
from ..sima import ScriptableValue
|
|
11
|
+
from .shaftdirection import ShaftDirection
|
|
11
12
|
from typing import TYPE_CHECKING
|
|
12
13
|
if TYPE_CHECKING:
|
|
13
14
|
from .windturbinetype import WindTurbineType
|
|
@@ -30,11 +31,13 @@ class WindParkTurbine(NamedObject):
|
|
|
30
31
|
Global z-coordinate of the hub(default 0.0)
|
|
31
32
|
shaftAngle : float
|
|
32
33
|
(default 0.0)
|
|
34
|
+
shaftDirection : ShaftDirection
|
|
35
|
+
Kind of shaft direction definition
|
|
33
36
|
target : bool
|
|
34
37
|
(default False)
|
|
35
38
|
"""
|
|
36
39
|
|
|
37
|
-
def __init__(self , description="", x=0.0, y=0.0, z=0.0, shaftAngle=0.0, target=False, **kwargs):
|
|
40
|
+
def __init__(self , description="", x=0.0, y=0.0, z=0.0, shaftAngle=0.0, shaftDirection=ShaftDirection.POSI, target=False, **kwargs):
|
|
38
41
|
super().__init__(**kwargs)
|
|
39
42
|
self.description = description
|
|
40
43
|
self.scriptableValues = list()
|
|
@@ -44,6 +47,7 @@ class WindParkTurbine(NamedObject):
|
|
|
44
47
|
self.y = y
|
|
45
48
|
self.z = z
|
|
46
49
|
self.shaftAngle = shaftAngle
|
|
50
|
+
self.shaftDirection = shaftDirection
|
|
47
51
|
self.target = target
|
|
48
52
|
for key, value in kwargs.items():
|
|
49
53
|
if not isinstance(value, Dict):
|
|
@@ -138,6 +142,16 @@ class WindParkTurbine(NamedObject):
|
|
|
138
142
|
"""Set shaftAngle"""
|
|
139
143
|
self.__shaftAngle = float(value)
|
|
140
144
|
|
|
145
|
+
@property
|
|
146
|
+
def shaftDirection(self) -> ShaftDirection:
|
|
147
|
+
"""Kind of shaft direction definition"""
|
|
148
|
+
return self.__shaftDirection
|
|
149
|
+
|
|
150
|
+
@shaftDirection.setter
|
|
151
|
+
def shaftDirection(self, value: ShaftDirection):
|
|
152
|
+
"""Set shaftDirection"""
|
|
153
|
+
self.__shaftDirection = value
|
|
154
|
+
|
|
141
155
|
@property
|
|
142
156
|
def target(self) -> bool:
|
|
143
157
|
""""""
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# This an autogenerated file
|
|
2
|
+
#
|
|
3
|
+
# Generated with WindTurbineMotion
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from typing import Dict,Sequence,List
|
|
6
|
+
from dmt.blueprint import Blueprint
|
|
7
|
+
from .blueprints.windturbinemotion import WindTurbineMotionBlueprint
|
|
8
|
+
from typing import Dict
|
|
9
|
+
from ..sima import MOAO
|
|
10
|
+
from ..sima import ScriptableValue
|
|
11
|
+
from .motiontype import MotionType
|
|
12
|
+
from typing import TYPE_CHECKING
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .windparkturbine import WindParkTurbine
|
|
15
|
+
|
|
16
|
+
class WindTurbineMotion(MOAO):
|
|
17
|
+
"""
|
|
18
|
+
Keyword arguments
|
|
19
|
+
-----------------
|
|
20
|
+
description : str
|
|
21
|
+
(default "")
|
|
22
|
+
scriptableValues : List[ScriptableValue]
|
|
23
|
+
turbine : WindParkTurbine
|
|
24
|
+
timeColumn : int
|
|
25
|
+
Column number for time(default 0)
|
|
26
|
+
shaftDirectionColumn : int
|
|
27
|
+
Column or time series number for shaft direction(default 0)
|
|
28
|
+
motionType : MotionType
|
|
29
|
+
Kind of motion time series input
|
|
30
|
+
file : str
|
|
31
|
+
File name for hub positions(default None)
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self , description="", timeColumn=0, shaftDirectionColumn=0, motionType=MotionType.POSI, **kwargs):
|
|
35
|
+
super().__init__(**kwargs)
|
|
36
|
+
self.description = description
|
|
37
|
+
self.scriptableValues = list()
|
|
38
|
+
self.turbine = None
|
|
39
|
+
self.timeColumn = timeColumn
|
|
40
|
+
self.shaftDirectionColumn = shaftDirectionColumn
|
|
41
|
+
self.motionType = motionType
|
|
42
|
+
self.file = None
|
|
43
|
+
for key, value in kwargs.items():
|
|
44
|
+
if not isinstance(value, Dict):
|
|
45
|
+
setattr(self, key, value)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def blueprint(self) -> Blueprint:
|
|
50
|
+
"""Return blueprint that this entity represents"""
|
|
51
|
+
return WindTurbineMotionBlueprint()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def description(self) -> str:
|
|
56
|
+
""""""
|
|
57
|
+
return self.__description
|
|
58
|
+
|
|
59
|
+
@description.setter
|
|
60
|
+
def description(self, value: str):
|
|
61
|
+
"""Set description"""
|
|
62
|
+
self.__description = value
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def scriptableValues(self) -> List[ScriptableValue]:
|
|
66
|
+
""""""
|
|
67
|
+
return self.__scriptableValues
|
|
68
|
+
|
|
69
|
+
@scriptableValues.setter
|
|
70
|
+
def scriptableValues(self, value: List[ScriptableValue]):
|
|
71
|
+
"""Set scriptableValues"""
|
|
72
|
+
if not isinstance(value, Sequence):
|
|
73
|
+
raise ValueError("Expected sequense, but was " , type(value))
|
|
74
|
+
self.__scriptableValues = value
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def turbine(self) -> WindParkTurbine:
|
|
78
|
+
""""""
|
|
79
|
+
return self.__turbine
|
|
80
|
+
|
|
81
|
+
@turbine.setter
|
|
82
|
+
def turbine(self, value: WindParkTurbine):
|
|
83
|
+
"""Set turbine"""
|
|
84
|
+
self.__turbine = value
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def timeColumn(self) -> int:
|
|
88
|
+
"""Column number for time"""
|
|
89
|
+
return self.__timeColumn
|
|
90
|
+
|
|
91
|
+
@timeColumn.setter
|
|
92
|
+
def timeColumn(self, value: int):
|
|
93
|
+
"""Set timeColumn"""
|
|
94
|
+
self.__timeColumn = int(value)
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def shaftDirectionColumn(self) -> int:
|
|
98
|
+
"""Column or time series number for shaft direction"""
|
|
99
|
+
return self.__shaftDirectionColumn
|
|
100
|
+
|
|
101
|
+
@shaftDirectionColumn.setter
|
|
102
|
+
def shaftDirectionColumn(self, value: int):
|
|
103
|
+
"""Set shaftDirectionColumn"""
|
|
104
|
+
self.__shaftDirectionColumn = int(value)
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def motionType(self) -> MotionType:
|
|
108
|
+
"""Kind of motion time series input"""
|
|
109
|
+
return self.__motionType
|
|
110
|
+
|
|
111
|
+
@motionType.setter
|
|
112
|
+
def motionType(self, value: MotionType):
|
|
113
|
+
"""Set motionType"""
|
|
114
|
+
self.__motionType = value
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def file(self) -> str:
|
|
118
|
+
"""File name for hub positions"""
|
|
119
|
+
return self.__file
|
|
120
|
+
|
|
121
|
+
@file.setter
|
|
122
|
+
def file(self, value: str):
|
|
123
|
+
"""Set file"""
|
|
124
|
+
self.__file = value
|
simapy/sima_reader.py
CHANGED
|
@@ -6,6 +6,7 @@ from typing import Sequence
|
|
|
6
6
|
from dmt.entity import Entity
|
|
7
7
|
from dmt.dmt_reader import DMTReader
|
|
8
8
|
from .sima.modelcontent import ModelContent
|
|
9
|
+
from .sima.package_info import packages
|
|
9
10
|
|
|
10
11
|
class SIMAReader():
|
|
11
12
|
""" Creates entities from Dicts or file """
|
|
@@ -17,4 +18,17 @@ class SIMAReader():
|
|
|
17
18
|
modelcontent: ModelContent = res[0]
|
|
18
19
|
else:
|
|
19
20
|
modelcontent: ModelContent = res
|
|
21
|
+
self.__check_version(modelcontent)
|
|
20
22
|
return modelcontent.contents
|
|
23
|
+
|
|
24
|
+
def __check_version(self, modelcontent: ModelContent):
|
|
25
|
+
""" Check if imported model has the same version as the reader """
|
|
26
|
+
header = modelcontent.header
|
|
27
|
+
if header:
|
|
28
|
+
pkgs = modelcontent.header.packages
|
|
29
|
+
for pkg in pkgs:
|
|
30
|
+
version = packages.get(pkg.name)
|
|
31
|
+
if not version:
|
|
32
|
+
raise ValueError(f"Unknown package {pkg.name}")
|
|
33
|
+
if version != pkg.version:
|
|
34
|
+
raise ValueError(f"Package {pkg.name} has version {pkg.version} but reader expects {version}. Please use the correct version of simapy for the corresponding version of SIMA.")
|
simapy/sima_writer.py
CHANGED
|
@@ -24,8 +24,8 @@ class SIMAWriter():
|
|
|
24
24
|
content = ModelContent()
|
|
25
25
|
header = Header()
|
|
26
26
|
|
|
27
|
-
for
|
|
28
|
-
header.packages.append(PackageInfo(
|
|
27
|
+
for name,version in packages.items():
|
|
28
|
+
header.packages.append(PackageInfo(name=name,version=version))
|
|
29
29
|
|
|
30
30
|
content.header = header
|
|
31
31
|
content.contents.extend(models)
|
simapy/sre.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"""Run a command using SIMA runtime engine (sre executable)"""
|
|
2
2
|
import asyncio
|
|
3
3
|
import os
|
|
4
|
+
import re
|
|
4
5
|
from pathlib import Path
|
|
5
|
-
from typing import Sequence
|
|
6
|
+
from typing import Sequence,Callable
|
|
6
7
|
from simapy.sima_writer import SIMAWriter
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
async def run_command(args, error_file, out_file):
|
|
10
|
+
async def run_command(args, error_file, out_file, status_handler):
|
|
10
11
|
""""Run a command asynchronously and print output to standard out.
|
|
11
12
|
Standard err is piped to stderr.txt in the working directory"""
|
|
12
13
|
process = await asyncio.create_subprocess_exec(
|
|
@@ -14,26 +15,41 @@ async def run_command(args, error_file, out_file):
|
|
|
14
15
|
)
|
|
15
16
|
|
|
16
17
|
while True:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
# Use an awaitable to read data from stdout
|
|
19
|
+
# Read the next line of data from stdout asynchronously
|
|
20
|
+
data = await process.stdout.readline()
|
|
21
|
+
if not data:
|
|
22
|
+
break # Break the loop when there's no more data
|
|
23
|
+
sline = data.decode('utf-8')
|
|
24
|
+
if status_handler and sline.startswith("@STATUS"):
|
|
25
|
+
__parse_status(sline,status_handler)
|
|
26
|
+
else:
|
|
27
|
+
print(sline, end="\n")
|
|
28
|
+
print(sline, end="\n", file=out_file)
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
# Wait for the subprocess to finish
|
|
31
|
+
await process.wait()
|
|
32
|
+
if process.returncode is not None:
|
|
33
|
+
return process.returncode
|
|
30
34
|
|
|
35
|
+
def __parse_status(line: str,status_handler):
|
|
36
|
+
# A status line looks like this: @STATUS "Total" 100 1000
|
|
37
|
+
# The first number is the current value, the second is the total
|
|
38
|
+
pattern = r'@STATUS "(?P<label>\w+)" (?P<current>\d+) (?P<total>\d+)'
|
|
39
|
+
# Match the pattern in the string
|
|
40
|
+
match = re.match(pattern, line)
|
|
41
|
+
if match:
|
|
42
|
+
label = match.group('label')
|
|
43
|
+
current = int(match.group('current'))
|
|
44
|
+
total = int(match.group('total'))
|
|
45
|
+
status_handler(label,current,total)
|
|
31
46
|
|
|
32
47
|
class SIMA:
|
|
33
48
|
""""Run a command using SIMA runtime engine (sre executable)"""
|
|
34
49
|
|
|
35
50
|
def __init__(self, exe=None, fail_on_error=True):
|
|
36
51
|
self.fail_on_error = fail_on_error
|
|
52
|
+
self.status_handler: Callable = None
|
|
37
53
|
if exe:
|
|
38
54
|
self.exe = exe
|
|
39
55
|
else:
|
|
@@ -42,22 +58,24 @@ class SIMA:
|
|
|
42
58
|
raise ValueError("No executable given, and SRE_EXE environment variable is not set")
|
|
43
59
|
|
|
44
60
|
|
|
45
|
-
def run(self, working_dir
|
|
61
|
+
def run(self, working_dir, command_args: Sequence[str]):
|
|
46
62
|
"""Run the sima executable and print output to standard out.
|
|
47
63
|
Standard err is piped to stderr.txt in the working directory"""
|
|
64
|
+
|
|
65
|
+
wdir = Path(str(working_dir))
|
|
48
66
|
arguments = [self.exe]
|
|
49
67
|
arguments.extend(["-configuration", "/var/opt/sima/config"])
|
|
50
68
|
arguments.append("-consoleLog")
|
|
51
69
|
arguments.append("--progress")
|
|
52
70
|
arguments.extend(["-data", working_dir])
|
|
53
|
-
|
|
71
|
+
wdir.mkdir(parents=True, exist_ok=True)
|
|
54
72
|
self.__add_command_args(working_dir, arguments, command_args)
|
|
55
|
-
err_file =
|
|
56
|
-
out_file =
|
|
57
|
-
with open(err_file, "w", encoding="utf8") as
|
|
73
|
+
err_file = wdir / "stderr.txt"
|
|
74
|
+
out_file = wdir / "stdout.txt"
|
|
75
|
+
with open(err_file, "w", encoding="utf8") as e_f, open(
|
|
58
76
|
out_file, "w", encoding="utf8"
|
|
59
|
-
) as
|
|
60
|
-
exit_code = asyncio.run(run_command(arguments,
|
|
77
|
+
) as o_f:
|
|
78
|
+
exit_code = asyncio.run(run_command(arguments, e_f, o_f, self.status_handler))
|
|
61
79
|
if exit_code != 0 and self.fail_on_error:
|
|
62
80
|
raise RuntimeError(f"SIMA exited with error code {exit_code}")
|
|
63
81
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: simapy
|
|
3
|
-
Version: 4.6.
|
|
3
|
+
Version: 4.6.1.dev0
|
|
4
4
|
Summary: Python utilities for SIMA
|
|
5
5
|
Home-page: https://github.com/SINTEF/simapy
|
|
6
6
|
Author: SINTEF Ocean
|
|
7
|
+
License: UNKNOWN
|
|
8
|
+
Platform: UNKNOWN
|
|
7
9
|
Classifier: Programming Language :: Python :: 3
|
|
8
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -18,12 +20,20 @@ SIMAPY - Python utilities for SIMA
|
|
|
18
20
|
|
|
19
21
|
This Python library can be used to interact with [SIMA](https://sima.sintef.no)
|
|
20
22
|
|
|
21
|
-
Parts of the library is generated from
|
|
23
|
+
Parts of the library is generated from [data models](https://github.com/SINTEF/sima-dmt-models) using a [Python code generator](https://github.com/SINTEF/dmt-gen-py)
|
|
22
24
|
|
|
23
25
|
Please examine the tests for ways to interact
|
|
24
26
|
|
|
25
27
|
Also check out the examples in [simapy-examples](https://github.com/SINTEF/simapy-examples)
|
|
26
28
|
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install simapy.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install simapy
|
|
35
|
+
```
|
|
36
|
+
|
|
27
37
|
## Dependencies
|
|
28
38
|
|
|
29
39
|
* [DMTPY](https://github.com/SINTEF/dmtpy)
|
|
@@ -35,3 +45,5 @@ Also check out the examples in [simapy-examples](https://github.com/SINTEF/simap
|
|
|
35
45
|
## License
|
|
36
46
|
|
|
37
47
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
48
|
+
|
|
49
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
simapy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
simapy/sima_reader.py,sha256=
|
|
3
|
-
simapy/sima_writer.py,sha256=
|
|
4
|
-
simapy/sre.py,sha256=
|
|
2
|
+
simapy/sima_reader.py,sha256=86P_CMaz1i6o8pIzXtNBHcJj0zS6Bw8_8BVO-Wvzs5c,1364
|
|
3
|
+
simapy/sima_writer.py,sha256=MPwvooPLfGpOISxJUVlOWbtf4wVOEvgVCVsvQfLzxxY,1209
|
|
4
|
+
simapy/sre.py,sha256=M2Lhwecrx030C7sDceOks1KM94i13Jry2FBIuE6nIJ0,4045
|
|
5
5
|
simapy/metocean/__init__.py,sha256=AeEF1FYpBDe46JuZ0EYJOofOuf2dwsaAdQZ0DsseB_g,39
|
|
6
6
|
simapy/metocean/metocean.py,sha256=TmfSYezAzxWLt9n_ChLKIdaIz6GxSTUu6-5wnipQz6Y,2912
|
|
7
7
|
simapy/metocean/package_info.py,sha256=6FEJ4gZkXieP2WWTA-oZO23BjQOi4YnXx3nLQY0ydYE,208
|
|
@@ -70,7 +70,7 @@ simapy/metocean/scatter/blueprints/windcurrent.py,sha256=lNR5Y7y-gjWo1SpHyMIOg3Z
|
|
|
70
70
|
simapy/sima/__init__.py,sha256=vSYgUegrUGeABTa0EaQ6arITEaz9Nhy0sNsC0TWCTW4,127
|
|
71
71
|
simapy/sima/header.py,sha256=97CWJjRGUokQ-VDeaDYrUi06JKgyU0qZh037RHv01PI,1442
|
|
72
72
|
simapy/sima/modelcontent.py,sha256=HRP2YuN05rJjPO0eLJVmRSTsS5sSODKd66ce66lC2_o,1697
|
|
73
|
-
simapy/sima/package_info.py,sha256=
|
|
73
|
+
simapy/sima/package_info.py,sha256=b2lrouwC5nCYB5WON-aArm1lXSdLI39xWQ5mYpeUGng,284
|
|
74
74
|
simapy/sima/packageinfo.py,sha256=f_8twmLCJ-7IBtzOit94I6ya4AyfRXNQSjto6TDGycE,1564
|
|
75
75
|
simapy/sima/blueprints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
simapy/sima/blueprints/header.py,sha256=Z4l7ACY3WvgqqIPYDhQB2KAn2mMw-KZOfBDZUfXKMnw,655
|
|
@@ -2175,7 +2175,7 @@ simapy/sima/wamit/blueprints/wamitresultentry.py,sha256=zBtOJvxnvu6Ft3Og0LDfLtIz
|
|
|
2175
2175
|
simapy/sima/wamit/blueprints/wamittask.py,sha256=T0k_fy8gZ1MXE7SMlY5InwnxeX8n4FiJ32Ado4Ytvyw,1867
|
|
2176
2176
|
simapy/sima/wamit/blueprints/wamitwave.py,sha256=qocgbxkqJGZIynoIMnZOS9-L6XM9x8jm-y7botbOsyw,887
|
|
2177
2177
|
simapy/sima/wamit/blueprints/wamitwavedriftforce.py,sha256=pkbkf-eictLMqU5JGHEzHL_bWgY5RfBjVSR6aZQr7as,1889
|
|
2178
|
-
simapy/sima/windpark/__init__.py,sha256=
|
|
2178
|
+
simapy/sima/windpark/__init__.py,sha256=KRE_7CQux5JzrsI41o8igK0kCTMDUXkLC6fKlfXhtRs,1628
|
|
2179
2179
|
simapy/sima/windpark/areaaveragingoption.py,sha256=qSChm6Eb-wm66oI3a3tT4vBMiKp4II_8JH9MZCHz20A,460
|
|
2180
2180
|
simapy/sima/windpark/bladeelement.py,sha256=AjH21kDguSolKyZjJBO98RGyF32tNCVmySJu6gacUvo,2898
|
|
2181
2181
|
simapy/sima/windpark/deficitanalysisoption.py,sha256=0DBhe0MKR2Da98txuXX6JbbH39Pw-4DAbKti-kjx0MU,339
|
|
@@ -2183,31 +2183,38 @@ simapy/sima/windpark/deficitfilecontents.py,sha256=caY_iLqBZSuXoyBTtgJTQBpCPy-v5
|
|
|
2183
2183
|
simapy/sima/windpark/fileformat.py,sha256=trP6Ca1y-MnuJ3ktGSaJAqUMWQlF2zDAGZRUBgxVDvU,315
|
|
2184
2184
|
simapy/sima/windpark/filterlengthoption.py,sha256=rbg_LX9Qn5T_kmt40jsa3G_2bBI7k5thKCmdYp1iFd4,345
|
|
2185
2185
|
simapy/sima/windpark/focus.py,sha256=KFrTDfPGMRYBbsHEpod8WXAwlHuG0bf0_JthoIXXuT0,278
|
|
2186
|
-
simapy/sima/windpark/generator.py,sha256=
|
|
2187
|
-
simapy/sima/windpark/incomingwind.py,sha256=
|
|
2186
|
+
simapy/sima/windpark/generator.py,sha256=6eyFiH9ISZJ3p_R2GZanlJxhyTmHzCBJsCdcSpV9snE,27054
|
|
2187
|
+
simapy/sima/windpark/incomingwind.py,sha256=NjBTtkrtb1wRSIRNdCsloFTAqG4bQqMf_mFt6hPlrjA,321
|
|
2188
2188
|
simapy/sima/windpark/lowpassfrequencyoption.py,sha256=HLVbGBQRMox_ArGrDeABZvxgbNT4axbpCOrpI-CXfpg,348
|
|
2189
2189
|
simapy/sima/windpark/meanderinganalysisoption.py,sha256=3_kBBUAMr2qW6o_m0zz1OAPzvX6jgiJlNkF-QKE-Fxs,351
|
|
2190
|
+
simapy/sima/windpark/motiontype.py,sha256=Ma9hNQUYVSukFrCDWqWAU61LxErkESZ85rlwMbpCAYw,321
|
|
2190
2191
|
simapy/sima/windpark/multipledeficitmethod.py,sha256=bmH1jh8hxANrldLtPeRYBoCGv8X05_idtHca4tj3ynM,485
|
|
2191
2192
|
simapy/sima/windpark/nearwakelengthmodel.py,sha256=x64jQVGRTMf44djxRPRT-UcgZ7qWuJMDDWSFzmqhw24,551
|
|
2192
|
-
simapy/sima/windpark/performancerelation.py,sha256=
|
|
2193
|
+
simapy/sima/windpark/performancerelation.py,sha256=shetly51PyMlWahUD41D7Vk3HLGX601Dyi3O1Gr5Zis,2408
|
|
2194
|
+
simapy/sima/windpark/performancerelationitem.py,sha256=83wxA_QdDGI_7gI0At9kGfOib6bMN2kCaCGqc-qBlqE,3148
|
|
2193
2195
|
simapy/sima/windpark/poweroption.py,sha256=BKt2gYAwztkOnClbSzuy7PaKziX5cn3xzbs9Ti3YVLw,299
|
|
2194
2196
|
simapy/sima/windpark/scalingoption.py,sha256=qF7eYcj754htllF4YcdrbAI8D0NzWIoAIScXrlxrmzg,559
|
|
2197
|
+
simapy/sima/windpark/shaftdirection.py,sha256=HtWIiwDArXyLP08Ke5KHx-Ztwo_yBc4iU-frKq0oADQ,329
|
|
2195
2198
|
simapy/sima/windpark/stabilityclass.py,sha256=LcOCTKPySrjPol80DkfQ09O9IchVFtXqSvGgNuQuDhA,935
|
|
2196
2199
|
simapy/sima/windpark/turbinedirection.py,sha256=haer_pQLmruDx-Y3gWcWTMScbyX4LmPKIw6iLjkj8AE,334
|
|
2197
2200
|
simapy/sima/windpark/turbulenceboxoption.py,sha256=mWnqn9HdftDWmcXBjUvv3eZhl_OCcBDwqQ_r9DuC5sg,347
|
|
2198
2201
|
simapy/sima/windpark/turbulenceboxscaling.py,sha256=9DfFanqnNYcNWlw1YsdfSntk7Av5X_fRThD7FlpPwbU,3562
|
|
2199
2202
|
simapy/sima/windpark/viscosityfilter.py,sha256=Xzon-tOa_qphn9qAJDKj9kFJjz0nU6Nhm0fvKotLwTA,544
|
|
2203
|
+
simapy/sima/windpark/wakeflowmodel.py,sha256=ERpMy1tydmQEpak8hdHFnT7tNIUrV1Qd0j0nA_t2nmM,331
|
|
2200
2204
|
simapy/sima/windpark/weightoption.py,sha256=LIlTz0GLOS2fjlVcc7hjJBHoEVupNDDppXwMIzk-wnU,446
|
|
2201
2205
|
simapy/sima/windpark/windparktask.py,sha256=ZVtWsFecP0zRur_niL8P9XSNWoI49w4QscVN6Qyim7U,6582
|
|
2202
|
-
simapy/sima/windpark/windparkturbine.py,sha256=
|
|
2206
|
+
simapy/sima/windpark/windparkturbine.py,sha256=66AXRtTHtIRkLlbiACwnU_i7F5w4LfCbsxh4fIAtSoY,4250
|
|
2207
|
+
simapy/sima/windpark/windturbinemotion.py,sha256=vWVdCTZxObSy0F_efbFid6ahM1iarW-JpuN1ZSqj1Fc,3601
|
|
2203
2208
|
simapy/sima/windpark/windturbinetype.py,sha256=L2OXHrRJy9NAhGnDnpd7aFtj4Jhm8r659FvoeWJAk-M,5753
|
|
2204
2209
|
simapy/sima/windpark/blueprints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2205
2210
|
simapy/sima/windpark/blueprints/bladeelement.py,sha256=fg_lia_UHMPyuIi01Gi__NDC8Txpg5RbzsdRBRWPo2E,1048
|
|
2206
|
-
simapy/sima/windpark/blueprints/generator.py,sha256
|
|
2207
|
-
simapy/sima/windpark/blueprints/performancerelation.py,sha256=
|
|
2211
|
+
simapy/sima/windpark/blueprints/generator.py,sha256=-D9_tm-Skf3Hc3J6LoZfhVtIxH4mkdcXjw3aWWkJbKo,7045
|
|
2212
|
+
simapy/sima/windpark/blueprints/performancerelation.py,sha256=pIZ7_1uo7jE0XVkIRT1g1hn4nmaThpGfwOt1FWgm-lQ,927
|
|
2213
|
+
simapy/sima/windpark/blueprints/performancerelationitem.py,sha256=XsqVOw6FLaV-IYOJ5SNF86DVQpEqAM9uVe_IV540KV4,1100
|
|
2208
2214
|
simapy/sima/windpark/blueprints/turbulenceboxscaling.py,sha256=7eachjEwtglPN257gZh23hC98ynxTB1TwHRaW4-HAfY,1099
|
|
2209
2215
|
simapy/sima/windpark/blueprints/windparktask.py,sha256=LWMMBDsBM1K_2eTMy_hpC22GhzLZsslL_4nIdtZfcIU,1904
|
|
2210
|
-
simapy/sima/windpark/blueprints/windparkturbine.py,sha256
|
|
2216
|
+
simapy/sima/windpark/blueprints/windparkturbine.py,sha256=2iVb8vfRx0krqESY7OUVcek6_pHjoRk5u-oKLnyfyD4,1452
|
|
2217
|
+
simapy/sima/windpark/blueprints/windturbinemotion.py,sha256=K0ANR5FebcwLl7n2AA93rzo53YO9pyyuhQS4CEypkf8,1244
|
|
2211
2218
|
simapy/sima/windpark/blueprints/windturbinetype.py,sha256=qrzad4nxoKdXtVty9TVLUTD51s3zrTjSJFffbh0PhtA,1702
|
|
2212
2219
|
simapy/sima/windturbine/__init__.py,sha256=BPBTFl-hOotQ3iXlvNHmK-8wDA66kVmjDZKqxS8AuyE,1371
|
|
2213
2220
|
simapy/sima/windturbine/airfoil.py,sha256=63wVw-Ag_nleWlA3_GfjPU1EbJ0yyCJRj3JjlIR67b4,6277
|
|
@@ -2393,8 +2400,8 @@ simapy/sima/workflow/blueprints/workflowsetitem.py,sha256=EyyxbrnPDcL-f1cgjWcH3o
|
|
|
2393
2400
|
simapy/sima/workflow/blueprints/workflowsetnode.py,sha256=UIZYi61xYtOEBzSZ5wQclUjzdAarZ8ymJ67iGARdXH4,4018
|
|
2394
2401
|
simapy/sima/workflow/blueprints/workflowtask.py,sha256=c1rpN0KRKg7zIhonXKEaAGL0c6k8-ecIcP3RK3EUD8g,1514
|
|
2395
2402
|
simapy/sima/workflow/blueprints/xytablenode.py,sha256=J-ADKlq47efkQMbay2eS0WJGtB9K0B75caOUTbj7Ogs,1667
|
|
2396
|
-
simapy-4.6.
|
|
2397
|
-
simapy-4.6.
|
|
2398
|
-
simapy-4.6.
|
|
2399
|
-
simapy-4.6.
|
|
2400
|
-
simapy-4.6.
|
|
2403
|
+
simapy-4.6.1.dev0.dist-info/LICENSE,sha256=F5QFv7maV1Hoof3UbIwTNKqDFoo2JykLoI_w6F4HqxI,1088
|
|
2404
|
+
simapy-4.6.1.dev0.dist-info/METADATA,sha256=RXFQ7YP9_9z4tNzSr22AIovvcRcBkV1gE9gESWgWlvI,1342
|
|
2405
|
+
simapy-4.6.1.dev0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
2406
|
+
simapy-4.6.1.dev0.dist-info/top_level.txt,sha256=AVWKlvxcgSVR0H1omucqMujOVuQbcFNLjlgp3skT_1Q,7
|
|
2407
|
+
simapy-4.6.1.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|