-
Notifications
You must be signed in to change notification settings - Fork 3
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
get Loop tags without category #110
Comments
alternatively tags should be declares as part of the public interface of Loop, or am I missing something? anyways here is a simple patch class Loop:
...
def get_tag_names(self, no_category: bool) -> List[str]:
""" Return the tag names for this entry with the category
included. Throws ValueError if the category was never set.
To fetch tag values use get_tag()."""
if not self.category:
raise ValueError("You never set the category of this loop.")
if no_category:
result = list(self.tags)
else:
result = [self.category + "." + x for x in self.tags]
return result |
I presume tags shouldn't be modified externally... |
You can access the tags without the category using the
I will consider adding it for the next release. |
Hi! Thanks John I made a guess at doing what you suggested and it worked. However, ... it wasn't clear as tag isn't in the api in the documentation, as a naive user ;-) |
We probably should have called them "dbtable" and "dbcolumn" instead of "tag category" and "tag name" back when we switched to this convention (we didn't use it in NMR-STAR v.2) because that's what they actually are. Plain STAR doesn't have "tag category": whatever's between the underscore and whitespace is just "tag". |
it doesn't appear to be possible to get the tags for a loop without the category?
if I am right it would be nice to have
?
The text was updated successfully, but these errors were encountered: