Commit f22a0cc5 authored by Samuel Rowlinson's avatar Samuel Rowlinson
Browse files

Returning copy in Model.last_trace

parent 2853ed35
......@@ -2,7 +2,7 @@
used for building and manipulating interferometer systems."""
from collections import OrderedDict, defaultdict
from copy import deepcopy
from copy import copy, deepcopy
from dataclasses import dataclass
import math
from numbers import Number
......@@ -1147,12 +1147,11 @@ class Model:
@property
def last_trace(self):
"""An instance of :class:`.BeamTraceSolution` containing the output of the most
recently stored beam trace performed on the model. Stores nodes as keys and
tuples of (qx, qy) as values.
recently stored beam trace performed on the model.
:getter: Returns the most recently stored beam trace output (read-only).
:getter: Returns a copy of the most recently stored beam trace output. Read-only.
"""
return self.__last_trace
return copy(self.__last_trace)
@locked_when_built
def tag_node(self, node, tag):
......@@ -2854,8 +2853,9 @@ class Model:
qx_z *= 1 + (z_mm[0] / 100)
qy_z *= 1 + (z_mm[1] / 100)
qx_bp = BeamParam(w0=qx_w0, z=qx_z)
qy_bp = BeamParam(w0=qy_w0, z=qy_z)
nr = refractive_index(node)
qx_bp = BeamParam(w0=qx_w0, z=qx_z, nr=nr)
qy_bp = BeamParam(w0=qy_w0, z=qy_z, nr=nr)
if node in self.__gauss_commands:
self.update_gauss(node, qx_bp, qy_bp)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment