Skip to content

Commit

Permalink
Merge pull request #494 from lmauviard/491-derive-class-not-working
Browse files Browse the repository at this point in the history
Corrected deepcopy bug on instrument and data
  • Loading branch information
drannawatts authored Dec 11, 2024
2 parents 98387f1 + 01306a4 commit cfe2b50
Showing 1 changed file with 14 additions and 2 deletions.
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

0 comments on commit cfe2b50

Please sign in to comment.