spedas / pyspedas

Python-based Space Physics Environment Data Analysis Software
https://pyspedas.readthedocs.io/
MIT License
143 stars 58 forks source link

pytplot.get_ylimits return type is wrong #803

Closed xandrd closed 3 months ago

xandrd commented 3 months ago

According to the documentation pytplot.get_ylimits, presumably should return the numeric value. However it returns DataArray

Code to reproduce

import pytplot
x_data = [1, 2, 3, 4, 5]
y_data = [1, 2, 3, 4, 5]
pytplot.store_data("Variable1", data={'x': x_data, 'y': y_data})
y1, y2 = pytplot.get_ylimits("Variable1")
print(type(y1))

Output

<class 'xarray.core.dataarray.DataArray'>

Expected

<class 'int'>
xandrd commented 3 months ago

get_ylimits is updated to match the expected behavior.