Skip to content

Commit 0bd4fad

Browse files
Adds some docstring to pybind function and some refactors (#133)
Co-authored-by: Alex H. Room <69592136+alexhroom@users.noreply.github.com>
1 parent e148415 commit 0bd4fad

File tree

9 files changed

+1323
-762
lines changed

9 files changed

+1323
-762
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include README.md
2-
recursive-include cpp/RAT *
2+
recursive-include cpp *
33
prune tests
44
prune */__pycache__
55
global-exclude .git

RATapi/utils/plotting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ def plot_ref_sld_helper(
158158
layers[-1, 1], # Bulk Out
159159
data.subRoughs[i], # roughness
160160
layer,
161-
len(layer),
162-
1.0,
161+
1,
163162
)
164163

165164
sld_plot.plot(

RATapi/wrappers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ def handle(*args):
6666
)
6767
return np.array(output, "float").tolist()
6868
else:
69-
output, sub_rough = getattr(self.engine, self.function_name)(
69+
matlab_args = [
7070
np.array(args[0], "float"), # params
7171
np.array(args[1], "float"), # bulk in
7272
np.array(args[2], "float"), # bulk out
7373
float(args[3] + 1), # contrast
74-
float(-1 if len(args) < 5 else args[4] + 1), # domain
74+
]
75+
if len(args) > 4:
76+
matlab_args.append(float(args[4] + 1)) # domain number
77+
78+
output, sub_rough = getattr(self.engine, self.function_name)(
79+
*matlab_args,
7580
nargout=2,
7681
)
7782
return np.array(output, "float").tolist(), float(sub_rough)

0 commit comments

Comments
 (0)