SETI / rms-pdsfile

pdsfile Python module
Apache License 2.0
0 stars 0 forks source link

PdsFile requires environment variables to be set but shouldn't #26

Closed rfrenchseti closed 7 months ago

rfrenchseti commented 7 months ago

The old version of PdsFile did not require any environment variables to be set in order to work. You would simply call preload with the holdings directory. But the new version gives errors like:

Traceback (most recent call last):
  File "/seti/opus/rms-pdsfile/pdsfile/general_helper.py", line 11, in <module>
    PDS_HOLDINGS_DIR = os.environ['PDS_HOLDINGS_DIR']
                       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 685, in __getitem__
KeyError: 'PDS_HOLDINGS_DIR'

I don't think PdsFile should require environment variables. All directories should be able to be passed in programmatically. Also, if you aren't going to use Pds4File, you shouldn't need to initialize the PDS4 directory. Same for PDS3.