simapy 4.8.0.dev0__py3-none-any.whl → 5.0.0.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/progress_handler.py +51 -0
- simapy/sima/command/__init__.py +0 -1
- simapy/sima/command/blueprints/compoundcommand.py +2 -2
- simapy/sima/command/blueprints/conditionruncommand.py +5 -2
- simapy/sima/command/blueprints/exportblueprintcommand.py +1 -1
- simapy/sima/command/blueprints/exportcommand.py +1 -1
- simapy/sima/command/blueprints/externalcommand.py +1 -1
- simapy/sima/command/blueprints/gitimportcommand.py +1 -1
- simapy/sima/command/blueprints/importcommand.py +3 -2
- simapy/sima/command/blueprints/internalcommand.py +1 -1
- simapy/sima/command/blueprints/preferencecommand.py +1 -1
- simapy/sima/command/blueprints/scriptruncommand.py +1 -1
- simapy/sima/command/blueprints/storagetaskrootcommand.py +1 -1
- simapy/sima/command/blueprints/testruncommand.py +1 -1
- simapy/sima/command/blueprints/workflowinputcommand.py +1 -1
- simapy/sima/command/blueprints/workflowruncommand.py +1 -1
- simapy/sima/command/compoundcommand.py +1 -1
- simapy/sima/command/conditionruncommand.py +45 -3
- simapy/sima/command/exportblueprintcommand.py +1 -1
- simapy/sima/command/exportcommand.py +1 -1
- simapy/sima/command/externalcommand.py +1 -1
- simapy/sima/command/gitimportcommand.py +1 -1
- simapy/sima/command/importcommand.py +14 -1
- simapy/sima/command/internalcommand.py +1 -1
- simapy/sima/command/preferencecommand.py +1 -1
- simapy/sima/command/scriptruncommand.py +1 -1
- simapy/sima/command/storagetaskrootcommand.py +1 -1
- simapy/sima/command/testruncommand.py +1 -1
- simapy/sima/command/workflowinputcommand.py +1 -1
- simapy/sima/command/workflowruncommand.py +1 -1
- simapy/sima/environment/__init__.py +1 -0
- simapy/sima/environment/blueprints/fluctuatingthreecomponent.py +5 -4
- simapy/sima/environment/blueprints/regularcurrentfromfile.py +17 -0
- simapy/sima/environment/blueprints/stationaryuniform.py +1 -1
- simapy/sima/environment/fluctuatingthreecomponent.py +20 -7
- simapy/sima/environment/regularcurrentfromfile.py +68 -0
- simapy/sima/environment/stationaryuniform.py +2 -2
- simapy/sima/hydro/__init__.py +8 -1
- simapy/sima/hydro/blueprints/differencefrequencyqtf.py +7 -3
- simapy/sima/hydro/blueprints/hydrostaticstiffnessdata.py +1 -3
- simapy/sima/hydro/blueprints/hydrostaticstiffnessmatrixdata.py +18 -0
- simapy/sima/hydro/blueprints/linearhydrostatics.py +26 -0
- simapy/sima/hydro/blueprints/retardationfunctioncalculationparameters.py +21 -0
- simapy/sima/hydro/blueprints/sumfrequencyqtf.py +2 -2
- simapy/sima/hydro/blueprints/wamitimportconfiguration.py +23 -0
- simapy/sima/hydro/differencefrequencyqtf.py +55 -3
- simapy/sima/hydro/directionsymmetry.py +1 -4
- simapy/sima/hydro/hydrostaticstiffnessdata.py +0 -26
- simapy/sima/hydro/hydrostaticstiffnessmatrixdata.py +81 -0
- simapy/sima/hydro/linearhydrostatics.py +185 -0
- simapy/sima/hydro/qtfinput.py +15 -0
- simapy/sima/hydro/retardationfunctioncalculationparameters.py +120 -0
- simapy/sima/hydro/sumfrequencyqtf.py +2 -2
- simapy/sima/hydro/wamitimportconfiguration.py +145 -0
- simapy/sima/hydro/wamitqtfimportoption.py +18 -0
- simapy/sima/hydro/wamitwavedriftforceoption.py +18 -0
- simapy/sima/hydro/wamitwaveforceoption.py +15 -0
- simapy/sima/package_info.py +2 -2
- simapy/sima/riflex/__init__.py +9 -0
- simapy/sima/riflex/arline.py +15 -0
- simapy/sima/riflex/blueprints/arline.py +2 -1
- simapy/sima/{hydro/blueprints/sparseqtf.py → riflex/blueprints/capacitycheck.py} +6 -5
- simapy/sima/riflex/blueprints/chaincrosssection.py +1 -1
- simapy/sima/riflex/blueprints/dnv_os_e301capacitycheck.py +29 -0
- simapy/sima/riflex/blueprints/dnv_os_f201combinedloading.py +0 -1
- simapy/sima/riflex/blueprints/dynamicloads.py +2 -1
- simapy/sima/riflex/blueprints/envelopecurvespecification.py +3 -6
- simapy/sima/riflex/blueprints/fatigueanalysis.py +2 -1
- simapy/sima/riflex/blueprints/horizontalaxiscontroller.py +2 -1
- simapy/sima/riflex/blueprints/iso_13628_7combinedloading.py +0 -1
- simapy/sima/riflex/blueprints/localelementaxis.py +2 -3
- simapy/sima/riflex/blueprints/marinegrowthscaling.py +18 -0
- simapy/sima/riflex/blueprints/nonlinearintegrationprocedure.py +2 -2
- simapy/sima/riflex/blueprints/parametervariation.py +4 -3
- simapy/sima/riflex/blueprints/riflexmodel.py +1 -0
- simapy/sima/riflex/blueprints/riflexstaticcalculationparameters.py +1 -0
- simapy/sima/riflex/blueprints/slendersystem.py +0 -1
- simapy/sima/riflex/blueprints/staticloadtypeitem.py +5 -4
- simapy/sima/riflex/blueprints/tensionandcurvaturecapacitycheck.py +29 -0
- simapy/sima/riflex/blueprints/tnfatigueanalysisitem.py +26 -0
- simapy/sima/riflex/blueprints/userdefinedelement.py +2 -1
- simapy/sima/riflex/blueprints/vonmisescombinedloading.py +0 -1
- simapy/sima/riflex/blueprints/windvelocityramping.py +20 -0
- simapy/sima/{hydro/sparseqtf.py → riflex/capacitycheck.py} +18 -5
- simapy/sima/riflex/chaincrosssection.py +2 -2
- simapy/sima/riflex/dnv_os_e301capacitycheck.py +227 -0
- simapy/sima/riflex/dnv_os_f201combinedloading.py +1 -15
- simapy/sima/riflex/dynamicloads.py +13 -0
- simapy/sima/riflex/endreference.py +18 -0
- simapy/sima/riflex/envelopecurvespecification.py +31 -70
- simapy/sima/riflex/fatigueanalysis.py +16 -0
- simapy/sima/riflex/horizontalaxiscontroller.py +15 -2
- simapy/sima/riflex/iso_13628_7combinedloading.py +1 -15
- simapy/sima/riflex/localelementaxis.py +2 -16
- simapy/sima/riflex/marinegrowthscaling.py +84 -0
- simapy/sima/riflex/matrixstorage.py +3 -0
- simapy/sima/riflex/nonlinearintegrationprocedure.py +3 -3
- simapy/sima/riflex/parametervariation.py +16 -3
- simapy/sima/riflex/riflexmodel.py +15 -0
- simapy/sima/riflex/riflexstaticcalculationparameters.py +14 -1
- simapy/sima/riflex/slendersystem.py +0 -15
- simapy/sima/riflex/staticloadtypeitem.py +24 -7
- simapy/sima/riflex/tensionandcurvaturecapacitycheck.py +227 -0
- simapy/sima/riflex/tnfatigueanalysisitem.py +190 -0
- simapy/sima/riflex/typeofunit.py +18 -0
- simapy/sima/riflex/userdefinedelement.py +15 -1
- simapy/sima/riflex/utilizationcheck.py +18 -0
- simapy/sima/riflex/vonmisescombinedloading.py +1 -15
- simapy/sima/riflex/windvelocityramping.py +107 -0
- simapy/sima/signals/report/axis.py +27 -1
- simapy/sima/signals/report/blueprints/axis.py +3 -1
- simapy/sima/sima/__init__.py +1 -0
- simapy/sima/{command → sima}/blueprints/command.py +2 -2
- simapy/sima/{command → sima}/command.py +2 -2
- simapy/sima/simo/__init__.py +0 -2
- simapy/sima/simo/blueprints/nonlinearhydrostaticstiffness.py +2 -2
- simapy/sima/simo/blueprints/simobody.py +2 -3
- simapy/sima/simo/blueprints/simodynamiccalculationparameters.py +3 -2
- simapy/sima/simo/nonlinearhydrostaticstiffness.py +2 -2
- simapy/sima/simo/simobody.py +22 -35
- simapy/sima/simo/simodynamiccalculationparameters.py +16 -3
- simapy/sima/windpark/multipledeficitmethod.py +4 -1
- simapy/sima/windturbine/blueprints/horizontalaxiswindturbinecontroller.py +3 -2
- simapy/sima/windturbine/horizontalaxiswindturbinecontroller.py +15 -2
- simapy/sre.py +22 -13
- {simapy-4.8.0.dev0.dist-info → simapy-5.0.0.dev0.dist-info}/METADATA +48 -45
- {simapy-4.8.0.dev0.dist-info → simapy-5.0.0.dev0.dist-info}/RECORD +130 -105
- {simapy-4.8.0.dev0.dist-info → simapy-5.0.0.dev0.dist-info}/WHEEL +1 -1
- simapy/sima/simo/blueprints/nonlinearbuoyancycorrection.py +0 -21
- simapy/sima/simo/nonlinearbuoyancycorrection.py +0 -120
- simapy/sima/simo/nonlinearbuoyancycorrectionmethod.py +0 -15
- {simapy-4.8.0.dev0.dist-info → simapy-5.0.0.dev0.dist-info/licenses}/LICENSE +0 -0
- {simapy-4.8.0.dev0.dist-info → simapy-5.0.0.dev0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Progress handler for SRE output.
|
|
3
|
+
|
|
4
|
+
This module provides a tqdm-based progress handler for SRE output.
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
from tqdm import tqdm
|
|
8
|
+
|
|
9
|
+
class ProgressHandler:
|
|
10
|
+
def __init__(self, show_output=True):
|
|
11
|
+
self.progress_bar = None
|
|
12
|
+
self.show_output = show_output
|
|
13
|
+
|
|
14
|
+
def handle_output(self, line: str):
|
|
15
|
+
"""
|
|
16
|
+
Process SRE output to execution progress using tqdm.
|
|
17
|
+
|
|
18
|
+
This handler function monitors the SRE output stream
|
|
19
|
+
and extracts progress information from status messages. When a status message
|
|
20
|
+
is detected, it updates a tqdm progress bar.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
line (str): A line of text output from the SRE process
|
|
24
|
+
|
|
25
|
+
Example:
|
|
26
|
+
When SRE outputs a line like: "@STATUS "Total" 800 1000"
|
|
27
|
+
The function will update the tqdm progress bar to 80%
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
# "@STATUS "Total" 800 1000"
|
|
31
|
+
if line.startswith("@STATUS"):
|
|
32
|
+
# Find the last number
|
|
33
|
+
parts = line.split()
|
|
34
|
+
worked = float(parts[-2]) # Second-to-last value is work completed
|
|
35
|
+
total = float(parts[-1]) # Last value is total work units
|
|
36
|
+
|
|
37
|
+
# Initialize the progress bar if it doesn't exist yet
|
|
38
|
+
if self.progress_bar is None:
|
|
39
|
+
self.progress_bar = tqdm(total=total, desc="Progress", unit="%")
|
|
40
|
+
|
|
41
|
+
# Update the progress bar
|
|
42
|
+
self.progress_bar.update(worked - self.progress_bar.n)
|
|
43
|
+
|
|
44
|
+
# If we've reached the end, close the progress bar
|
|
45
|
+
if worked >= total:
|
|
46
|
+
self.progress_bar.close()
|
|
47
|
+
self.progress_bar = None
|
|
48
|
+
elif self.progress_bar and self.show_output:
|
|
49
|
+
self.progress_bar.write(line)
|
|
50
|
+
elif self.show_output:
|
|
51
|
+
print(line)
|
simapy/sima/command/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class CompoundCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -16,4 +16,4 @@ class CompoundCommandBlueprint(CommandBlueprint):
|
|
|
16
16
|
self.add_attribute(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*")))
|
|
17
17
|
self.add_attribute(Attribute("name","string",""))
|
|
18
18
|
self.add_attribute(BlueprintAttribute("parameters","sima/sima/Property","Additional parameters",True,Dimension("*")))
|
|
19
|
-
self.add_attribute(BlueprintAttribute("commands","sima/
|
|
19
|
+
self.add_attribute(BlueprintAttribute("commands","sima/sima/Command","",True,Dimension("*")))
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class ConditionRunCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -21,4 +21,7 @@ class ConditionRunCommandBlueprint(CommandBlueprint):
|
|
|
21
21
|
self.add_attribute(Attribute("runType","string","Condition run type",optional=False))
|
|
22
22
|
self.add_attribute(Attribute("dir","string","Optional working directory ( may be specified with sima resource urls: sima:// which are relative to the workspace).\nIf the working directory is given outside the workspace SIMA will not delete any of the files before running."))
|
|
23
23
|
self.add_attribute(Attribute("output","string","If set will export all the condition results to the given file"))
|
|
24
|
-
self.add_attribute(BlueprintAttribute("input","sima/sima/Property","Enables override of condition variables. Specify variable name and wanted value",True,Dimension("*")))
|
|
24
|
+
self.add_attribute(BlueprintAttribute("input","sima/sima/Property","Enables override of condition variables. Specify variable name and wanted value",True,Dimension("*")))
|
|
25
|
+
self.add_attribute(Attribute("copy","boolean","Copy selected files to destination folder",default=False))
|
|
26
|
+
self.add_attribute(Attribute("paths","string","Optional list of file names within the condition folder to copy after run",Dimension("*")))
|
|
27
|
+
self.add_attribute(Attribute("destination","string","Destination folder"))
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class ExportBlueprintCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class ExportCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class ExternalCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class GitImportCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class ImportCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -16,4 +16,5 @@ class ImportCommandBlueprint(CommandBlueprint):
|
|
|
16
16
|
self.add_attribute(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*")))
|
|
17
17
|
self.add_attribute(Attribute("name","string",""))
|
|
18
18
|
self.add_attribute(BlueprintAttribute("parameters","sima/sima/Property","Additional parameters",True,Dimension("*")))
|
|
19
|
-
self.add_attribute(Attribute("file","string","Path to file, e.g stask",optional=False))
|
|
19
|
+
self.add_attribute(Attribute("file","string","Path to file, e.g stask",optional=False))
|
|
20
|
+
self.add_attribute(Attribute("configuration","string","Path to configuration file (context specific)",optional=False))
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class InternalCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class PreferenceCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class ScriptRunCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class StorageTaskRootCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class TestRunCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class WorkflowInputCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,7 +5,7 @@ from dmt.dimension import Dimension
|
|
|
5
5
|
from dmt.attribute import Attribute
|
|
6
6
|
from dmt.enum_attribute import EnumAttribute
|
|
7
7
|
from dmt.blueprint_attribute import BlueprintAttribute
|
|
8
|
-
from .command import CommandBlueprint
|
|
8
|
+
from ...sima.blueprints.command import CommandBlueprint
|
|
9
9
|
|
|
10
10
|
class WorkflowRunCommandBlueprint(CommandBlueprint):
|
|
11
11
|
""""""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.compoundcommand import CompoundCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class CompoundCommand(Command):
|
|
13
13
|
"""
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
from typing import Dict,Sequence,List
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.conditionruncommand import ConditionRunCommandBlueprint
|
|
7
|
-
from
|
|
7
|
+
from numpy import ndarray,asarray
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class ConditionRunCommand(Command):
|
|
13
13
|
"""
|
|
@@ -32,9 +32,15 @@ class ConditionRunCommand(Command):
|
|
|
32
32
|
If set will export all the condition results to the given file(default None)
|
|
33
33
|
input : List[Property]
|
|
34
34
|
Enables override of condition variables. Specify variable name and wanted value
|
|
35
|
+
copy : bool
|
|
36
|
+
Copy selected files to destination folder(default False)
|
|
37
|
+
paths : ndarray of str
|
|
38
|
+
Optional list of file names within the condition folder to copy after run
|
|
39
|
+
destination : str
|
|
40
|
+
Destination folder(default None)
|
|
35
41
|
"""
|
|
36
42
|
|
|
37
|
-
def __init__(self , description="", **kwargs):
|
|
43
|
+
def __init__(self , description="", copy=False, **kwargs):
|
|
38
44
|
super().__init__(**kwargs)
|
|
39
45
|
self.description = description
|
|
40
46
|
self.scriptableValues = list()
|
|
@@ -46,6 +52,9 @@ class ConditionRunCommand(Command):
|
|
|
46
52
|
self.dir = None
|
|
47
53
|
self.output = None
|
|
48
54
|
self.input = list()
|
|
55
|
+
self.copy = copy
|
|
56
|
+
self.paths = []
|
|
57
|
+
self.destination = None
|
|
49
58
|
for key, value in kwargs.items():
|
|
50
59
|
if not isinstance(value, Dict):
|
|
51
60
|
setattr(self, key, value)
|
|
@@ -163,3 +172,36 @@ If the working directory is given outside the workspace SIMA will not delete any
|
|
|
163
172
|
if not isinstance(value, Sequence):
|
|
164
173
|
raise ValueError("Expected sequense, but was " , type(value))
|
|
165
174
|
self.__input = value
|
|
175
|
+
|
|
176
|
+
@property
|
|
177
|
+
def copy(self) -> bool:
|
|
178
|
+
"""Copy selected files to destination folder"""
|
|
179
|
+
return self.__copy
|
|
180
|
+
|
|
181
|
+
@copy.setter
|
|
182
|
+
def copy(self, value: bool):
|
|
183
|
+
"""Set copy"""
|
|
184
|
+
self.__copy = bool(value)
|
|
185
|
+
|
|
186
|
+
@property
|
|
187
|
+
def paths(self) -> ndarray:
|
|
188
|
+
"""Optional list of file names within the condition folder to copy after run"""
|
|
189
|
+
return self.__paths
|
|
190
|
+
|
|
191
|
+
@paths.setter
|
|
192
|
+
def paths(self, value: ndarray):
|
|
193
|
+
"""Set paths"""
|
|
194
|
+
array = asarray(value, dtype=str)
|
|
195
|
+
if len(array) > 0 and array.ndim != 1:
|
|
196
|
+
raise ValueError("Expected array with 1 dimensions")
|
|
197
|
+
self.__paths = array
|
|
198
|
+
|
|
199
|
+
@property
|
|
200
|
+
def destination(self) -> str:
|
|
201
|
+
"""Destination folder"""
|
|
202
|
+
return self.__destination
|
|
203
|
+
|
|
204
|
+
@destination.setter
|
|
205
|
+
def destination(self, value: str):
|
|
206
|
+
"""Set destination"""
|
|
207
|
+
self.__destination = value
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.exportblueprintcommand import ExportBlueprintCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class ExportBlueprintCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.exportcommand import ExportCommandBlueprint
|
|
7
7
|
from numpy import ndarray,asarray
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class ExportCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.externalcommand import ExternalCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class ExternalCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.gitimportcommand import GitImportCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class GitImportCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.importcommand import ImportCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class ImportCommand(Command):
|
|
13
13
|
"""
|
|
@@ -22,6 +22,8 @@ class ImportCommand(Command):
|
|
|
22
22
|
Additional parameters
|
|
23
23
|
file : str
|
|
24
24
|
Path to file, e.g stask(default None)
|
|
25
|
+
configuration : str
|
|
26
|
+
Path to configuration file (context specific)(default None)
|
|
25
27
|
"""
|
|
26
28
|
|
|
27
29
|
def __init__(self , description="", **kwargs):
|
|
@@ -31,6 +33,7 @@ class ImportCommand(Command):
|
|
|
31
33
|
self.name = None
|
|
32
34
|
self.parameters = list()
|
|
33
35
|
self.file = None
|
|
36
|
+
self.configuration = None
|
|
34
37
|
for key, value in kwargs.items():
|
|
35
38
|
if not isinstance(value, Dict):
|
|
36
39
|
setattr(self, key, value)
|
|
@@ -95,3 +98,13 @@ class ImportCommand(Command):
|
|
|
95
98
|
def file(self, value: str):
|
|
96
99
|
"""Set file"""
|
|
97
100
|
self.__file = value
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def configuration(self) -> str:
|
|
104
|
+
"""Path to configuration file (context specific)"""
|
|
105
|
+
return self.__configuration
|
|
106
|
+
|
|
107
|
+
@configuration.setter
|
|
108
|
+
def configuration(self, value: str):
|
|
109
|
+
"""Set configuration"""
|
|
110
|
+
self.__configuration = value
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.internalcommand import InternalCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class InternalCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.preferencecommand import PreferenceCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class PreferenceCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.scriptruncommand import ScriptRunCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class ScriptRunCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.storagetaskrootcommand import StorageTaskRootCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class StorageTaskRootCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.testruncommand import TestRunCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class TestRunCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.workflowinputcommand import WorkflowInputCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class WorkflowInputCommand(Command):
|
|
13
13
|
"""
|
|
@@ -5,9 +5,9 @@ from typing import Dict,Sequence,List
|
|
|
5
5
|
from dmt.blueprint import Blueprint
|
|
6
6
|
from .blueprints.workflowruncommand import WorkflowRunCommandBlueprint
|
|
7
7
|
from typing import Dict
|
|
8
|
+
from ..sima import Command
|
|
8
9
|
from ..sima import Property
|
|
9
10
|
from ..sima import ScriptableValue
|
|
10
|
-
from .command import Command
|
|
11
11
|
|
|
12
12
|
class WorkflowRunCommand(Command):
|
|
13
13
|
"""
|
|
@@ -25,6 +25,7 @@ from .piersonmoskowitz import PiersonMoskowitz # noqa
|
|
|
25
25
|
from .piersonmoskowitzissc import PiersonMoskowitzISSC # noqa
|
|
26
26
|
from .piersonmoskowitzzero import PiersonMoskowitzZero # noqa
|
|
27
27
|
from .regularcurrent import RegularCurrent # noqa
|
|
28
|
+
from .regularcurrentfromfile import RegularCurrentFromFile # noqa
|
|
28
29
|
from .regularwave import RegularWave # noqa
|
|
29
30
|
from .regularwaveitem import RegularWaveItem # noqa
|
|
30
31
|
from .seasurface import SeaSurface # noqa
|
|
@@ -20,13 +20,14 @@ class FluctuatingThreeComponentBlueprint(WindBlueprint):
|
|
|
20
20
|
self.add_attribute(Attribute("longitudinalFileName","string","Path and filename for the fluctuating longitudinal wind time series"))
|
|
21
21
|
self.add_attribute(Attribute("lateralFileName","string","Path and filename for the fluctuating lateral wind time series"))
|
|
22
22
|
self.add_attribute(Attribute("verticalFileName","string","Path and filename for the fluctuating vertical wind time series"))
|
|
23
|
-
self.add_attribute(Attribute("lowerLeftX","number","X-coordinate of the lower left
|
|
24
|
-
self.add_attribute(Attribute("lowerLeftY","number","Y-coordinate of the lower left
|
|
25
|
-
self.add_attribute(Attribute("lowerLeftZ","number","Z-coordinate of the lower left
|
|
23
|
+
self.add_attribute(Attribute("lowerLeftX","number","X-coordinate of the upwind lower left data point, in wind aligned coordinates",default=0.0))
|
|
24
|
+
self.add_attribute(Attribute("lowerLeftY","number","Y-coordinate of the upwind lower left data point, in wind aligned coordinates",default=0.0))
|
|
25
|
+
self.add_attribute(Attribute("lowerLeftZ","number","Z-coordinate of the upwind lower left data point, in wind aligned coordinates",default=0.0))
|
|
26
26
|
self.add_attribute(Attribute("numPointsX","integer","Number of grid points in X- (longitudinal) direction",default=0))
|
|
27
27
|
self.add_attribute(Attribute("numPointsY","integer","Number of grid points in Y- (lateral) direction",default=0))
|
|
28
28
|
self.add_attribute(Attribute("numPointsZ","integer","Number of grid points in Z- (vertical) direction",default=0))
|
|
29
29
|
self.add_attribute(Attribute("sizeX","number","Field size in X- (longitudinal) direction",default=0.0))
|
|
30
30
|
self.add_attribute(Attribute("sizeY","number","Field size in Y- (lateral) direction",default=0.0))
|
|
31
31
|
self.add_attribute(Attribute("sizeZ","number","Field size in Z- (vertical) direction",default=0.0))
|
|
32
|
-
self.add_attribute(Attribute("numSlices","integer","Buffer size: Number of wind crossectional planes (Slices) in memory",default=800))
|
|
32
|
+
self.add_attribute(Attribute("numSlices","integer","Buffer size: Number of wind crossectional planes (Slices) in memory",default=800))
|
|
33
|
+
self.add_attribute(Attribute("reverseBox","boolean","Read turbulence box in reverse direction",default=False))
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Generated with RegularCurrentFromFileBlueprint
|
|
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 .current import CurrentBlueprint
|
|
9
|
+
|
|
10
|
+
class RegularCurrentFromFileBlueprint(CurrentBlueprint):
|
|
11
|
+
""""""
|
|
12
|
+
|
|
13
|
+
def __init__(self, name="RegularCurrentFromFile", package_path="sima/environment", 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("fileName","string","Name of external file with specified current data"))
|
|
@@ -19,7 +19,7 @@ class StationaryUniformBlueprint(WindBlueprint):
|
|
|
19
19
|
self.add_attribute(Attribute("verticalVelocity","number","Vertical wind velocity component",default=0.0))
|
|
20
20
|
self.add_attribute(BlueprintAttribute("velocityProfiles","sima/environment/ShearWindVelocityProfile","",True,Dimension("*")))
|
|
21
21
|
self.add_attribute(Attribute("lowerEdgeZ","number","Z coordinate of the lower edge of the wind field domain",default=0.0))
|
|
22
|
-
self.add_attribute(Attribute("domainResolution","number","
|
|
22
|
+
self.add_attribute(Attribute("domainResolution","number","Distance between grid points in the vertical direction",default=0.0))
|
|
23
23
|
self.add_attribute(Attribute("numGridPoints","integer","Number of grid points in Z- (vertical) direction",default=0))
|
|
24
24
|
self.add_attribute(EnumAttribute("shearProfile","sima/environment/ShearProfile",""))
|
|
25
25
|
self.add_attribute(Attribute("referenceHeight","number","Reference height for which the horizontal and vertical wind velocity values are given.",default=0.0))
|
|
@@ -28,11 +28,11 @@ class FluctuatingThreeComponent(Wind):
|
|
|
28
28
|
verticalFileName : str
|
|
29
29
|
Path and filename for the fluctuating vertical wind time series(default None)
|
|
30
30
|
lowerLeftX : float
|
|
31
|
-
X-coordinate of the lower left
|
|
31
|
+
X-coordinate of the upwind lower left data point, in wind aligned coordinates(default 0.0)
|
|
32
32
|
lowerLeftY : float
|
|
33
|
-
Y-coordinate of the lower left
|
|
33
|
+
Y-coordinate of the upwind lower left data point, in wind aligned coordinates(default 0.0)
|
|
34
34
|
lowerLeftZ : float
|
|
35
|
-
Z-coordinate of the lower left
|
|
35
|
+
Z-coordinate of the upwind lower left data point, in wind aligned coordinates(default 0.0)
|
|
36
36
|
numPointsX : int
|
|
37
37
|
Number of grid points in X- (longitudinal) direction(default 0)
|
|
38
38
|
numPointsY : int
|
|
@@ -47,9 +47,11 @@ class FluctuatingThreeComponent(Wind):
|
|
|
47
47
|
Field size in Z- (vertical) direction(default 0.0)
|
|
48
48
|
numSlices : int
|
|
49
49
|
Buffer size: Number of wind crossectional planes (Slices) in memory(default 800)
|
|
50
|
+
reverseBox : bool
|
|
51
|
+
Read turbulence box in reverse direction(default False)
|
|
50
52
|
"""
|
|
51
53
|
|
|
52
|
-
def __init__(self , description="", direction=0.0, meanSpeed=0.0, lowerLeftX=0.0, lowerLeftY=0.0, lowerLeftZ=0.0, numPointsX=0, numPointsY=0, numPointsZ=0, sizeX=0.0, sizeY=0.0, sizeZ=0.0, numSlices=800, **kwargs):
|
|
54
|
+
def __init__(self , description="", direction=0.0, meanSpeed=0.0, lowerLeftX=0.0, lowerLeftY=0.0, lowerLeftZ=0.0, numPointsX=0, numPointsY=0, numPointsZ=0, sizeX=0.0, sizeY=0.0, sizeZ=0.0, numSlices=800, reverseBox=False, **kwargs):
|
|
53
55
|
super().__init__(**kwargs)
|
|
54
56
|
self.description = description
|
|
55
57
|
self.scriptableValues = list()
|
|
@@ -69,6 +71,7 @@ class FluctuatingThreeComponent(Wind):
|
|
|
69
71
|
self.sizeY = sizeY
|
|
70
72
|
self.sizeZ = sizeZ
|
|
71
73
|
self.numSlices = numSlices
|
|
74
|
+
self.reverseBox = reverseBox
|
|
72
75
|
for key, value in kwargs.items():
|
|
73
76
|
if not isinstance(value, Dict):
|
|
74
77
|
setattr(self, key, value)
|
|
@@ -166,7 +169,7 @@ class FluctuatingThreeComponent(Wind):
|
|
|
166
169
|
|
|
167
170
|
@property
|
|
168
171
|
def lowerLeftX(self) -> float:
|
|
169
|
-
"""X-coordinate of the lower left
|
|
172
|
+
"""X-coordinate of the upwind lower left data point, in wind aligned coordinates"""
|
|
170
173
|
return self.__lowerLeftX
|
|
171
174
|
|
|
172
175
|
@lowerLeftX.setter
|
|
@@ -176,7 +179,7 @@ class FluctuatingThreeComponent(Wind):
|
|
|
176
179
|
|
|
177
180
|
@property
|
|
178
181
|
def lowerLeftY(self) -> float:
|
|
179
|
-
"""Y-coordinate of the lower left
|
|
182
|
+
"""Y-coordinate of the upwind lower left data point, in wind aligned coordinates"""
|
|
180
183
|
return self.__lowerLeftY
|
|
181
184
|
|
|
182
185
|
@lowerLeftY.setter
|
|
@@ -186,7 +189,7 @@ class FluctuatingThreeComponent(Wind):
|
|
|
186
189
|
|
|
187
190
|
@property
|
|
188
191
|
def lowerLeftZ(self) -> float:
|
|
189
|
-
"""Z-coordinate of the lower left
|
|
192
|
+
"""Z-coordinate of the upwind lower left data point, in wind aligned coordinates"""
|
|
190
193
|
return self.__lowerLeftZ
|
|
191
194
|
|
|
192
195
|
@lowerLeftZ.setter
|
|
@@ -263,3 +266,13 @@ class FluctuatingThreeComponent(Wind):
|
|
|
263
266
|
def numSlices(self, value: int):
|
|
264
267
|
"""Set numSlices"""
|
|
265
268
|
self.__numSlices = int(value)
|
|
269
|
+
|
|
270
|
+
@property
|
|
271
|
+
def reverseBox(self) -> bool:
|
|
272
|
+
"""Read turbulence box in reverse direction"""
|
|
273
|
+
return self.__reverseBox
|
|
274
|
+
|
|
275
|
+
@reverseBox.setter
|
|
276
|
+
def reverseBox(self, value: bool):
|
|
277
|
+
"""Set reverseBox"""
|
|
278
|
+
self.__reverseBox = bool(value)
|