-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fallback to remote data files while JSOC is unavailable #346
base: main
Are you sure you want to change the base?
Conversation
381a6de
to
536ed51
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not left very many useful comments here, but my high-level suggestion would be to refactor this such that get_response_table
is unchanged and to instead just pass in the appropriate paths (using the appropriate version number) in the functions that call get_response_table
. The same goes for get_error_table
.
This is making me realize that all of the logic around how this information is pulled into the higher-level functions is overly complex which is largely my fault. However, this refactor should be independent of what is going on with the JSOC currently.
try: | ||
keys = drms.Client().query( | ||
f"aia.lev1[{(t - 3*u.s).utc.isot}/6s]", | ||
key="T_OBS, HAEX_OBS, HAEY_OBS, HAEZ_OBS", | ||
) | ||
except Exception as e: | ||
msg = "Unable to query the JSOC for SDO location.\n" f"Error message: {e}" | ||
raise OSError(msg) from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This try...except
is in multiple places. Could we add a decorator instead that returns some standard error message about the JSOC being down? That would also make it significantly easier to remove all of this logic once it comes back up.
@manager.require("response_table_v10", *URL_HASH_RESPONSE_TABLE[10]) | ||
def fetch_response_table_v10(): | ||
return manager.get("response_table_v10") | ||
|
||
|
||
@manager.require("response_table_v9", *URL_HASH_RESPONSE_TABLE[9]) | ||
def fetch_response_table_v9(): | ||
return manager.get("response_table_v9") | ||
|
||
|
||
@manager.require("response_table_v8", *URL_HASH_RESPONSE_TABLE[8]) | ||
def fetch_response_table_v8(): | ||
return manager.get("response_table_v8") | ||
|
||
|
||
@manager.require("response_table_v7", *URL_HASH_RESPONSE_TABLE[7]) | ||
def fetch_response_table_v7(): | ||
return manager.get("response_table_v7") | ||
|
||
|
||
@manager.require("response_table_v6", *URL_HASH_RESPONSE_TABLE[6]) | ||
def fetch_response_table_v6(): | ||
return manager.get("response_table_v6") | ||
|
||
|
||
@manager.require("response_table_v4", *URL_HASH_RESPONSE_TABLE[4]) | ||
def fetch_response_table_v4(): | ||
return manager.get("response_table_v4") | ||
|
||
|
||
@manager.require("response_table_v3", *URL_HASH_RESPONSE_TABLE[3]) | ||
def fetch_response_table_v3(): | ||
return manager.get("response_table_v3") | ||
|
||
|
||
@manager.require("response_table_v2", *URL_HASH_RESPONSE_TABLE[2]) | ||
def fetch_response_table_v2(): | ||
return manager.get("response_table_v2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is what is necessary to use the data manager for these files, then I think we should not use the data manager. We could always use it later using the delayed aspect that will make it into 6.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the issue is that I don't know how best to handle having 8 different versions of the file depending on user input.
0cde18c
to
fafdbb8
Compare
Due to JSOC being down, we have to resort to files online from SSWIDL or making tests as xfail.