-
Notifications
You must be signed in to change notification settings - Fork 182
Conversation
Maybe we could interface with FileIO? |
@vchuravy see JuliaIO/FileIO.jl#46 - I'd like to figure out a way but I don't want to step on anyone else's toes to do so. |
Current coverage is
|
9ee644c
to
a0e799a
Compare
a0e799a
to
66f4597
Compare
This is a semi-breaking change: I have a deprecation in for |
Having something like Also, I'd like load functions to return a graph, and not a dictionary, when loading a single graph (which is by far the most common behaviour). I find the current behaviour quite annoying |
The load function allows you to specify a graph name - if you do, it will return a graph instead of a dict. |
what about returning a graph also when the name is not specified nut there is just one graph in the file? |
Then |
I don't think this would impact performance
what about this? |
I'm not so concerned about collisions with other packages. ... and type stability is a definite goal here, regardless of whether we anticipate performance problems - they will occur with this approach, and I'm not sure the benefit (a few extra characters) is worth it. You can always create your own
|
it is conflicting with FileIO.jl, I advise against doing that, we should go with something like |
They're in different namespaces. I don't really see an issue here. We don't care much when other packages reuse other functions (see, e.g., the FileIO is cool, but the reliance on a single registry that loads the first dependency that comes along seems to me to be a problem waiting to happen. |
As a user I would expect conflict with other graph libraries, but not with generic i/o libraries. What about implementing them as extensions to FileIO in LightGraphs? like
|
Adding to FileIO is in the plans assuming the registry issues can get resolved - as it stands I don't know how it's going to scale efficiently, particularly for common file formats. How do you handle CSVs, for example? In any case, I'll reconsider |
I started looking at renaming but I can't come up with anything good. I think I'd like to just keep it |
I think FileIO integration would be very nice... Implementing a way to specify what IO library to prefer in FileIO is straight forward, but hasn't been on anyone's priority list high enough to actually implement it. # overloading the constructor:
# not very clean semantically but gets the job done quickly
x = MyType("path_to_file.myext")
# the solution that I used in my first prototype of FileIO.
# it's semantically a bit cleaner ;)
x = MyType(file"path.ext")
# And the most straightforward way, working nicely with FileIO
x = load("path.ext", MyType) I'd vote, that the official interface should be the last option, and anything else should be implemented by calling that version. function load(path, typ=StandardType)
if !(typ in SupportedTypes)
error
end
end |
No description provided.