-
Notifications
You must be signed in to change notification settings - Fork 46
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
Allow period and hyphen in attribute names #477
Comments
I support this proposal. Given the discussions in #237 and cf-discuss #244, it's clear that there is a need to provide support for localization, but also that there are many hazards to expanding the list of allowable characters. This approach seems the be the best way to provide that support while opening up the fewest cans of worms. |
Is there a reason to to extend it to a few more punctuation characters, e.g. the colon Once names are not longer legal as programming language identifiers, maye there's no reason to restrict them more than necessary maybe a couple more chars? NOTE: I fully agree that full Unicode letters is a larger proposal that should be handled separately. |
I would oppose adding the colon. Adding However, there are also workflows that involve parsing the text output of ncdump, which uses I think we want to be very conservative when it comes to adding allowed characters, and not do it until and unless we have a clear and strong demand for it, and have had a long discussion about what could work and what problems it could cause. We've done that with |
Good point -- yes, that takes colon off the table. |
While I am in favor of the general direction this proposal is going, I also very much agree with what @sethmcg writes. Here I would like to approach this from slightly different angle. The proposal lists the following benefits:
As the proposal now stands it will certainly support these benefits but it will also come with some possible drawbacks:
I think that we need a deeper discussion on what we want to achieve by allowing the period and hyphen. In netCDF these are already allowed in attribute names, so the question is how CF wants to use them. For example:
Currently, we have one concrete use case and that is the need for localization, for which the requirements are pretty clear: to attach a language tag construct (language |
"Suffix" here is a vague reference to possible future uses for the added characters. It is not part of the new text. It does not need further definition at this time.
This particular PR adds two characters without any directed usage. This will enable any desired future usage, public or private, without violating a CF name rule. Think of it as adding punctuation characters with equal status to the underscore.
I have not given it much thought. Simple pattern recognition should take care of most cases. BCP47 is highly recognizable. Hypothetically, the details would be negotiated if there was another "suffix" proposal that had potential conflicts with BCP47.
Possibly. I am not concerned about that at this time.
Agreed. My intention is a general extension. |
In the*nix world (and pretty much everywhere other than the old DOS 8.3 system), a "suffix" is the part after the last dot in a filename. By convension, but not by fiat, that suffix is a short code indicating the file type. As chaotic as that seems, it actually works pretty well. I think that's the case here too. Step one: allow "." and "-". Step two: establish one or more conventions for how they can be used, I would think starting with the idea of a "suffix" similar to the above, and then one or more uses for that, e.g. the language spec proposed. In short, I think it's OK to leave it kind of loosey-goosey. |
Hi all, Unless anyone has any new concerns to raise, this proposal will be accepted in three weeks. |
Thanks, @sethmcg. PR #478 needs a couple of additions:
I don't think that these changes require a clock reset, as long as they're done and agreed before merging. @Dave-Allured - could you possibly add these items? Many thanks, |
In my earlier comment I had some concerns, but they were/are not strong enough. As no one else have expressed thought in the same direction I am happy to support this proposal (with the same comment as @davidhassell regarding additions). Thanks @Dave-Allured and @sethmcg! |
Three weeks have passed with no new concerns raised, so this proposal is now slated to be accepted. |
Hold until I find time for completions requested by Jonathan. |
Will do! |
Dear @Dave-Allured and @sethmcg Maybe I can help this along. One of the two outstanding things is to modify the
as a second bullet in Sect 2.3 of the conformance document. The other necessary change is to add a line at the top of the history of the working version in Cheers Jonathan |
@davidhassell @sethmcg @JonathanGregory Conformance and history docs are now updated as requested. Anything else? |
I have just added a couple of nitpicking comments in the PR. |
I think it's ready now, thanks @Dave-Allured. Would you like to merge it, @sethmcg? |
@JonathanGregory Merged! Note: the "For maintainers" section on the PR boilerplate says "After the merge remember to delete the source branch." The button to do that isn't showing up for me, but the branch also isn't showing up in the list of branches for the repo. Has the repo been set to automatically delete merged branches? If so, that reminder should probably be removed from the PR boilerplate. |
No. This is another github thing. That reminder should be aimed at the requestor, not maintainers. "Source branch" is referring to the requestor's branch, not necessarily a branch in the CF repo. It is generally the requestor's duty to clean up their own branches. Perhaps that reminder should be reworded to clarify. The way it is now, is good enough for me. |
To strictly conform with CF rules, I am considering Lars' last minute PR requests to restart the wait clock for another three weeks. You can leave this issue closed and merged the way it is now. However, it would be fair to reopen the issue if anyone thinks it is necessary. (Hint: I hope not.) Sorry I did not catch this technicality before merge. Follow up here or in the PR #478, I do not care which. |
@Dave-Allured Dave -- Sorry for the late comment! No need at all to reopen this issue, or to restart the clock. That would only be if there were some kind of material change to the proposal. And my comments was nothing of that kind. Clearly Seth and Jonathan did not think the comments needed to be considered, which I am fine with -- no problem. Thanks for your contribution Dave! |
To whom it may concern, I am reverting this change in new issue #548. This original request was based on my misunderstanding of earlier wording about character restrictions. |
Moderator: @sethmcg
Moderator Status Review: New issue, 2023 November 10
Requirement Summary: None.
Technical Proposal Summary: Add ASCII period (.) and ASCII hyphen (-) to the set of characters allowed in netCDF attribute names.
Benefits
Caveats
getattr
,putattr
must be used instead.Status Quo: Attribute names are now restricted to letters, digits, and underscore only.
Associated pull request: #478
Detailed Proposal: Add a new sentence at the end of the first paragraph of 2.3 Naming Conventions as follows. The remainder of 2.3 is left unchanged.
Note: This proposal is a subset of CF #237, and is superseded if #237 is adopted.
The text was updated successfully, but these errors were encountered: