keatonb / Pyriod

Python implementation of basic period detection and fitting routines for astronomical time series.
GNU General Public License v3.0
38 stars 7 forks source link

pyriod.timeseries issue #11

Closed bpablo closed 1 year ago

bpablo commented 1 year ago

I tried the example code on a specific system.

lc = lk.search_lightcurve('eps lupi',mission='TESS')[0].download()
pyriod = Pyriod(lc)

But When I try to run timeseries.

pyriod.TimeSeries()

I keep getting the error below. I feel like this is probably user error, but I'm unsure what I might be doing wrong.


TraitError Traceback (most recent call last) Cell In [17], line 1 ----> 1 pyriod.TimeSeries()

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/Pyriod/Pyriod.py:1807, in Pyriod.TimeSeries(self) 1805 options.set_title(0, 'options') 1806 savefig = HBox([self._save_tsfig, self._tsfig_file_location]) -> 1807 return VBox([self._status, self.lcfig.canvas, savefig, options]) 1808 else: 1809 print("GUI disabled.")

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ipywidgets/widgets/widget_box.py:64, in Box.init(self, children, kwargs) 62 def init(self, children=(), kwargs): 63 kwargs['children'] = children ---> 64 super(Box, self).init(**kwargs) 65 self.on_displayed(Box._fire_children_displayed)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ipywidgets/widgets/widget.py:477, in Widget.init(self, kwargs) 475 """Public constructor""" 476 self._model_id = kwargs.pop('model_id', None) --> 477 super(Widget, self).init(kwargs) 479 Widget._call_widget_constructed(self) 480 self.open()

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:1235, in HasTraits.init(self, *args, **kwargs) 1233 for key, value in kwargs.items(): 1234 if self.has_trait(key): -> 1235 setattr(self, key, value) 1236 else: 1237 # passthrough args that don't set traits to super 1238 super_kwargs[key] = value

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:715, in TraitType.set(self, obj, value) 713 raise TraitError('The "%s" trait is read-only.' % self.name) 714 else: --> 715 self.set(obj, value)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:689, in TraitType.set(self, obj, value) 688 def set(self, obj, value): --> 689 new_value = self._validate(obj, value) 690 try: 691 old_value = obj._trait_values[self.name]

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:721, in TraitType._validate(self, obj, value) 719 return value 720 if hasattr(self, "validate"): --> 721 value = self.validate(obj, value) # type:ignore[attr-defined] 722 if obj._cross_validation_lock is False: 723 value = self._cross_validate(obj, value)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:2715, in Container.validate(self, obj, value) 2712 if value is None: 2713 return value -> 2715 value = self.validate_elements(obj, value) 2717 return value

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:2727, in Container.validate_elements(self, obj, value) 2725 v = self._trait._validate(obj, v) 2726 except TraitError as error: -> 2727 self.error(obj, v, error) 2728 else: 2729 validated.append(v)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:806, in TraitType.error(self, obj, value, error, info) 795 else: 796 error.args = ( 797 "The '%s' trait contains %s which " 798 "expected %s, not %s." (...) 804 ), 805 ) --> 806 raise error 807 else: 808 # this trait caused an error 809 if self.name is None: 810 # this is not the root trait

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:2725, in Container.validate_elements(self, obj, value) 2723 for v in value: 2724 try: -> 2725 v = self._trait._validate(obj, v) 2726 except TraitError as error: 2727 self.error(obj, v, error)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:721, in TraitType._validate(self, obj, value) 719 return value 720 if hasattr(self, "validate"): --> 721 value = self.validate(obj, value) # type:ignore[attr-defined] 722 if obj._cross_validation_lock is False: 723 value = self._cross_validate(obj, value)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:2032, in Instance.validate(self, obj, value) 2030 return value 2031 else: -> 2032 self.error(obj, value)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/traitlets.py:811, in TraitType.error(self, obj, value, error, info) 807 else: 808 # this trait caused an error 809 if self.name is None: 810 # this is not the root trait --> 811 raise TraitError(value, info or self.info(), self) 812 else: 813 # this is the root trait 814 if obj is not None:

TraitError: The 'children' trait of a VBox instance contains an Instance of a TypedTuple which expected a Widget, not the FigureCanvasAgg at '0x284a74d00'.

bpablo commented 1 year ago

Forgot to add line: %matplotlib widget

keatonb commented 1 year ago

Cheers @bpablo, glad you got it figured out. Lmk if you run into any other issues.