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

add methods to get driver shortname from filename extension #174

Merged
merged 5 commits into from
Mar 7, 2021

Conversation

rafaqz
Copy link
Collaborator

@rafaqz rafaqz commented Feb 22, 2021

I'm not sure if these methods are the best way to organise this kind of functionality, or the best names. But it's useful for writing arbitrary drivers without specifying them.

Closes #173

Copy link
Owner

@yeesian yeesian left a comment

Choose a reason for hiding this comment

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

Thanks, I like the approach taken here!

src/driver.jl Outdated Show resolved Hide resolved
src/driver.jl Outdated Show resolved Hide resolved
src/driver.jl Outdated Show resolved Hide resolved
src/driver.jl Show resolved Hide resolved
src/driver.jl Outdated Show resolved Hide resolved
test/test_drivers.jl Outdated Show resolved Hide resolved
src/driver.jl Outdated Show resolved Hide resolved
@rafaqz
Copy link
Collaborator Author

rafaqz commented Feb 23, 2021

Currently I'm actually returning the driver shortname. Would it be better to return the actual Driver?

@rafaqz
Copy link
Collaborator Author

rafaqz commented Feb 23, 2021

Those test failures seem to be unrelated

Copy link
Owner

@yeesian yeesian left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good now! Can we introduce unit tests for the functions before I merge this PR?

Regarding #174 (comment), I like the shortname and don't know of any reason offhand to go with the longer driver name for now.

And yeah the test failures looks unrelated so I won't worry about them in the setting of this PR.

### Returns
The metadata item on success, or an empty string on failure.
"""
function metadataitem(obj, name::AbstractString; domain::AbstractString = "")
Copy link
Owner

Choose a reason for hiding this comment

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

Can we introduce unit tests for this?

Copy link
Collaborator Author

@rafaqz rafaqz Mar 4, 2021

Choose a reason for hiding this comment

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

where do you want to put this test I made a test_utils.jl file :)


So `extensiondriver("/my/file.tif") == "GTiff"`.
"""
function extensiondriver(filename::AbstractString)
Copy link
Owner

Choose a reason for hiding this comment

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

Can we introduce unit tests for this?

@rafaqz
Copy link
Collaborator Author

rafaqz commented Mar 7, 2021

This is ready to go.

@yeesian yeesian merged commit f6f44ca into yeesian:master Mar 7, 2021
@yeesian
Copy link
Owner

yeesian commented Mar 7, 2021

Thank you! :)

@rafaqz rafaqz deleted the driver_from_extension branch March 8, 2021 04:27
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.

Guess output file driver
2 participants