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

remove TODO #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
22 changes: 6 additions & 16 deletions astropysics/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,27 +1279,17 @@ def plotSpylot(self,spylotinstance=None,show=True):
:returns: A :class:`~astropysics.gui.spylot.Spylot` instance.

"""
from operator import isMappingType
from .gui.spylot import Spylot

from astropysics.gui.spylot import Spylot
if spylotinstance is None:
spylotinstance = Spylot([self])
if show is True:
show = {}
if show:
if not isMappingType(show):
show = {}
spylotinstance.edit_traits(**show)

elif isinstance(spylotinstance,Spylot):
spylotinstance.specs.append(self)

if show:
spylotinstance.currspeci = len(spylotinstance.specs)-1
else:
spylotinstance._specs_changed() #TODO: remove this when spylot properly responds

else:
raise TypeError('spylotinstance is not a Spylot object or None')

spylotinstance.addSpectrum(self)
if show:
spylotinstance.show()
return spylotinstance


Expand Down