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

function naming #110

Open
femtotrader opened this issue Jul 10, 2017 · 5 comments
Open

function naming #110

femtotrader opened this issue Jul 10, 2017 · 5 comments

Comments

@femtotrader
Copy link

Hello,

I wonder if functions like quandlget or quandlsearch shouldn't be simply named get and search with an other parameter (source) being used for multiple dispatch

quandl = Quandl()
get(quandl, "GOOG/NASDAQ_QQQ")

and

search(quandl, "GDP USA", results=30)

Kind regards

@milktrader
Copy link
Owner

milktrader commented Jul 10, 2017

maybe dispatch quandl as a symbol?

search(:quandl, "GDP USA", results=30)

@milktrader
Copy link
Owner

Or probably more elegant to just use quandl(s::String) for get and quandl(s::String, n::Int) for search?

@femtotrader
Copy link
Author

femtotrader commented Jul 10, 2017

I think it's better for future usage to use quandl as a struct and not a symbol because you could store API key inside (for credentials).

You could also store in this struct session (for caching queries)...

An other point is that it will also provide a similar interface then
https://github.com/femtotrader/DataReaders.jl

and pazzo83/NOAAData.jl#1

@femtotrader
Copy link
Author

A last point is that method with same name and same signature than

search(::Symbol, ::AbstractString, ::Int)

is more probable than

search(::Quandl, ::AbstractString, ::Int)

@milktrader
Copy link
Owner

Here is the quandlget dispatch:

function quandlget(id::AbstractString; order="des", rows=100, frequency="daily",            transformation="none",  from="", to="", format="TimeArray", api_key="", silent=false)

If we change kwargs to parameters (i.e., get rid of the ;) then we have a unique dispatch for get. Is that cheating?

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

No branches or pull requests

2 participants