Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected deepcopy bug on instrument and data #494

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions xpsi/Signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ def __init__(self,
if not isinstance(data, Data):
raise TypeError('Invalid type for a data object.')
else:
self._data = deepcopy(data)
self._data = data
self._original_data = deepcopy(data)

if not isinstance(instrument, Instrument):
raise TypeError('Invalid type for an instrument object.')
else:
self._instrument = deepcopy( instrument )
self._instrument = instrument
self._original_instrument = deepcopy( instrument )

# Trimming the data and response so they fit together
if min_channel != 0 or max_channel != -1:
Expand Down Expand Up @@ -280,7 +282,17 @@ def interstellar(self):
def instrument(self):
""" Get the instance of :class:`~.Instrument.Instrument`."""
return self._instrument

@property
def original_data(self):
""" Get the a copy of the original instance of :class:`~.Data.Data`."""
return self._original_data

@property
def original_instrument(self):
""" Get the a copy of the original instance of :class:`~.Instrument.Instrument`."""
return self._original_instrument

@property
def photosphere(self):
return self._photosphere
Expand Down
Loading