-
Notifications
You must be signed in to change notification settings - Fork 53
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 dummy file name for some tiffseq #592
Conversation
This seems Other thoughts, just to throw them out there: >>> d1 = {'': 0, 'a':1, 'b': 2}
>>> d1['']
0
>>> d2 = {' ': 0, 'a':1, 'b': 2}
>>> d2[' ']
0
>>> d3 = {None: 0, 'a':1, 'b': 2}
>>> d3[None]
0
# But not...
>>> d3[]
File "<stdin>", line 1
d3[]
^
SyntaxError: invalid syntax |
Since the keys also end up in path parameters, this unfortunately rules out a couple of those options:
I think we'll be happy if we stick with "The key must be a non-empty string." |
I almost feel like something super explicit might be better, even if a bit verbose:
|
Explicit and brief would be even better: "_default", "_unnamed", "_blank", "_na", etc. I favor including a non-alphanumeric to try to minimize name clashes with the user-defined sequences. Something that does not require url-encoding would be good. I suppose a leading "_" will list this key at the beginning for most sorting routines? EDIT: Or if only letters are allowed for the sequence names, that would leave "0" (zero) available. Is that too cryptic? Or too easy to confuse |
👍 for brevity. Any of these seem good to me:
Using a number would get weird in this context: c['tif']['0'][0] # first image |
I committed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but we should wait for @Wiebke to weigh in before we merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a sensible solution for unnamed sequences and I liked _unnamed
as well.
This addresses a bug with the tiff sequence code.
When the files of a tiffsequence don't start with letters, just numbers, a hash was used for the key for that node.
So:
would result in
The unit test wasn't expecting a random name for this node, so it didn't test for it.
This PR detects that case and adds an
_
in as the key name. On a call with @taxe10 and @danielballan, we debated this default root name for only a couple seconds. I'm happy to hear better ideas.