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

BUG: pysat.Instrument.empty and xarray #922

Closed
rstoneback opened this issue Oct 7, 2021 · 1 comment · Fixed by #927
Closed

BUG: pysat.Instrument.empty and xarray #922

rstoneback opened this issue Oct 7, 2021 · 1 comment · Fixed by #927
Assignees
Labels
Milestone

Comments

@rstoneback
Copy link
Collaborator

Describe the bug
pysat.Instrument.empty checks the length of time or epoch coordinates if the data format is xarray. A dataset may be loaded without one of those which ensures that the Instrument always reports it is empty. This can have other downstream consequences.

To Reproduce
Steps to reproduce the behavior:

  1. Load an xarray dataset without 'time' or 'epoch'
  2. Check Instrument.empty
  3. See error

Expected behavior
empty should be more robust for xarray. Unfortunately xarray does not have its own empty.

Desktop (please complete the following information):

  • OS: MacOS 11.5.2
  • Version Python 3.8
  • Other details about your setup that could be relevant

Additional context
pysat does have a base assumption that data is time indexed. Still, it should do a bit better when data isn't as expected, particularly since pysat doesn't complain at all!!

This bug results in no metadata being assigned. If an instrument reports empty then loaded metadata is not assigned to the Instrument.

@jklenzing jklenzing added the bug label Oct 7, 2021
@jklenzing jklenzing added this to the 3.1.0 Release milestone Oct 13, 2021
@jklenzing jklenzing self-assigned this Oct 13, 2021
@jklenzing jklenzing linked a pull request Oct 13, 2021 that will close this issue
10 tasks
@jklenzing
Copy link
Member

Closing with merge of #927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants