-
Notifications
You must be signed in to change notification settings - Fork 50
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
Enhancements to the directory tree #48
Comments
Currently is there no way to add metadata for a node without re-writing the adapter and referencing it in a yml config? For example, I have a lot of directories, and each has some tiff files and one json file. I would like to use the json file for that directory's metadata. |
Correct. I think what you want here is similar to what we added in #259 — a way to extend the existing behavior without having to rewrite a bunch of stuff. |
I think the feature you need is Line 178 in 34ede8a
and the (rough) documentation https://blueskyproject.io/tiled/explanations/scaling-down.html If the structure you need is more complex than that, we should talk about how to extend |
@J-avery32 Does |
I'm not sure. How am I supposed to hook this up to read the json file in that directory? Or are you suggesting that I rewrite the Tiff adapter? Even if I re wrote the tiff adapter I don't see any way to give my new subdirectory_handler to tiled to use. Also I will be offline until Friday. |
Ah! Never mind I think it does fit my use case. I will try it out and let you know. |
How am I supposed to pass subdirectory_handler to tiled? Is there a hook in the yml for that or am I supposed to create a new DirectoryAdapter: https://blueskyproject.io/tiled/reference/generated/tiled.adapters.files.DirectoryAdapter.html?highlight=subdirectory_handler |
You can create a config file that call a method which will load the right adapter. An example of a config file could be:
To run the config file with tiled you can use (https://blueskyproject.io/tiled/how-to/configuration.html): |
I think it might be what I want. Originally I had each tiff file be its own separate node but hadn't considered joining it into a single 3 dimensional array. However, there are some csv files in these directories as well which are important. If I were to turn each directory into a 3 dimensional array then it seems that these csv files would disappear. If there was a way to avoid that issue with the CSVs then this will work. |
@J-avery32 In #511 there are some changes that may be of interest:
|
I'll get back to you on this, but it will take me a bit to go back through my old stuff and remember what I was trying to do. |
I'm going to close this now, as I think the use case of "node backed by heterogeneous files" is now addressed nicely. Docs on how this works at a low level (in the database) are here: https://blueskyproject.io/tiled/explanations/catalog.html#data-source-asset-relation |
a.tif
becomesa
. Rationale: the file extension is not part of the "name". (Windows hides it by default.) Including it makes it confusing to do things likehttp://.../thing.xlsx?format=csv
. This does create the possibility of name collisions, but if you haveexample.tiff
andexample.json
next to each other, they are likely related --- part of the same "data" --- and need a special Adapter to deal with. Strip suffixes from filenames. #49None
. If it returnsNone
, that means, "Crawl into this subdirectory." If it returns a mimetype, that means, "I recognize this as a {TIFF sequence, Zarr directory, TileDB directory} with internal structure than an Adapter shoudl manage. Do not crawl any further. We might want to make this a list of functions to make it easy to extend default behavior. Support cases where files are not one-to-one with nodes #62Developed in a phone conversation with @tacaswell
The text was updated successfully, but these errors were encountered: