Skip to content

OneSdsc usability: specifying locations (popeye/SDSC) by kwarg, rest caching disabled by default#121

Open
grg2rsr wants to merge 3 commits into
developfrom
OneSDSC_locations
Open

OneSdsc usability: specifying locations (popeye/SDSC) by kwarg, rest caching disabled by default#121
grg2rsr wants to merge 3 commits into
developfrom
OneSDSC_locations

Conversation

@grg2rsr
Copy link
Copy Markdown
Contributor

@grg2rsr grg2rsr commented Jan 15, 2026

The OneSdsc class does, as it is now, not work out of the box for datauser on SDSC because of differences in the default cache dir.

This patch:

  • exposes a new keyword argument to select the location SDSC vs popeye, and handles the setting of the correct cache dir
  • disables rest caching by default. Currently, cache_rest=None has to be passed when using OneSdsc on popeye (as users on popeye do not have write permission on the cache directory). Datauser on SDSC does, and rest caching can be enabled by setting a kwarg explicitly if it is required.

@grg2rsr grg2rsr requested a review from k1o0 January 15, 2026 11:10
…tantiate an incompatible combination of location and cache_dir kwargs
Comment thread deploy/iblsdsc.py
# Ensure parquet tables downloaded to separate location to the dataset repo
kwargs['tables_dir'] = one.params.get_cache_dir() # by default this is user downloads
kwargs["tables_dir"] = one.params.get_cache_dir() # by default this is user downloads
if disable_rest_caching:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to overload the original kwarg rather than adding a new one to avoid parameter conflicts. You could simply add cache_rest=None to the init signature.

Comment thread deploy/iblsdsc.py
raise ValueError("both location and cache dir are specified, and they are incompatible")
cache_dir = CACHE_DIR_SDSC

def __init__(self, *args, cache_dir=CACHE_DIR, **kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you've changed the default to popeye. You should make others aware of this.

Also all previous code will raise a value error because neither cache_dir, nor location are None by default so if they pass in any other cache dir path without passing location=None they're get a value error. Personally I find having two related parameters confusing and a little redundant given that you've already renamed the cache dir variables to clearer names. If this location field is not used for anything else I'd rather remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants