Closed maxinelasp closed 4 months ago
I get the same error when trying to update IMAP_DATA_DIR using the CLI
Good catch! I think that is because we hadn't fully brought the IMAP_DATA_DIR
portion of the code from imap_processing over here:
https://github.com/IMAP-Science-Operations-Center/imap_processing/blob/a29978f3a31d5f1ff10f256245e5eb4ab20a8b37/imap_processing/__init__.py#L22
Now that we've switched over to having this be more of a central repo that the other projects are going to depend on I think it makes sense to lift that over and the tests as well: https://github.com/IMAP-Science-Operations-Center/imap_processing/blob/a29978f3a31d5f1ff10f256245e5eb4ab20a8b37/imap_processing/tests/test_data_access.py#L27
That's a good catch. I bet that is the source of the issue.
Description of the issue
When importing as a library, the code does not correctly read the data directory from the IMAP_DATA_DIR environment variable
Steps to reproduce the issue
Clone imap_processing dev commit a29978f3a31d5f1ff10f256245e5eb4ab20a8b37
Run the CLI with:
python -m cli --instrument swe --level l1a --file_path imap/swe/l1a/2024/02/imap_swe_l1a_sci_20240203_20240203_v01-01.cdf --dependency "[{'instrument':'swe', 'level':'l0', 'version':'v01-01'}]"
See that it fails
update IMAP_DATA_DIR value to the expected directory (mine was /Users/maha7656/Documents/code/imap/imap_processing/imap_processing/imap-data)
see that it still fails
Code Snippet:
Expected behavior (What should happen)
Should read the data directory value from IMAP_DATA_DIR when it's set
Actual behavior (What does happen)
Defaults to $PWD/data as data directory
Additional notes
Reproducing this might need tweaking depending on data in the bucket
Affected areas (code, data, or process)
No response
Suggested fix?
Read config value differently