Skip to content
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

Simple accessors for Best, latest, 2DTime #26

Closed
dopplershift opened this issue Jun 17, 2015 · 7 comments
Closed

Simple accessors for Best, latest, 2DTime #26

dopplershift opened this issue Jun 17, 2015 · 7 comments
Assignees

Comments

@dopplershift
Copy link
Member

Like:

dap_url = siphon.catalog.get_latest_access_url("http://thredds-jumbo.unidata.ucar.edu/thredds/catalog/grib/HRRR/CONUS_3km/surface/catalog.xml”, “OPENDAP”)

Whoever wrote those docs (me) forgot about it.

@dopplershift dopplershift added this to the v0.4.0 milestone Jun 17, 2015
@dopplershift dopplershift self-assigned this Jun 17, 2015
@dopplershift
Copy link
Member Author

Actually, the current examples are using a 'Best' dataset, so this doesn't help. @lesserwhirls is there something I'm missing?

@dopplershift
Copy link
Member Author

Part of our catalog API enhancement should probably make it easy to find best, latest, etc.

@dopplershift
Copy link
Member Author

@lesserwhirls ping?

@lesserwhirls
Copy link
Collaborator

Wow, not sure how I missed your pings on this...sorry about that!

Since latest is a service, and best and full collection (2D time) are virtual datasets, their endpoint will always be known, so adding those should be easy.

Now, the big question is how do we make it easy to do. One idea is that we could add some methods the TDSCatalog Class like this:

get_latest_access_url(access_type)
get_best_access_url(access_type)
get_2D_time_access_url(access_type)

For each of those methods, we could check to see:

  1. Is there a the latest, best, or 2D time dataset in the catalog?
  2. If so, pick a default access:
  • Is cdmremote enabled? If yes, use it.
  • is OPENDAP enabled? if yes, use it.
  • if no cdmremote or OPENDAP access method...profit? Yeah, not sure. Maybe return empty string a use a warnings.warn message that includes the access methods that are enabled on the dataset?.
    1. If not: more profit? Return an empty string?

@dopplershift
Copy link
Member Author

What about making best, twod, and latest attributes/properties that are dictionaries (just like access_urls)? The more I look at it, get_foo_access_url is really verbose and long.

Properties would allow resolving it lazily. Attribute-like access seems like the API I'd like to use.

On Jul 3, 2015, at 11:27, Sean Arms notifications@github.com wrote:

Wow, not sure how I missed your pings on this...sorry about that!

Since latest is a service, and best and full collection (2D time) are virtual datasets, their endpoint will always be known, so adding those should be easy.

Now, the big question is how do we make it easy to do. One idea is that we could add some methods the TDSCatalog Class like this:

get_latest_access_url(access_type)
get_best_access_url(access_type)
get_2D_time_access_url(access_type)
For each of those methods, we could check to see:

  1. Is there a the latest, best, or 2D time dataset in the catalog?
  2. If so, pick a default access:

Is cdmremote enabled? If yes, use it.
is OPENDAP enabled? if yes, use it.
if no cdmremote or OPENDAP access method...profit? Yeah, not sure. Maybe return empty string a use a warnings.warn message that includes the access methods that are enabled on the dataset?.
If not: more profit? Return an empty string?

Reply to this email directly or view it on GitHub.

@lesserwhirls
Copy link
Collaborator

That works too. I'm not against using attributes.

@dopplershift dopplershift removed this from the 2015 Python Training Workshop milestone Jul 15, 2015
@dopplershift dopplershift changed the title Use get_latest_access_url in the examples Simple accessors for Best, latest, 2DTime Jul 15, 2015
@dopplershift
Copy link
Member Author

I think the ideas in here are supplanted by #137.

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

No branches or pull requests

2 participants