RATapi 0.0.0.dev1__tar.gz → 0.0.0.dev2__tar.gz
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.
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/PKG-INFO +1 -1
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/controls.py +4 -14
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/absorption/absorption.py +1 -1
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/inputs.py +9 -8
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/project.py +1 -1
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/run.py +50 -8
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/utils/enums.py +22 -9
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi.egg-info/PKG-INFO +1 -1
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi.egg-info/requires.txt +1 -1
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/cpp/rat.cpp +378 -84
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/pyproject.toml +1 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/setup.py +2 -2
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/MANIFEST.in +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/classlist.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/events.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/absorption/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/absorption/volume_thiol_bilayer.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/convert_rascal_project/Model_IIb.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/convert_rascal_project/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/convert_rascal_project/convert_rascal.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/D2O_spin_down.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/D2O_spin_up.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/DSPC_D2O.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/DSPC_SMW.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/H2O_spin_down.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/H2O_spin_up.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/c_PLP0016596.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/c_PLP0016601.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/data/c_PLP0016607.dat +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/domains/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/domains/alloy_domains.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/domains/domains_XY_model.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/domains/domains_custom_XY.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/domains/domains_custom_layers.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/domains/domains_standard_layers.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/languages/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/languages/custom_bilayer.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/languages/run_custom_file_languages.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/languages/setup_problem.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/DSPC_custom_XY.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/DSPC_custom_layers.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/DSPC_standard_layers.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/custom_XY_DSPC.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/custom_bilayer_DSPC.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/models.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/outputs.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/utils/__init__.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/utils/convert.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/utils/custom_errors.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/utils/plotting.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/wrappers.py +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi.egg-info/SOURCES.txt +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi.egg-info/dependency_links.txt +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi.egg-info/not-zip-safe +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi.egg-info/top_level.txt +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/README.md +0 -0
- {RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/setup.cfg +0 -0
|
@@ -6,7 +6,6 @@ from pydantic import (
|
|
|
6
6
|
Field,
|
|
7
7
|
ValidationError,
|
|
8
8
|
ValidatorFunctionWrapHandler,
|
|
9
|
-
field_validator,
|
|
10
9
|
model_serializer,
|
|
11
10
|
model_validator,
|
|
12
11
|
)
|
|
@@ -14,7 +13,7 @@ from pydantic import (
|
|
|
14
13
|
from RATapi.utils.custom_errors import custom_pydantic_validation_error
|
|
15
14
|
from RATapi.utils.enums import BoundHandling, Display, Parallel, Procedures, Strategies
|
|
16
15
|
|
|
17
|
-
common_fields = ["procedure", "parallel", "calcSldDuringFit", "
|
|
16
|
+
common_fields = ["procedure", "parallel", "calcSldDuringFit", "resampleMinAngle", "resampleNPoints", "display"]
|
|
18
17
|
update_fields = ["updateFreq", "updatePlotFreq"]
|
|
19
18
|
fields = {
|
|
20
19
|
"calculate": common_fields,
|
|
@@ -41,7 +40,8 @@ class Controls(BaseModel, validate_assignment=True, extra="forbid"):
|
|
|
41
40
|
procedure: Procedures = Procedures.Calculate
|
|
42
41
|
parallel: Parallel = Parallel.Single
|
|
43
42
|
calcSldDuringFit: bool = False
|
|
44
|
-
|
|
43
|
+
resampleMinAngle: float = Field(0.9, le=1, gt=0)
|
|
44
|
+
resampleNPoints: int = Field(50, gt=0)
|
|
45
45
|
display: Display = Display.Iter
|
|
46
46
|
# Simplex
|
|
47
47
|
xTolerance: float = Field(1.0e-6, gt=0.0)
|
|
@@ -60,7 +60,7 @@ class Controls(BaseModel, validate_assignment=True, extra="forbid"):
|
|
|
60
60
|
numGenerations: int = Field(500, ge=1)
|
|
61
61
|
# NS
|
|
62
62
|
nLive: int = Field(150, ge=1)
|
|
63
|
-
nMCMC:
|
|
63
|
+
nMCMC: int = Field(0, ge=0)
|
|
64
64
|
propScale: float = Field(0.1, gt=0.0, lt=1.0)
|
|
65
65
|
nsTolerance: float = Field(0.1, ge=0.0)
|
|
66
66
|
# Dream
|
|
@@ -117,16 +117,6 @@ class Controls(BaseModel, validate_assignment=True, extra="forbid"):
|
|
|
117
117
|
|
|
118
118
|
return validated_self
|
|
119
119
|
|
|
120
|
-
@field_validator("resampleParams")
|
|
121
|
-
@classmethod
|
|
122
|
-
def check_resample_params(cls, values: list[float]) -> list[float]:
|
|
123
|
-
"""Make sure each of the two values of resampleParams satisfy their conditions."""
|
|
124
|
-
if not 0 < values[0] < 1:
|
|
125
|
-
raise ValueError("resampleParams[0] must be between 0 and 1")
|
|
126
|
-
if values[1] < 0:
|
|
127
|
-
raise ValueError("resampleParams[1] must be greater than or equal to 0")
|
|
128
|
-
return values
|
|
129
|
-
|
|
130
120
|
@model_serializer
|
|
131
121
|
def serialize(self):
|
|
132
122
|
"""Filter fields so only those applying to the chosen procedure are serialized."""
|
|
@@ -150,7 +150,7 @@ def absorption():
|
|
|
150
150
|
)
|
|
151
151
|
|
|
152
152
|
# Now make a controls block and run the code
|
|
153
|
-
controls = RAT.Controls(parallel="contrasts",
|
|
153
|
+
controls = RAT.Controls(parallel="contrasts", resampleNPoints=150)
|
|
154
154
|
problem, results = RAT.run(problem, controls)
|
|
155
155
|
|
|
156
156
|
return problem, results
|
|
@@ -128,7 +128,7 @@ def make_problem(project: RATapi.Project) -> ProblemDefinition:
|
|
|
128
128
|
contrast_background_params = []
|
|
129
129
|
|
|
130
130
|
for contrast in project.contrasts:
|
|
131
|
-
background = project.backgrounds[
|
|
131
|
+
background = project.backgrounds[contrast.background]
|
|
132
132
|
if background.type == TypeOptions.Data:
|
|
133
133
|
contrast_background_params.append(-1)
|
|
134
134
|
else:
|
|
@@ -138,7 +138,7 @@ def make_problem(project: RATapi.Project) -> ProblemDefinition:
|
|
|
138
138
|
contrast_resolution_params = []
|
|
139
139
|
|
|
140
140
|
for contrast in project.contrasts:
|
|
141
|
-
resolution = project.resolutions[
|
|
141
|
+
resolution = project.resolutions[contrast.resolution]
|
|
142
142
|
if resolution.type == TypeOptions.Data:
|
|
143
143
|
contrast_resolution_params.append(-1)
|
|
144
144
|
else:
|
|
@@ -160,7 +160,7 @@ def make_problem(project: RATapi.Project) -> ProblemDefinition:
|
|
|
160
160
|
problem.resolutionParams = [param.value for param in project.resolution_parameters]
|
|
161
161
|
problem.contrastBulkIns = [project.bulk_in.index(contrast.bulk_in, True) for contrast in project.contrasts]
|
|
162
162
|
problem.contrastBulkOuts = [project.bulk_out.index(contrast.bulk_out, True) for contrast in project.contrasts]
|
|
163
|
-
problem.contrastQzshifts = [
|
|
163
|
+
problem.contrastQzshifts = [1] * len(project.contrasts) # This is marked as "to do" in RAT
|
|
164
164
|
problem.contrastScalefactors = [
|
|
165
165
|
project.scalefactors.index(contrast.scalefactor, True) for contrast in project.contrasts
|
|
166
166
|
]
|
|
@@ -239,9 +239,7 @@ def make_data_present(project: RATapi.Project) -> list[int]:
|
|
|
239
239
|
The "dataPresent" field of the problem input used in the compiled RAT code.
|
|
240
240
|
|
|
241
241
|
"""
|
|
242
|
-
return [
|
|
243
|
-
1 if project.data[project.data.index(contrast.data)].data.size != 0 else 0 for contrast in project.contrasts
|
|
244
|
-
]
|
|
242
|
+
return [1 if project.data[contrast.data].data.size != 0 else 0 for contrast in project.contrasts]
|
|
245
243
|
|
|
246
244
|
|
|
247
245
|
def check_indices(problem: ProblemDefinition) -> None:
|
|
@@ -438,7 +436,8 @@ def make_controls(input_controls: RATapi.Controls, checks: Checks) -> Control:
|
|
|
438
436
|
controls.procedure = input_controls.procedure
|
|
439
437
|
controls.parallel = input_controls.parallel
|
|
440
438
|
controls.calcSldDuringFit = input_controls.calcSldDuringFit
|
|
441
|
-
controls.
|
|
439
|
+
controls.resampleMinAngle = input_controls.resampleMinAngle
|
|
440
|
+
controls.resampleNPoints = input_controls.resampleNPoints
|
|
442
441
|
controls.display = input_controls.display
|
|
443
442
|
# Simplex
|
|
444
443
|
controls.xTolerance = input_controls.xTolerance
|
|
@@ -451,7 +450,7 @@ def make_controls(input_controls: RATapi.Controls, checks: Checks) -> Control:
|
|
|
451
450
|
controls.populationSize = input_controls.populationSize
|
|
452
451
|
controls.fWeight = input_controls.fWeight
|
|
453
452
|
controls.crossoverProbability = input_controls.crossoverProbability
|
|
454
|
-
controls.strategy = input_controls.strategy
|
|
453
|
+
controls.strategy = int(input_controls.strategy) # RAT core expects strategy as an integer
|
|
455
454
|
controls.targetValue = input_controls.targetValue
|
|
456
455
|
controls.numGenerations = input_controls.numGenerations
|
|
457
456
|
# NS
|
|
@@ -468,5 +467,7 @@ def make_controls(input_controls: RATapi.Controls, checks: Checks) -> Control:
|
|
|
468
467
|
controls.adaptPCR = input_controls.adaptPCR
|
|
469
468
|
# Checks
|
|
470
469
|
controls.checks = checks
|
|
470
|
+
# IPC
|
|
471
|
+
controls.IPCFilePath = ""
|
|
471
472
|
|
|
472
473
|
return controls
|
|
@@ -285,7 +285,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid", arbitrary_typ
|
|
|
285
285
|
)
|
|
286
286
|
elif "Substrate Roughness" not in [name.title() for name in self.get_all_protected_parameters()["parameters"]]:
|
|
287
287
|
# If substrate roughness is included as a standard parameter replace it with a protected parameter
|
|
288
|
-
substrate_roughness_values = self.parameters[
|
|
288
|
+
substrate_roughness_values = self.parameters["Substrate Roughness"].model_dump()
|
|
289
289
|
self.parameters.remove("Substrate Roughness")
|
|
290
290
|
self.parameters.insert(0, RATapi.models.ProtectedParameter(**substrate_roughness_values))
|
|
291
291
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import time
|
|
2
2
|
|
|
3
|
-
from tqdm import tqdm
|
|
3
|
+
from tqdm.auto import tqdm
|
|
4
4
|
|
|
5
5
|
import RATapi.rat_core
|
|
6
6
|
from RATapi.inputs import make_input
|
|
@@ -16,18 +16,23 @@ class ProgressBar:
|
|
|
16
16
|
----------
|
|
17
17
|
display : bool, default: True
|
|
18
18
|
Indicates if displaying is allowed
|
|
19
|
-
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
21
|
def __init__(self, display=True):
|
|
22
|
+
self.pbar = None
|
|
23
23
|
self.display = display
|
|
24
|
+
self.tqdm_kwargs = {"total": 100, "desc": "", "bar_format": "{l_bar}{bar}", "disable": not self.display}
|
|
25
|
+
# Determine if the auto tqdm is standard or notebook
|
|
26
|
+
from tqdm.asyncio import tqdm as asyncio_tqdm
|
|
27
|
+
|
|
28
|
+
if tqdm == asyncio_tqdm:
|
|
29
|
+
self.tqdm_kwargs.update({"ncols": 90})
|
|
24
30
|
|
|
25
31
|
def __enter__(self):
|
|
26
32
|
if self.display:
|
|
27
33
|
RATapi.events.register(RATapi.events.EventTypes.Progress, self.updateProgress)
|
|
28
|
-
|
|
29
|
-
self
|
|
30
|
-
return self.pbar
|
|
34
|
+
|
|
35
|
+
return self
|
|
31
36
|
|
|
32
37
|
def updateProgress(self, event):
|
|
33
38
|
"""Callback for the progress event.
|
|
@@ -37,17 +42,54 @@ class ProgressBar:
|
|
|
37
42
|
event: ProgressEventData
|
|
38
43
|
The progress event data.
|
|
39
44
|
"""
|
|
40
|
-
|
|
45
|
+
if self.pbar is None:
|
|
46
|
+
self.pbar = tqdm(**self.tqdm_kwargs)
|
|
41
47
|
value = event.percent * 100
|
|
42
48
|
self.pbar.desc = event.message
|
|
43
49
|
self.pbar.update(value - self.pbar.n)
|
|
44
50
|
|
|
45
51
|
def __exit__(self, _exc_type, _exc_val, _traceback):
|
|
46
|
-
self.pbar
|
|
52
|
+
if self.pbar is not None:
|
|
53
|
+
self.pbar.close()
|
|
54
|
+
print("") # Print new line after bar
|
|
55
|
+
|
|
47
56
|
if self.display:
|
|
48
57
|
RATapi.events.clear(RATapi.events.EventTypes.Progress, self.updateProgress)
|
|
49
58
|
|
|
50
59
|
|
|
60
|
+
class TextOutput:
|
|
61
|
+
"""Pipes the message event to stdout
|
|
62
|
+
|
|
63
|
+
Parameters
|
|
64
|
+
----------
|
|
65
|
+
display : bool, default: True
|
|
66
|
+
Indicates if displaying is allowed
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
def __init__(self, display=True):
|
|
70
|
+
self.display = display
|
|
71
|
+
|
|
72
|
+
def __enter__(self):
|
|
73
|
+
if self.display:
|
|
74
|
+
RATapi.events.register(RATapi.events.EventTypes.Message, self.printMessage)
|
|
75
|
+
|
|
76
|
+
return self
|
|
77
|
+
|
|
78
|
+
def printMessage(self, msg):
|
|
79
|
+
"""Callback for the message event.
|
|
80
|
+
|
|
81
|
+
Parameters
|
|
82
|
+
----------
|
|
83
|
+
msg: str
|
|
84
|
+
The event message.
|
|
85
|
+
"""
|
|
86
|
+
print(msg, end="")
|
|
87
|
+
|
|
88
|
+
def __exit__(self, _exc_type, _exc_val, _traceback):
|
|
89
|
+
if self.display:
|
|
90
|
+
RATapi.events.clear(RATapi.events.EventTypes.Message, self.printMessage)
|
|
91
|
+
|
|
92
|
+
|
|
51
93
|
def run(project, controls):
|
|
52
94
|
"""Run RAT for the given project and controls inputs."""
|
|
53
95
|
parameter_field = {
|
|
@@ -68,7 +110,7 @@ def run(project, controls):
|
|
|
68
110
|
print("Starting RAT " + horizontal_line)
|
|
69
111
|
|
|
70
112
|
start = time.time()
|
|
71
|
-
with ProgressBar(display=display_on):
|
|
113
|
+
with ProgressBar(display=display_on), TextOutput(display=display_on):
|
|
72
114
|
problem_definition, output_results, bayes_results = RATapi.rat_core.RATMain(
|
|
73
115
|
problem_definition,
|
|
74
116
|
cells,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Union
|
|
2
2
|
|
|
3
3
|
try:
|
|
4
4
|
from enum import StrEnum
|
|
@@ -48,15 +48,28 @@ class Display(RATEnum):
|
|
|
48
48
|
Final = "final"
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
class Strategies(
|
|
52
|
-
"""Defines the available options for strategies"""
|
|
51
|
+
class Strategies(RATEnum):
|
|
52
|
+
"""Defines the available options for differential evolution strategies"""
|
|
53
53
|
|
|
54
|
-
Random =
|
|
55
|
-
LocalToBest =
|
|
56
|
-
BestWithJitter =
|
|
57
|
-
RandomWithPerVectorDither =
|
|
58
|
-
RandomWithPerGenerationDither =
|
|
59
|
-
RandomEitherOrAlgorithm =
|
|
54
|
+
Random = "random"
|
|
55
|
+
LocalToBest = "local to best"
|
|
56
|
+
BestWithJitter = "best jitter"
|
|
57
|
+
RandomWithPerVectorDither = "vector dither"
|
|
58
|
+
RandomWithPerGenerationDither = "generation dither"
|
|
59
|
+
RandomEitherOrAlgorithm = "either or"
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def _missing_(cls, value: Union[int, str]):
|
|
63
|
+
# legacy compatibility with strategies being 1-indexed ints under the hood
|
|
64
|
+
if isinstance(value, int):
|
|
65
|
+
if value < 1 or value > 6:
|
|
66
|
+
raise IndexError("Strategy indices must be between 1 and 6.")
|
|
67
|
+
return list(cls)[value - 1]
|
|
68
|
+
return super()._missing_(value)
|
|
69
|
+
|
|
70
|
+
def __int__(self):
|
|
71
|
+
# as RAT core expects strategy as an integer
|
|
72
|
+
return list(Strategies).index(self) + 1
|
|
60
73
|
|
|
61
74
|
|
|
62
75
|
class BoundHandling(RATEnum):
|
|
@@ -509,7 +509,8 @@ struct Control {
|
|
|
509
509
|
real_T propScale {};
|
|
510
510
|
real_T nsTolerance {};
|
|
511
511
|
boolean_T calcSldDuringFit {};
|
|
512
|
-
|
|
512
|
+
real_T resampleMinAngle {};
|
|
513
|
+
real_T resampleNPoints {};
|
|
513
514
|
real_T updateFreq {};
|
|
514
515
|
real_T updatePlotFreq {};
|
|
515
516
|
real_T nSamples {};
|
|
@@ -519,6 +520,7 @@ struct Control {
|
|
|
519
520
|
std::string boundHandling {};
|
|
520
521
|
boolean_T adaptPCR;
|
|
521
522
|
Checks checks {};
|
|
523
|
+
std::string IPCFilePath {};
|
|
522
524
|
};
|
|
523
525
|
|
|
524
526
|
|
|
@@ -541,7 +543,27 @@ void stringToRatCharArray(std::string value, coder::array<char_T, 2U>& result)
|
|
|
541
543
|
}
|
|
542
544
|
}
|
|
543
545
|
|
|
544
|
-
coder::array<real_T,
|
|
546
|
+
coder::array<real_T, 1U> pyArrayToRatRowArray1d(py::array_t<real_T> value)
|
|
547
|
+
{
|
|
548
|
+
coder::array<real_T, 1U> result;
|
|
549
|
+
|
|
550
|
+
py::buffer_info buffer_info = value.request();
|
|
551
|
+
|
|
552
|
+
if (buffer_info.size == 0)
|
|
553
|
+
return result;
|
|
554
|
+
|
|
555
|
+
if (buffer_info.ndim != 1)
|
|
556
|
+
throw std::runtime_error("Expects a 1D numeric array");
|
|
557
|
+
|
|
558
|
+
result.set_size(buffer_info.shape[0]);
|
|
559
|
+
for (int32_T idx0{0}; idx0 < buffer_info.shape[0]; idx0++) {
|
|
560
|
+
result[idx0] = value.at(idx0);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return result;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
coder::array<real_T, 2U> pyArrayToRatColArray1d(py::array_t<real_T> value)
|
|
545
567
|
{
|
|
546
568
|
coder::array<real_T, 2U> result;
|
|
547
569
|
|
|
@@ -619,8 +641,9 @@ coder::array<RAT::cell_0, 1U> pyListToUnboundedCell0(py::list values)
|
|
|
619
641
|
!py::isinstance<py::float_>(value[2]) || !py::isinstance<py::float_>(value[3]))
|
|
620
642
|
throw std::runtime_error("Expects a 2D list where each row must contain 4 elements. "
|
|
621
643
|
"Columns 1 and 2 must be strings and Columns 3 and 4 must be numeric arrays");
|
|
622
|
-
|
|
623
|
-
|
|
644
|
+
|
|
645
|
+
stringToRatArray(value[0].cast<std::string>(), result[idx].f1.data, result[idx].f1.size);
|
|
646
|
+
stringToRatArray(value[1].cast<std::string>(), result[idx].f2.data, result[idx].f2.size);
|
|
624
647
|
result[idx].f3 = value[2].cast<real_T>();
|
|
625
648
|
result[idx].f4 = value[3].cast<real_T>();
|
|
626
649
|
idx++;
|
|
@@ -662,30 +685,30 @@ RAT::struct0_T createStruct0(const ProblemDefinition& problem)
|
|
|
662
685
|
stringToRatArray(problem.geometry, problem_struct.geometry.data, problem_struct.geometry.size);
|
|
663
686
|
stringToRatArray(problem.TF, problem_struct.TF.data, problem_struct.TF.size);
|
|
664
687
|
|
|
665
|
-
problem_struct.contrastBackgroundParams = customCaller("Problem.contrastBackgroundParams",
|
|
666
|
-
problem_struct.contrastBackgroundActions = customCaller("Problem.contrastBackgroundActions",
|
|
667
|
-
problem_struct.resample = customCaller("Problem.resample",
|
|
668
|
-
problem_struct.dataPresent = customCaller("Problem.dataPresent",
|
|
669
|
-
problem_struct.oilChiDataPresent = customCaller("Problem.oilChiDataPresent",
|
|
670
|
-
problem_struct.contrastQzshifts = customCaller("Problem.contrastQzshifts",
|
|
671
|
-
problem_struct.contrastScalefactors = customCaller("Problem.contrastScalefactors",
|
|
672
|
-
problem_struct.contrastBulkIns = customCaller("Problem.contrastBulkIns",
|
|
673
|
-
problem_struct.contrastBulkOuts = customCaller("Problem.contrastBulkOuts",
|
|
674
|
-
problem_struct.contrastResolutionParams = customCaller("Problem.contrastResolutionParams",
|
|
675
|
-
problem_struct.backgroundParams = customCaller("Problem.backgroundParams",
|
|
676
|
-
problem_struct.qzshifts = customCaller("Problem.qzshifts",
|
|
677
|
-
problem_struct.scalefactors = customCaller("Problem.scalefactors",
|
|
678
|
-
problem_struct.bulkIn = customCaller("Problem.bulkIn",
|
|
679
|
-
problem_struct.bulkOut = customCaller("Problem.bulkOut",
|
|
680
|
-
problem_struct.resolutionParams = customCaller("Problem.resolutionParams",
|
|
681
|
-
problem_struct.params = customCaller("Problem.params",
|
|
682
|
-
|
|
683
|
-
problem_struct.contrastCustomFiles = customCaller("Problem.contrastCustomFiles",
|
|
684
|
-
problem_struct.contrastDomainRatios = customCaller("Problem.contrastDomainRatios",
|
|
685
|
-
problem_struct.domainRatio = customCaller("Problem.domainRatio",
|
|
686
|
-
|
|
687
|
-
problem_struct.fitParams = customCaller("Problem.fitParams",
|
|
688
|
-
problem_struct.otherParams = customCaller("Problem.otherParams",
|
|
688
|
+
problem_struct.contrastBackgroundParams = customCaller("Problem.contrastBackgroundParams", pyArrayToRatColArray1d, problem.contrastBackgroundParams);
|
|
689
|
+
problem_struct.contrastBackgroundActions = customCaller("Problem.contrastBackgroundActions", pyArrayToRatColArray1d, problem.contrastBackgroundActions);
|
|
690
|
+
problem_struct.resample = customCaller("Problem.resample", pyArrayToRatColArray1d, problem.resample);
|
|
691
|
+
problem_struct.dataPresent = customCaller("Problem.dataPresent", pyArrayToRatColArray1d, problem.dataPresent);
|
|
692
|
+
problem_struct.oilChiDataPresent = customCaller("Problem.oilChiDataPresent", pyArrayToRatColArray1d, problem.oilChiDataPresent);
|
|
693
|
+
problem_struct.contrastQzshifts = customCaller("Problem.contrastQzshifts", pyArrayToRatColArray1d, problem.contrastQzshifts);
|
|
694
|
+
problem_struct.contrastScalefactors = customCaller("Problem.contrastScalefactors", pyArrayToRatColArray1d, problem.contrastScalefactors);
|
|
695
|
+
problem_struct.contrastBulkIns = customCaller("Problem.contrastBulkIns", pyArrayToRatColArray1d, problem.contrastBulkIns);
|
|
696
|
+
problem_struct.contrastBulkOuts = customCaller("Problem.contrastBulkOuts", pyArrayToRatColArray1d, problem.contrastBulkOuts);
|
|
697
|
+
problem_struct.contrastResolutionParams = customCaller("Problem.contrastResolutionParams", pyArrayToRatColArray1d, problem.contrastResolutionParams);
|
|
698
|
+
problem_struct.backgroundParams = customCaller("Problem.backgroundParams", pyArrayToRatColArray1d, problem.backgroundParams);
|
|
699
|
+
problem_struct.qzshifts = customCaller("Problem.qzshifts", pyArrayToRatColArray1d, problem.qzshifts);
|
|
700
|
+
problem_struct.scalefactors = customCaller("Problem.scalefactors", pyArrayToRatColArray1d, problem.scalefactors);
|
|
701
|
+
problem_struct.bulkIn = customCaller("Problem.bulkIn", pyArrayToRatColArray1d, problem.bulkIn);
|
|
702
|
+
problem_struct.bulkOut = customCaller("Problem.bulkOut", pyArrayToRatColArray1d, problem.bulkOut);
|
|
703
|
+
problem_struct.resolutionParams = customCaller("Problem.resolutionParams", pyArrayToRatColArray1d, problem.resolutionParams);
|
|
704
|
+
problem_struct.params = customCaller("Problem.params", pyArrayToRatColArray1d, problem.params);
|
|
705
|
+
|
|
706
|
+
problem_struct.contrastCustomFiles = customCaller("Problem.contrastCustomFiles", pyArrayToRatColArray1d, problem.contrastCustomFiles);
|
|
707
|
+
problem_struct.contrastDomainRatios = customCaller("Problem.contrastDomainRatios", pyArrayToRatColArray1d, problem.contrastDomainRatios);
|
|
708
|
+
problem_struct.domainRatio = customCaller("Problem.domainRatio", pyArrayToRatColArray1d, problem.domainRatio);
|
|
709
|
+
|
|
710
|
+
problem_struct.fitParams = customCaller("Problem.fitParams", pyArrayToRatRowArray1d, problem.fitParams);
|
|
711
|
+
problem_struct.otherParams = customCaller("Problem.otherParams", pyArrayToRatRowArray1d, problem.otherParams);
|
|
689
712
|
problem_struct.fitLimits = customCaller("Problem.fitLimits", pyArrayToRatArray2d, problem.fitLimits);
|
|
690
713
|
problem_struct.otherLimits = customCaller("Problem.otherLimits", pyArrayToRatArray2d, problem.otherLimits);
|
|
691
714
|
|
|
@@ -710,14 +733,14 @@ RAT::struct1_T createStruct1(const Limits& limits)
|
|
|
710
733
|
RAT::struct3_T createStruct3(const Checks& checks)
|
|
711
734
|
{
|
|
712
735
|
RAT::struct3_T checks_struct;
|
|
713
|
-
checks_struct.fitParam = customCaller("Checks.fitParam",
|
|
714
|
-
checks_struct.fitBackgroundParam = customCaller("Checks.fitBackgroundParam",
|
|
715
|
-
checks_struct.fitQzshift = customCaller("Checks.fitQzshift",
|
|
716
|
-
checks_struct.fitScalefactor = customCaller("Checks.fitScalefactor",
|
|
717
|
-
checks_struct.fitBulkIn = customCaller("Checks.fitBulkIn",
|
|
718
|
-
checks_struct.fitBulkOut = customCaller("Checks.fitBulkOut",
|
|
719
|
-
checks_struct.fitResolutionParam = customCaller("Checks.fitResolutionParam",
|
|
720
|
-
checks_struct.fitDomainRatio = customCaller("Checks.fitDomainRatio",
|
|
736
|
+
checks_struct.fitParam = customCaller("Checks.fitParam", pyArrayToRatColArray1d, checks.fitParam);
|
|
737
|
+
checks_struct.fitBackgroundParam = customCaller("Checks.fitBackgroundParam", pyArrayToRatColArray1d, checks.fitBackgroundParam);
|
|
738
|
+
checks_struct.fitQzshift = customCaller("Checks.fitQzshift", pyArrayToRatColArray1d, checks.fitQzshift);
|
|
739
|
+
checks_struct.fitScalefactor = customCaller("Checks.fitScalefactor", pyArrayToRatColArray1d, checks.fitScalefactor);
|
|
740
|
+
checks_struct.fitBulkIn = customCaller("Checks.fitBulkIn", pyArrayToRatColArray1d, checks.fitBulkIn);
|
|
741
|
+
checks_struct.fitBulkOut = customCaller("Checks.fitBulkOut", pyArrayToRatColArray1d, checks.fitBulkOut);
|
|
742
|
+
checks_struct.fitResolutionParam = customCaller("Checks.fitResolutionParam", pyArrayToRatColArray1d, checks.fitResolutionParam);
|
|
743
|
+
checks_struct.fitDomainRatio = customCaller("Checks.fitDomainRatio", pyArrayToRatColArray1d, checks.fitDomainRatio);
|
|
721
744
|
|
|
722
745
|
return checks_struct;
|
|
723
746
|
}
|
|
@@ -780,7 +803,7 @@ coder::array<RAT::cell_wrap_4, 2U> pyListToRatCellWrap4(py::list values)
|
|
|
780
803
|
for (py::handle array: values)
|
|
781
804
|
{
|
|
782
805
|
py::array_t<real_T> casted_array = py::cast<py::array>(array);
|
|
783
|
-
result[idx].f1 = customCaller("$id[" + std::to_string(idx) +"]",
|
|
806
|
+
result[idx].f1 = customCaller("$id[" + std::to_string(idx) +"]", pyArrayToRatColArray1d, casted_array);
|
|
784
807
|
idx++;
|
|
785
808
|
}
|
|
786
809
|
|
|
@@ -892,18 +915,21 @@ RAT::struct2_T createStruct2T(const Control& control)
|
|
|
892
915
|
stringToRatArray(control.procedure, control_struct.procedure.data, control_struct.procedure.size);
|
|
893
916
|
stringToRatArray(control.display, control_struct.display.data, control_struct.display.size);
|
|
894
917
|
control_struct.xTolerance = control.xTolerance;
|
|
895
|
-
control_struct.
|
|
896
|
-
control_struct.
|
|
918
|
+
control_struct.resampleMinAngle = control.resampleMinAngle;
|
|
919
|
+
control_struct.resampleNPoints = control.resampleNPoints;
|
|
897
920
|
stringToRatArray(control.boundHandling, control_struct.boundHandling.data, control_struct.boundHandling.size);
|
|
898
921
|
control_struct.adaptPCR = control.adaptPCR;
|
|
899
922
|
control_struct.checks = createStruct3(control.checks);
|
|
923
|
+
stringToRatArray(control.IPCFilePath, control_struct.IPCFilePath.data, control_struct.IPCFilePath.size);
|
|
900
924
|
|
|
901
925
|
return control_struct;
|
|
902
926
|
}
|
|
903
927
|
|
|
904
|
-
|
|
928
|
+
|
|
929
|
+
template <typename T>
|
|
930
|
+
py::array_t<real_T> pyArrayFromRatArray1d(T array, bool isCol=true)
|
|
905
931
|
{
|
|
906
|
-
auto size =
|
|
932
|
+
auto size = isCol ? array.size(1) : array.size(0);
|
|
907
933
|
auto result_array = py::array_t<real_T>(size);
|
|
908
934
|
std::memcpy(result_array.request().ptr, array.data(), result_array.nbytes());
|
|
909
935
|
|
|
@@ -1040,37 +1066,38 @@ ProblemDefinition problemDefinitionFromStruct0T(const RAT::struct0_T problem)
|
|
|
1040
1066
|
problem_def.TF.resize(problem.TF.size[1]);
|
|
1041
1067
|
memcpy(&problem_def.TF[0], problem.TF.data, problem.TF.size[1]);
|
|
1042
1068
|
|
|
1043
|
-
problem_def.contrastBackgroundParams = pyArrayFromRatArray1d(problem.contrastBackgroundParams);
|
|
1044
|
-
problem_def.contrastBackgroundActions = pyArrayFromRatArray1d(problem.contrastBackgroundActions);
|
|
1045
|
-
problem_def.resample = pyArrayFromRatArray1d(problem.resample);
|
|
1046
|
-
problem_def.dataPresent = pyArrayFromRatArray1d(problem.dataPresent);
|
|
1047
|
-
problem_def.oilChiDataPresent = pyArrayFromRatArray1d(problem.oilChiDataPresent);
|
|
1048
|
-
problem_def.contrastQzshifts = pyArrayFromRatArray1d(problem.contrastQzshifts);
|
|
1049
|
-
problem_def.contrastScalefactors = pyArrayFromRatArray1d(problem.contrastScalefactors);
|
|
1050
|
-
problem_def.contrastBulkIns = pyArrayFromRatArray1d(problem.contrastBulkIns);
|
|
1051
|
-
problem_def.contrastBulkOuts = pyArrayFromRatArray1d(problem.contrastBulkOuts);
|
|
1052
|
-
problem_def.contrastResolutionParams = pyArrayFromRatArray1d(problem.contrastResolutionParams);
|
|
1053
|
-
problem_def.backgroundParams = pyArrayFromRatArray1d(problem.backgroundParams);
|
|
1054
|
-
problem_def.qzshifts = pyArrayFromRatArray1d(problem.qzshifts);
|
|
1055
|
-
problem_def.scalefactors = pyArrayFromRatArray1d(problem.scalefactors);
|
|
1056
|
-
problem_def.bulkIn = pyArrayFromRatArray1d(problem.bulkIn);
|
|
1057
|
-
problem_def.bulkOut = pyArrayFromRatArray1d(problem.bulkOut);
|
|
1058
|
-
problem_def.resolutionParams = pyArrayFromRatArray1d(problem.resolutionParams);
|
|
1059
|
-
problem_def.params = pyArrayFromRatArray1d(problem.params);
|
|
1060
|
-
|
|
1061
|
-
problem_def.contrastCustomFiles = pyArrayFromRatArray1d(problem.contrastCustomFiles);
|
|
1062
|
-
problem_def.contrastDomainRatios = pyArrayFromRatArray1d(problem.contrastDomainRatios);
|
|
1063
|
-
problem_def.domainRatio = pyArrayFromRatArray1d(problem.domainRatio);
|
|
1064
|
-
|
|
1065
|
-
problem_def.fitParams =
|
|
1066
|
-
problem_def.otherParams =
|
|
1067
|
-
problem_def.fitLimits =
|
|
1068
|
-
problem_def.otherLimits =
|
|
1069
|
+
problem_def.contrastBackgroundParams = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastBackgroundParams);
|
|
1070
|
+
problem_def.contrastBackgroundActions = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastBackgroundActions);
|
|
1071
|
+
problem_def.resample = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.resample);
|
|
1072
|
+
problem_def.dataPresent = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.dataPresent);
|
|
1073
|
+
problem_def.oilChiDataPresent = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.oilChiDataPresent);
|
|
1074
|
+
problem_def.contrastQzshifts = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastQzshifts);
|
|
1075
|
+
problem_def.contrastScalefactors = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastScalefactors);
|
|
1076
|
+
problem_def.contrastBulkIns = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastBulkIns);
|
|
1077
|
+
problem_def.contrastBulkOuts = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastBulkOuts);
|
|
1078
|
+
problem_def.contrastResolutionParams = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastResolutionParams);
|
|
1079
|
+
problem_def.backgroundParams = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.backgroundParams);
|
|
1080
|
+
problem_def.qzshifts = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.qzshifts);
|
|
1081
|
+
problem_def.scalefactors = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.scalefactors);
|
|
1082
|
+
problem_def.bulkIn = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.bulkIn);
|
|
1083
|
+
problem_def.bulkOut = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.bulkOut);
|
|
1084
|
+
problem_def.resolutionParams = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.resolutionParams);
|
|
1085
|
+
problem_def.params = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.params);
|
|
1086
|
+
|
|
1087
|
+
problem_def.contrastCustomFiles = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastCustomFiles);
|
|
1088
|
+
problem_def.contrastDomainRatios = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.contrastDomainRatios);
|
|
1089
|
+
problem_def.domainRatio = pyArrayFromRatArray1d<coder::array<real_T, 2U>>(problem.domainRatio);
|
|
1090
|
+
|
|
1091
|
+
problem_def.fitParams = pyArrayFromRatArray1d<coder::array<real_T, 1U>>(problem.fitParams, false);
|
|
1092
|
+
problem_def.otherParams = pyArrayFromRatArray1d<coder::array<real_T, 1U>>(problem.otherParams, false);
|
|
1093
|
+
problem_def.fitLimits = pyArrayFromRatArray2d(problem.fitLimits);
|
|
1094
|
+
problem_def.otherLimits = pyArrayFromRatArray2d(problem.otherLimits);
|
|
1069
1095
|
|
|
1070
1096
|
return problem_def;
|
|
1071
1097
|
}
|
|
1072
1098
|
|
|
1073
|
-
|
|
1099
|
+
template <typename T>
|
|
1100
|
+
py::list pyList1DFromRatCellWrap(const T& values)
|
|
1074
1101
|
{
|
|
1075
1102
|
py::list result;
|
|
1076
1103
|
|
|
@@ -1081,7 +1108,8 @@ py::list pyList1DFromRatCellWrap(const coder::array<RAT::cell_wrap_10, 1U>& valu
|
|
|
1081
1108
|
return result;
|
|
1082
1109
|
}
|
|
1083
1110
|
|
|
1084
|
-
|
|
1111
|
+
template <typename T>
|
|
1112
|
+
py::list pyList2dFromRatCellWrap(const T& values)
|
|
1085
1113
|
{
|
|
1086
1114
|
py::list result;
|
|
1087
1115
|
int32_T idx {0};
|
|
@@ -1129,10 +1157,10 @@ BayesResults bayesResultsFromStruct8T(const RAT::struct8_T results)
|
|
|
1129
1157
|
|
|
1130
1158
|
bayesResults.chain = pyArrayFromRatArray2d(results.chain);
|
|
1131
1159
|
|
|
1132
|
-
bayesResults.predictionIntervals.reflectivity = pyList1DFromRatCellWrap(results.predictionIntervals.reflectivity);
|
|
1133
|
-
bayesResults.predictionIntervals.sld = pyList2dFromRatCellWrap(results.predictionIntervals.sld);
|
|
1134
|
-
bayesResults.predictionIntervals.reflectivityXData = pyList1DFromRatCellWrap(results.predictionIntervals.reflectivityXData);
|
|
1135
|
-
bayesResults.predictionIntervals.sldXData = pyList2dFromRatCellWrap(results.predictionIntervals.sldXData);
|
|
1160
|
+
bayesResults.predictionIntervals.reflectivity = pyList1DFromRatCellWrap<coder::array<RAT::cell_wrap_11, 1U>>(results.predictionIntervals.reflectivity);
|
|
1161
|
+
bayesResults.predictionIntervals.sld = pyList2dFromRatCellWrap<coder::array<RAT::cell_wrap_11, 2U>>(results.predictionIntervals.sld);
|
|
1162
|
+
bayesResults.predictionIntervals.reflectivityXData = pyList1DFromRatCellWrap<coder::array<RAT::cell_wrap_12, 1U>>(results.predictionIntervals.reflectivityXData);
|
|
1163
|
+
bayesResults.predictionIntervals.sldXData = pyList2dFromRatCellWrap<coder::array<RAT::cell_wrap_12, 2U>>(results.predictionIntervals.sldXData);
|
|
1136
1164
|
bayesResults.predictionIntervals.sampleChi = pyArray1dFromBoundedArray<coder::bounded_array<real_T, 1000U, 1U>>(results.predictionIntervals.sampleChi);
|
|
1137
1165
|
|
|
1138
1166
|
bayesResults.confidenceIntervals.percentile95 = pyArrayFromRatArray2d(results.confidenceIntervals.percentile95);
|
|
@@ -1268,12 +1296,54 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1268
1296
|
.def_readwrite("resample", &PlotEventData::resample)
|
|
1269
1297
|
.def_readwrite("dataPresent", &PlotEventData::dataPresent)
|
|
1270
1298
|
.def_readwrite("modelType", &PlotEventData::modelType)
|
|
1271
|
-
.def_readwrite("contrastNames", &PlotEventData::contrastNames)
|
|
1299
|
+
.def_readwrite("contrastNames", &PlotEventData::contrastNames)
|
|
1300
|
+
.def(py::pickle(
|
|
1301
|
+
[](const PlotEventData &evt) { // __getstate__
|
|
1302
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1303
|
+
return py::make_tuple(evt.reflectivity, evt.shiftedData, evt.sldProfiles, evt.resampledLayers, evt.subRoughs, evt.resample,
|
|
1304
|
+
evt.dataPresent, evt.modelType, evt.contrastNames);
|
|
1305
|
+
},
|
|
1306
|
+
[](py::tuple t) { // __setstate__
|
|
1307
|
+
if (t.size() != 9)
|
|
1308
|
+
throw std::runtime_error("Encountered invalid state unpickling PlotEventData object!");
|
|
1309
|
+
|
|
1310
|
+
/* Create a new C++ instance */
|
|
1311
|
+
PlotEventData evt;
|
|
1312
|
+
|
|
1313
|
+
evt.reflectivity = t[0].cast<py::list>();
|
|
1314
|
+
evt.shiftedData = t[1].cast<py::list>();
|
|
1315
|
+
evt.sldProfiles = t[2].cast<py::list>();
|
|
1316
|
+
evt.resampledLayers = t[3].cast<py::list>();
|
|
1317
|
+
evt.subRoughs = t[4].cast<py::array_t<double>>();
|
|
1318
|
+
evt.resample = t[5].cast<py::array_t<double>>();
|
|
1319
|
+
evt.dataPresent = t[6].cast<py::array_t<double>>();
|
|
1320
|
+
evt.modelType = t[7].cast<std::string>();
|
|
1321
|
+
evt.contrastNames = t[8].cast<py::list>();
|
|
1322
|
+
|
|
1323
|
+
return evt;
|
|
1324
|
+
}));
|
|
1272
1325
|
|
|
1273
1326
|
py::class_<ProgressEventData>(m, "ProgressEventData")
|
|
1274
1327
|
.def(py::init<>())
|
|
1275
1328
|
.def_readwrite("message", &ProgressEventData::message)
|
|
1276
|
-
.def_readwrite("percent", &ProgressEventData::percent)
|
|
1329
|
+
.def_readwrite("percent", &ProgressEventData::percent)
|
|
1330
|
+
.def(py::pickle(
|
|
1331
|
+
[](const ProgressEventData &evt) { // __getstate__
|
|
1332
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1333
|
+
return py::make_tuple(evt.message, evt.percent);
|
|
1334
|
+
},
|
|
1335
|
+
[](py::tuple t) { // __setstate__
|
|
1336
|
+
if (t.size() != 2)
|
|
1337
|
+
throw std::runtime_error("Encountered invalid state unpickling ProgressEventData object!");
|
|
1338
|
+
|
|
1339
|
+
/* Create a new C++ instance */
|
|
1340
|
+
ProgressEventData evt;
|
|
1341
|
+
|
|
1342
|
+
evt.message = t[0].cast<std::string>();
|
|
1343
|
+
evt.percent = t[1].cast<double>();
|
|
1344
|
+
|
|
1345
|
+
return evt;
|
|
1346
|
+
}));
|
|
1277
1347
|
|
|
1278
1348
|
py::class_<ConfidenceIntervals>(m, "ConfidenceIntervals")
|
|
1279
1349
|
.def(py::init<>())
|
|
@@ -1366,7 +1436,31 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1366
1436
|
.def_readwrite("fitBulkIn", &Checks::fitBulkIn)
|
|
1367
1437
|
.def_readwrite("fitBulkOut", &Checks::fitBulkOut)
|
|
1368
1438
|
.def_readwrite("fitResolutionParam", &Checks::fitResolutionParam)
|
|
1369
|
-
.def_readwrite("fitDomainRatio", &Checks::fitDomainRatio)
|
|
1439
|
+
.def_readwrite("fitDomainRatio", &Checks::fitDomainRatio)
|
|
1440
|
+
.def(py::pickle(
|
|
1441
|
+
[](const Checks &chk) { // __getstate__
|
|
1442
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1443
|
+
return py::make_tuple(chk.fitParam, chk.fitBackgroundParam, chk.fitQzshift, chk.fitScalefactor, chk.fitBulkIn, chk.fitBulkOut,
|
|
1444
|
+
chk.fitResolutionParam, chk.fitDomainRatio);
|
|
1445
|
+
},
|
|
1446
|
+
[](py::tuple t) { // __setstate__
|
|
1447
|
+
if (t.size() != 8)
|
|
1448
|
+
throw std::runtime_error("Encountered invalid state unpickling Checks object!");
|
|
1449
|
+
|
|
1450
|
+
/* Create a new C++ instance */
|
|
1451
|
+
Checks chk;
|
|
1452
|
+
|
|
1453
|
+
chk.fitParam = t[0].cast<py::array_t<real_T>>();
|
|
1454
|
+
chk.fitBackgroundParam = t[1].cast<py::array_t<real_T>>();
|
|
1455
|
+
chk.fitQzshift = t[2].cast<py::array_t<real_T>>();
|
|
1456
|
+
chk.fitScalefactor = t[3].cast<py::array_t<real_T>>();
|
|
1457
|
+
chk.fitBulkIn = t[4].cast<py::array_t<real_T>>();
|
|
1458
|
+
chk.fitBulkOut = t[5].cast<py::array_t<real_T>>();
|
|
1459
|
+
chk.fitResolutionParam = t[6].cast<py::array_t<real_T>>();
|
|
1460
|
+
chk.fitDomainRatio = t[7].cast<py::array_t<real_T>>();
|
|
1461
|
+
|
|
1462
|
+
return chk;
|
|
1463
|
+
}));
|
|
1370
1464
|
|
|
1371
1465
|
py::class_<Limits>(m, "Limits")
|
|
1372
1466
|
.def(py::init<>())
|
|
@@ -1377,7 +1471,31 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1377
1471
|
.def_readwrite("bulkIn", &Limits::bulkIn)
|
|
1378
1472
|
.def_readwrite("bulkOut", &Limits::bulkOut)
|
|
1379
1473
|
.def_readwrite("resolutionParam", &Limits::resolutionParam)
|
|
1380
|
-
.def_readwrite("domainRatio", &Limits::domainRatio)
|
|
1474
|
+
.def_readwrite("domainRatio", &Limits::domainRatio)
|
|
1475
|
+
.def(py::pickle(
|
|
1476
|
+
[](const Limits &lim) { // __getstate__
|
|
1477
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1478
|
+
return py::make_tuple(lim.param, lim.backgroundParam, lim.qzshift, lim.scalefactor, lim.bulkIn, lim.bulkOut,
|
|
1479
|
+
lim.resolutionParam, lim.domainRatio);
|
|
1480
|
+
},
|
|
1481
|
+
[](py::tuple t) { // __setstate__
|
|
1482
|
+
if (t.size() != 8)
|
|
1483
|
+
throw std::runtime_error("Encountered invalid state unpickling Limits object!");
|
|
1484
|
+
|
|
1485
|
+
/* Create a new C++ instance */
|
|
1486
|
+
Limits lim;
|
|
1487
|
+
|
|
1488
|
+
lim.param = t[0].cast<py::array_t<real_T>>();
|
|
1489
|
+
lim.backgroundParam = t[1].cast<py::array_t<real_T>>();
|
|
1490
|
+
lim.qzshift = t[2].cast<py::array_t<real_T>>();
|
|
1491
|
+
lim.scalefactor = t[3].cast<py::array_t<real_T>>();
|
|
1492
|
+
lim.bulkIn = t[4].cast<py::array_t<real_T>>();
|
|
1493
|
+
lim.bulkOut = t[5].cast<py::array_t<real_T>>();
|
|
1494
|
+
lim.resolutionParam = t[6].cast<py::array_t<real_T>>();
|
|
1495
|
+
lim.domainRatio = t[7].cast<py::array_t<real_T>>();
|
|
1496
|
+
|
|
1497
|
+
return lim;
|
|
1498
|
+
}));
|
|
1381
1499
|
|
|
1382
1500
|
py::class_<Priors>(m, "Priors")
|
|
1383
1501
|
.def(py::init<>())
|
|
@@ -1390,8 +1508,34 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1390
1508
|
.def_readwrite("resolutionParam", &Priors::resolutionParam)
|
|
1391
1509
|
.def_readwrite("domainRatio", &Priors::domainRatio)
|
|
1392
1510
|
.def_readwrite("priorNames", &Priors::priorNames)
|
|
1393
|
-
.def_readwrite("priorValues", &Priors::priorValues)
|
|
1394
|
-
|
|
1511
|
+
.def_readwrite("priorValues", &Priors::priorValues)
|
|
1512
|
+
.def(py::pickle(
|
|
1513
|
+
[](const Priors &prior) { // __getstate__
|
|
1514
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1515
|
+
return py::make_tuple(prior.param, prior.backgroundParam, prior.qzshift, prior.scalefactor, prior.bulkIn,
|
|
1516
|
+
prior.bulkOut, prior.resolutionParam, prior.domainRatio, prior.priorNames, prior.priorValues);
|
|
1517
|
+
},
|
|
1518
|
+
[](py::tuple t) { // __setstate__
|
|
1519
|
+
if (t.size() != 10)
|
|
1520
|
+
throw std::runtime_error("Encountered invalid state unpickling Limits object!");
|
|
1521
|
+
|
|
1522
|
+
/* Create a new C++ instance */
|
|
1523
|
+
Priors prior;
|
|
1524
|
+
|
|
1525
|
+
prior.param = t[0].cast<py::list>();
|
|
1526
|
+
prior.backgroundParam = t[1].cast<py::list>();
|
|
1527
|
+
prior.qzshift = t[2].cast<py::list>();
|
|
1528
|
+
prior.scalefactor = t[3].cast<py::list>();
|
|
1529
|
+
prior.bulkIn = t[4].cast<py::list>();
|
|
1530
|
+
prior.bulkOut = t[5].cast<py::list>();
|
|
1531
|
+
prior.resolutionParam = t[6].cast<py::list>();
|
|
1532
|
+
prior.domainRatio = t[7].cast<py::list>();
|
|
1533
|
+
prior.priorNames = t[8].cast<py::list>();
|
|
1534
|
+
prior.priorValues = t[9].cast<py::array_t<real_T>>();
|
|
1535
|
+
|
|
1536
|
+
return prior;
|
|
1537
|
+
}));
|
|
1538
|
+
|
|
1395
1539
|
py::class_<Cells>(m, "Cells")
|
|
1396
1540
|
.def(py::init<>())
|
|
1397
1541
|
.def_readwrite("f1", &Cells::f1)
|
|
@@ -1414,7 +1558,44 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1414
1558
|
.def_readwrite("f18", &Cells::f18)
|
|
1415
1559
|
.def_readwrite("f19", &Cells::f19)
|
|
1416
1560
|
.def_readwrite("f20", &Cells::f20)
|
|
1417
|
-
.def_readwrite("f21", &Cells::f21)
|
|
1561
|
+
.def_readwrite("f21", &Cells::f21)
|
|
1562
|
+
.def(py::pickle(
|
|
1563
|
+
[](const Cells &cell) { // __getstate__
|
|
1564
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1565
|
+
return py::make_tuple(cell.f1, cell.f2, cell.f3, cell.f4, cell.f5, cell.f6, cell.f7, cell.f8, cell.f9, cell.f10, cell.f11,
|
|
1566
|
+
cell.f12, cell.f13, cell.f14, cell.f15, cell.f16, cell.f17, cell.f18, cell.f19, cell.f20, cell.f21);
|
|
1567
|
+
},
|
|
1568
|
+
[](py::tuple t) { // __setstate__
|
|
1569
|
+
if (t.size() != 21)
|
|
1570
|
+
throw std::runtime_error("Encountered invalid state unpickling Cells object!");
|
|
1571
|
+
|
|
1572
|
+
/* Create a new C++ instance */
|
|
1573
|
+
Cells cell;
|
|
1574
|
+
|
|
1575
|
+
cell.f1 = t[0].cast<py::list>();
|
|
1576
|
+
cell.f2 = t[1].cast<py::list>();
|
|
1577
|
+
cell.f3 = t[2].cast<py::list>();
|
|
1578
|
+
cell.f4 = t[3].cast<py::list>();
|
|
1579
|
+
cell.f5 = t[4].cast<py::list>();
|
|
1580
|
+
cell.f6 = t[5].cast<py::list>();
|
|
1581
|
+
cell.f7 = t[6].cast<py::list>();
|
|
1582
|
+
cell.f8 = t[7].cast<py::list>();
|
|
1583
|
+
cell.f9 = t[8].cast<py::list>();
|
|
1584
|
+
cell.f10 = t[9].cast<py::list>();
|
|
1585
|
+
cell.f11 = t[10].cast<py::list>();
|
|
1586
|
+
cell.f12 = t[11].cast<py::list>();
|
|
1587
|
+
cell.f13 = t[12].cast<py::list>();
|
|
1588
|
+
cell.f14 = t[13].cast<py::list>();
|
|
1589
|
+
cell.f15 = t[14].cast<py::list>();
|
|
1590
|
+
cell.f16 = t[15].cast<py::list>();
|
|
1591
|
+
cell.f17 = t[16].cast<py::list>();
|
|
1592
|
+
cell.f18 = t[17].cast<py::list>();
|
|
1593
|
+
cell.f19 = t[18].cast<py::list>();
|
|
1594
|
+
cell.f20 = t[19].cast<py::list>();
|
|
1595
|
+
cell.f21 = t[20].cast<py::list>();
|
|
1596
|
+
|
|
1597
|
+
return cell;
|
|
1598
|
+
}));
|
|
1418
1599
|
|
|
1419
1600
|
py::class_<Control>(m, "Control")
|
|
1420
1601
|
.def(py::init<>())
|
|
@@ -1436,7 +1617,8 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1436
1617
|
.def_readwrite("propScale", &Control::propScale)
|
|
1437
1618
|
.def_readwrite("nsTolerance", &Control::nsTolerance)
|
|
1438
1619
|
.def_readwrite("calcSldDuringFit", &Control::calcSldDuringFit)
|
|
1439
|
-
.def_readwrite("
|
|
1620
|
+
.def_readwrite("resampleMinAngle", &Control::resampleMinAngle)
|
|
1621
|
+
.def_readwrite("resampleNPoints", &Control::resampleNPoints)
|
|
1440
1622
|
.def_readwrite("updateFreq", &Control::updateFreq)
|
|
1441
1623
|
.def_readwrite("updatePlotFreq", &Control::updatePlotFreq)
|
|
1442
1624
|
.def_readwrite("nSamples", &Control::nSamples)
|
|
@@ -1445,8 +1627,69 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1445
1627
|
.def_readwrite("pUnitGamma", &Control::pUnitGamma)
|
|
1446
1628
|
.def_readwrite("boundHandling", &Control::boundHandling)
|
|
1447
1629
|
.def_readwrite("adaptPCR", &Control::adaptPCR)
|
|
1448
|
-
.def_readwrite("checks", &Control::checks)
|
|
1449
|
-
|
|
1630
|
+
.def_readwrite("checks", &Control::checks)
|
|
1631
|
+
.def_readwrite("IPCFilePath", &Control::IPCFilePath)
|
|
1632
|
+
.def(py::pickle(
|
|
1633
|
+
[](const Control &ctrl) { // __getstate__
|
|
1634
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1635
|
+
return py::make_tuple(ctrl.parallel, ctrl.procedure, ctrl.display, ctrl.xTolerance, ctrl.funcTolerance,
|
|
1636
|
+
ctrl.maxFuncEvals, ctrl.maxIterations, ctrl.populationSize, ctrl.fWeight, ctrl.crossoverProbability,
|
|
1637
|
+
ctrl.targetValue, ctrl.numGenerations, ctrl.strategy, ctrl.nLive, ctrl.nMCMC, ctrl.propScale,
|
|
1638
|
+
ctrl.nsTolerance, ctrl.calcSldDuringFit, ctrl.resampleMinAngle, ctrl.resampleNPoints,
|
|
1639
|
+
ctrl.updateFreq, ctrl.updatePlotFreq, ctrl.nSamples, ctrl.nChains, ctrl.jumpProbability, ctrl.pUnitGamma,
|
|
1640
|
+
ctrl.boundHandling, ctrl.adaptPCR, ctrl.IPCFilePath, ctrl.checks.fitParam, ctrl.checks.fitBackgroundParam,
|
|
1641
|
+
ctrl.checks.fitQzshift, ctrl.checks.fitScalefactor, ctrl.checks.fitBulkIn, ctrl.checks.fitBulkOut,
|
|
1642
|
+
ctrl.checks.fitResolutionParam, ctrl.checks.fitDomainRatio);
|
|
1643
|
+
},
|
|
1644
|
+
[](py::tuple t) { // __setstate__
|
|
1645
|
+
if (t.size() != 37)
|
|
1646
|
+
throw std::runtime_error("Encountered invalid state unpickling ProblemDefinition object!");
|
|
1647
|
+
|
|
1648
|
+
/* Create a new C++ instance */
|
|
1649
|
+
Control ctrl;
|
|
1650
|
+
|
|
1651
|
+
ctrl.parallel = t[0].cast<std::string>();
|
|
1652
|
+
ctrl.procedure = t[1].cast<std::string>();
|
|
1653
|
+
ctrl.display = t[2].cast<std::string>();
|
|
1654
|
+
ctrl.xTolerance = t[3].cast<real_T>();
|
|
1655
|
+
ctrl.funcTolerance = t[4].cast<real_T>();
|
|
1656
|
+
ctrl.maxFuncEvals = t[5].cast<real_T>();
|
|
1657
|
+
ctrl.maxIterations = t[6].cast<real_T>();
|
|
1658
|
+
ctrl.populationSize = t[7].cast<real_T>();
|
|
1659
|
+
ctrl.fWeight = t[8].cast<real_T>();
|
|
1660
|
+
ctrl.crossoverProbability = t[9].cast<real_T>();
|
|
1661
|
+
ctrl.targetValue = t[10].cast<real_T>();
|
|
1662
|
+
ctrl.numGenerations = t[11].cast<real_T>();
|
|
1663
|
+
ctrl.strategy = t[12].cast<real_T>();
|
|
1664
|
+
ctrl.nLive = t[13].cast<real_T>();
|
|
1665
|
+
ctrl.nMCMC = t[14].cast<real_T>();
|
|
1666
|
+
ctrl.propScale = t[15].cast<real_T>();
|
|
1667
|
+
ctrl.nsTolerance = t[16].cast<real_T>();
|
|
1668
|
+
ctrl.calcSldDuringFit = t[17].cast<boolean_T>();
|
|
1669
|
+
ctrl.resampleMinAngle = t[18].cast<real_T>();
|
|
1670
|
+
ctrl.resampleNPoints = t[19].cast<real_T>();
|
|
1671
|
+
ctrl.updateFreq = t[20].cast<real_T>();
|
|
1672
|
+
ctrl.updatePlotFreq = t[21].cast<real_T>();
|
|
1673
|
+
ctrl.nSamples = t[22].cast<real_T>();
|
|
1674
|
+
ctrl.nChains = t[23].cast<real_T>();
|
|
1675
|
+
ctrl.jumpProbability = t[24].cast<real_T>();
|
|
1676
|
+
ctrl.pUnitGamma = t[25].cast<real_T>();
|
|
1677
|
+
ctrl.boundHandling = t[26].cast<std::string>();
|
|
1678
|
+
ctrl.adaptPCR = t[27].cast<boolean_T>();
|
|
1679
|
+
ctrl.IPCFilePath = t[28].cast<std::string>();
|
|
1680
|
+
|
|
1681
|
+
ctrl.checks.fitParam = t[29].cast<py::array_t<real_T>>();
|
|
1682
|
+
ctrl.checks.fitBackgroundParam = t[30].cast<py::array_t<real_T>>();
|
|
1683
|
+
ctrl.checks.fitQzshift = t[31].cast<py::array_t<real_T>>();
|
|
1684
|
+
ctrl.checks.fitScalefactor = t[32].cast<py::array_t<real_T>>();
|
|
1685
|
+
ctrl.checks.fitBulkIn = t[33].cast<py::array_t<real_T>>();
|
|
1686
|
+
ctrl.checks.fitBulkOut = t[34].cast<py::array_t<real_T>>();
|
|
1687
|
+
ctrl.checks.fitResolutionParam = t[35].cast<py::array_t<real_T>>();
|
|
1688
|
+
ctrl.checks.fitDomainRatio = t[36].cast<py::array_t<real_T>>();
|
|
1689
|
+
|
|
1690
|
+
return ctrl;
|
|
1691
|
+
}));
|
|
1692
|
+
|
|
1450
1693
|
py::class_<ProblemDefinition>(m, "ProblemDefinition")
|
|
1451
1694
|
.def(py::init<>())
|
|
1452
1695
|
.def_readwrite("contrastBackgroundParams", &ProblemDefinition::contrastBackgroundParams)
|
|
@@ -1479,7 +1722,58 @@ PYBIND11_MODULE(rat_core, m) {
|
|
|
1479
1722
|
.def_readwrite("fitParams", &ProblemDefinition::fitParams)
|
|
1480
1723
|
.def_readwrite("otherParams", &ProblemDefinition::otherParams)
|
|
1481
1724
|
.def_readwrite("fitLimits", &ProblemDefinition::fitLimits)
|
|
1482
|
-
.def_readwrite("otherLimits", &ProblemDefinition::otherLimits)
|
|
1725
|
+
.def_readwrite("otherLimits", &ProblemDefinition::otherLimits)
|
|
1726
|
+
.def(py::pickle(
|
|
1727
|
+
[](const ProblemDefinition &p) { // __getstate__
|
|
1728
|
+
/* Return a tuple that fully encodes the state of the object */
|
|
1729
|
+
return py::make_tuple(p.contrastBackgroundParams, p.contrastBackgroundActions, p.TF, p.resample, p.dataPresent, p.oilChiDataPresent,
|
|
1730
|
+
p.numberOfContrasts, p.geometry, p.useImaginary, p.contrastQzshifts, p.contrastScalefactors,
|
|
1731
|
+
p.contrastBulkIns, p.contrastBulkOuts, p.contrastResolutionParams, p.backgroundParams,
|
|
1732
|
+
p.qzshifts, p.scalefactors, p.bulkIn, p.bulkOut, p.resolutionParams, p.params,
|
|
1733
|
+
p.numberOfLayers, p.modelType, p.contrastCustomFiles, p.contrastDomainRatios,
|
|
1734
|
+
p.domainRatio, p.numberOfDomainContrasts, p.fitParams, p.otherParams, p.fitLimits, p.otherLimits);
|
|
1735
|
+
},
|
|
1736
|
+
[](py::tuple t) { // __setstate__
|
|
1737
|
+
if (t.size() != 31)
|
|
1738
|
+
throw std::runtime_error("Encountered invalid state unpickling ProblemDefinition object!");
|
|
1739
|
+
|
|
1740
|
+
/* Create a new C++ instance */
|
|
1741
|
+
ProblemDefinition p;
|
|
1742
|
+
|
|
1743
|
+
p.contrastBackgroundParams = t[0].cast<py::array_t<real_T>>();
|
|
1744
|
+
p.contrastBackgroundActions = t[1].cast<py::array_t<real_T>>();
|
|
1745
|
+
p.TF = t[2].cast<std::string>();
|
|
1746
|
+
p.resample = t[3].cast<py::array_t<real_T>>();
|
|
1747
|
+
p.dataPresent = t[4].cast<py::array_t<real_T>>();
|
|
1748
|
+
p.oilChiDataPresent = t[5].cast<py::array_t<real_T>>();
|
|
1749
|
+
p.numberOfContrasts = t[6].cast<real_T>();
|
|
1750
|
+
p.geometry = t[7].cast<std::string>();
|
|
1751
|
+
p.useImaginary = t[8].cast<bool>();
|
|
1752
|
+
p.contrastQzshifts = t[9].cast<py::array_t<real_T>>();
|
|
1753
|
+
p.contrastScalefactors = t[10].cast<py::array_t<real_T>>();
|
|
1754
|
+
p.contrastBulkIns = t[11].cast<py::array_t<real_T>>();
|
|
1755
|
+
p.contrastBulkOuts = t[12].cast<py::array_t<real_T>>();
|
|
1756
|
+
p.contrastResolutionParams = t[13].cast<py::array_t<real_T>>();
|
|
1757
|
+
p.backgroundParams = t[14].cast<py::array_t<real_T>>();
|
|
1758
|
+
p.qzshifts = t[15].cast<py::array_t<real_T>>();
|
|
1759
|
+
p.scalefactors = t[16].cast<py::array_t<real_T>>();
|
|
1760
|
+
p.bulkIn= t[17].cast<py::array_t<real_T>>();
|
|
1761
|
+
p.bulkOut= t[18].cast<py::array_t<real_T>>();
|
|
1762
|
+
p.resolutionParams= t[19].cast<py::array_t<real_T>>();
|
|
1763
|
+
p.params = t[20].cast<py::array_t<real_T>>(),
|
|
1764
|
+
p.numberOfLayers = t[21].cast<real_T>();
|
|
1765
|
+
p.modelType = t[22].cast<std::string>();
|
|
1766
|
+
p.contrastCustomFiles = t[23].cast<py::array_t<real_T>>();
|
|
1767
|
+
p.contrastDomainRatios = t[24].cast<py::array_t<real_T>>(),
|
|
1768
|
+
p.domainRatio = t[25].cast<py::array_t<real_T>>();
|
|
1769
|
+
p.numberOfDomainContrasts = t[26].cast<real_T>();
|
|
1770
|
+
p.fitParams = t[27].cast<py::array_t<real_T>>();
|
|
1771
|
+
p.otherParams = t[28].cast<py::array_t<real_T>>();
|
|
1772
|
+
p.fitLimits = t[29].cast<py::array_t<real_T>>();
|
|
1773
|
+
p.otherLimits = t[30].cast<py::array_t<real_T>>();
|
|
1774
|
+
|
|
1775
|
+
return p;
|
|
1776
|
+
}));
|
|
1483
1777
|
|
|
1484
1778
|
m.def("RATMain", &RATMain, "Entry point for the main reflectivity computation.");
|
|
1485
1779
|
|
|
@@ -8,7 +8,7 @@ from setuptools import Extension, find_packages, setup
|
|
|
8
8
|
from setuptools.command.build_clib import build_clib
|
|
9
9
|
from setuptools.command.build_ext import build_ext
|
|
10
10
|
|
|
11
|
-
__version__ = "0.0.0.
|
|
11
|
+
__version__ = "0.0.0.dev2"
|
|
12
12
|
PACKAGE_NAME = "RATapi"
|
|
13
13
|
|
|
14
14
|
with open("README.md") as f:
|
|
@@ -177,7 +177,7 @@ setup(
|
|
|
177
177
|
':python_version < "3.11"': ["StrEnum >= 0.4.15"],
|
|
178
178
|
"Dev": ["pytest>=7.4.0", "pytest-cov>=4.1.0", "ruff>=0.4.10"],
|
|
179
179
|
"Matlab_latest": ["matlabengine"],
|
|
180
|
-
"Matlab_2023b": ["matlabengine == 23.2.
|
|
180
|
+
"Matlab_2023b": ["matlabengine == 23.2.3"],
|
|
181
181
|
"Matlab_2023a": ["matlabengine == 9.14.3"],
|
|
182
182
|
"Matlab_2022b": ["matlabengine == 9.13.9"],
|
|
183
183
|
"Matlab_2022a": ["matlabengine == 9.12.19"],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/convert_rascal_project/convert_rascal.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/languages/run_custom_file_languages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/DSPC_standard_layers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RATapi-0.0.0.dev1 → RATapi-0.0.0.dev2}/RATapi/examples/non_polarised/custom_bilayer_DSPC.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|