pysat/pysatNASA

Unexpected instantiations when importing

Closed this issue · 4 comments

Describe the bug
A variety of pysatNASA instruments are instantiated when importing pysatNASA. I'm not sure why.

To Reproduce
Steps to reproduce the behavior:

In [1]: import pysat                                                                                                                                                         

In [2]: pysat.logger.setLevel(1)                                                                                                                                             

In [3]: import pysatNASA                                                                                                                                                     

pysat DEBUG: Missing Instrument methods: ['preprocess']
pysat DEBUG: These Instrument attributes kept their default  values: ['directory_format', 'file_format', 'multi_file_day', 'orbit_info', 'pandas_format']
pysat DEBUG: These Instrument test attributes kept their default  values: ['_test_download', '_test_download_travis', '_password_req']
pysat INFO: pysat is searching for de2 lang files.
pysat INFO: Found 1 local files.
pysat INFO: The Dynamics Explorer 2 satellite data is provided through CDAWeb
pysat DEBUG: Missing Instrument methods: ['preprocess']
pysat DEBUG: These Instrument attributes kept their default  values: ['directory_format', 'file_format', 'multi_file_day', 'orbit_info', 'pandas_format']
pysat DEBUG: These Instrument test attributes kept their default  values: ['_test_download', '_test_download_travis', '_password_req']
pysat INFO: pysat is searching for de2 nacs files.
pysat INFO: Found 1 local files.
pysat INFO: The Dynamics Explorer 2 satellite data is provided through CDAWeb
pysat DEBUG: Missing Instrument methods: ['preprocess']
pysat DEBUG: These Instrument attributes kept their default  values: ['directory_format', 'file_format', 'multi_file_day', 'orbit_info', 'pandas_format']
pysat DEBUG: These Instrument test attributes kept their default  values: ['_test_download', '_test_download_travis', '_password_req']
pysat INFO: pysat is searching for de2 rpa files.
pysat INFO: Found 1 local files.
pysat INFO: The Dynamics Explorer 2 satellite data is provided through CDAWeb
pysat DEBUG: Missing Instrument methods: ['preprocess']
pysat DEBUG: These Instrument attributes kept their default  values: ['directory_format', 'file_format', 'multi_file_day', 'orbit_info', 'pandas_format']
pysat DEBUG: These Instrument test attributes kept their default  values: ['_test_download', '_test_download_travis', '_password_req']
pysat INFO: pysat is searching for de2 wats files.
pysat INFO: Found 1 local files.
pysat INFO: The Dynamics Explorer 2 satellite data is provided through CDAWeb
pysat DEBUG: These Instrument attributes kept their default  values: ['directory_format', 'file_format', 'orbit_info', 'pandas_format']
pysat DEBUG: These Instrument test attributes kept their default  values: ['_test_download', '_test_download_travis', '_password_req']
pysat INFO: pysat is searching for icon ivm a files.
pysat INFO: Found 426 local files.

It then repeats the ICON acknowledgements string multiple times as it instantiates ICON instruments as well. For brevity, I have removed the duplicated preamble and I only show confirmation that an ICON instrument was instantiated.

pysat INFO: This is a data product from the NASA Ionospheric Connection Explorer mission, an Explorer launched at 21:59:45 EDT on October 10, 2019.

pysat DEBUG: These Instrument attributes kept their default  values: ['directory_format', 'file_format', 'orbit_info', 'pandas_format']
pysat DEBUG: These Instrument test attributes kept their default  values: ['_test_download_travis']
pysat INFO: pysat is searching for icon ivm b files.
pysat INFO: Found 0 local files.

Expected behavior
Why are all the instruments being instantiated? That doesn't seem necessary. I didn't see anything direct in this packages __init__ files... so I'm raising the question.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS 11.5.2
  • Version Python 3.7.6

Additional context
Add any other context about the problem here.

I don't get the same results. What branches are you using?

It's the constellations!

From the de2 file,

lang = pysat.Instrument(inst_module=instruments.de2_lang)
nacs = pysat.Instrument(inst_module=instruments.de2_nacs)
rpa = pysat.Instrument(inst_module=instruments.de2_rpa)
wats = pysat.Instrument(inst_module=instruments.de2_wats)

instruments = [lang, nacs, rpa, wats]

I'm on develop though I was apparently 37 commits behind.

This is a pysat constellation design issue.

OK, I can duplicate this now. Needed to reset.

One option for fixing this locally is to temporarily reset the logger level while initializing the constellations. This could be handled at the package level while a fix is pushed at pysat.